Home  >  Article  >  Database  >  How to make redis accessible from the external network

How to make redis accessible from the external network

王林
王林forward
2020-12-24 09:36:352523browse

How to make redis accessible from the external network

Prerequisite:

(Learning video sharing: redis video tutorial)

Put the redis port in the firewall plan

/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT
 /etc/rc.d/init.d/iptables save

The specific steps are as follows:

Change the redis.conf file

bind 127.0.0.1
protected-mode yes

to

# bind 127.0.0.1
protected-mode no

Then restart redis, provided that you are already running redis

Close redis

# redis-cli shutdown

redis-cli is your installation path, that is, when you make install, you will specify a path

Restart redis

redis-server /opt/local/redis/redis-4.0.6/redis.conf

redis-server is also in the installation path. In this way, setting up external network access is successful.

Related recommendations: redis database tutorial

The above is the detailed content of How to make redis accessible from the external network. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete