redis 下載 https://redis.io/downloadhtml
wget http://download.redis.io/releases/redis-3.2.6.tar.gz
解壓縮redis
tar xzf redis-3.2.6.tar.gz
進入解壓後的文件目錄vim
cd redis-3.2.6
redis安裝相對簡單 直接編譯便可安全
make
建立存儲redis文件目錄測試
mkdir -p /usr/local/redis
複製redis-server redis-cli到新創建的文件夾server
cp ./redis-server /usr/local/redis/ cp ./redis-cli /usr/local/redis/
複製redis的配置文件htm
cd .. cp redis.conf /usr/local/redis/
編輯配置文件ip
cd /usr/local/redis/ vim redis.conf
改成yes 後臺運行 get
添加開機啓動服務權限控制
vim /etc/systemd/system/redis-server.service
粘貼一下內容
[Unit] Description=The redis-server Process Manager After=syslog.target network.target [Service] Type=simple PIDFile=/var/run/redis_6379.pid ExecStart=/usr/local/redis/redis-server /usr/local/redis/redis.conf ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -SIGINT $MAINPID [Install] WantedBy=multi-user.target
設置開機啓動
systemctl daemon-reload systemctl start redis-server.service systemctl enable redis-server.service
檢查是否安裝成功
建立redis命令軟鏈接[短文]
ln -s /usr/local/redis/redis-cli /usr/bin/redis
測試redis
安裝完成.
http://www.bkjia.com/sjkqy/777618.html redis密碼設置、遠程訪問權限控制等安全設置