获取redis
redis下载地址: (https://redis.io/download)[https://redis.io/download]
$ wget http://download.redis.io/releases/redis-4.0.10.tar.gz
$ tar xzf redis-4.0.10.tar.gz
$ cd redis-4.0.10
安装
$ make //编译
## 将redis-server redis-cli执行程序安装在/opt/redis目录下
$ make PREFIX=/usr/local/redis install //安装
$ cp redis.conf /opt/redis/redis.conf //引入配置文件
修改redis.conf 配置文件,开启远程访问
1.将`bind 127.0.0.1`改为`#bind 127.0.0.1`
2.将`protected-mode yes`改为`protected-mode no`,
## 指定日志文件目录
logfile "/var/log/redis/server-out.log"
启动
cd /opt/redis/bin
##后台启动
./redis-server ../redis.conf &