Home Common Problem How to modify the redis default port

How to modify the redis default port

Apr 02, 2019 pm 03:27 PM

The method to modify the default port of redis is: first download the file, decompress, compile and install it. After installation, start it globally and set the password, then modify the port number, and finally specify the running configuration

How to modify the redis default port

【Recommended course: redis tutorial

(1) Download through the link below, and then use the following commands to decompress, compile, and install

Download address: http://download.redis.io/redis-stable.tar.gz

tar xzf redis-4.0.9.tar.gz
cd redis-4.0.9
make
make install
Copy after login

(2) Start globally and set the password, modify the port

First enter the redis installation directory, find utils, there will be an initialization script redis_init_script below, copy it to /etc/init.d in the directory.

How to modify the redis default port

Secondly, name the redis_init_script file redis_port number (this port is redis_6879), where the port number represents the port number that you want Redis to listen to, and the client passes this port Connect to Redis. Then modify the value of the REDISPORT variable in the script to the same port number.

How to modify the redis default port

Next, copy the configuration file template redis-4.0.7/redis.conf to the /etc/redis directory and name it with the port number (such as 6879.conf), Then edit some of the parameters and modify the port number and password.

Finally specify the running configuration, redis-server /etc/redis/6879.conf

How to modify the redis default port

Summary: The above are all the steps to modify the default port of redis. I hope it will be helpful to everyone

The above is the detailed content of How to modify the redis default port. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24