ubuntu服务器下安装redis
官网下载安装教程 https://redis.io/download
下载源码并编译
$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
$ tar xzf redis-5.0.5.tar.gz
$ cd redis-5.0.5
$ make
编译后的结果在src文件夹
启动redis的命令为
$ src/redis-server
配置远程访问
修改配置文件redis.config
vim redis.config
找到下面这段注释,添加密码
################################## SECURITY ###################################
# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
requirepass ******
配置任意ip都可访问
将以下配置注释掉
bind 127.0.0.1