一、Redis的配置修改
- 登入homestead
vagrant ssh
- 进入配置文件
sudo vi /etc/redis/redis.conf
二、配置Redis支持主机访问
打开配置文件,显示如下:
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1 ::1
# Protected mode is a layer of security protection, in order to avoid
# ...
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode yes
# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379
把bind 127.0.0.1 ::1
行前面增加#
注释即可。
修改protected-mode
的值为no
。关键配置,配置成下面的格式
# bind 127.0.0.1 ::1
protected-mode no