search
HomeCommon ProblemHow to modify the redis default port

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

(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
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

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.