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

How to make redis accessible from the external network

王林
Release: 2020-12-24 09:36:35
forward
2549 people have browsed it

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
Copy after login

The specific steps are as follows:

Change the redis.conf file

bind 127.0.0.1
protected-mode yes
Copy after login

to

# bind 127.0.0.1
protected-mode no
Copy after login

Then restart redis, provided that you are already running redis

Close redis

# redis-cli shutdown
Copy after login

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
Copy after login

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!

Related labels:
source:csdn.net
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template