>wget http://download.redis.io/releases/redis-3.2.6.tar.gz #下載redis源碼包
>tar -zxvf redis-3.2.6.tar.gz
>cd redis-3.2.6
>make test
#報錯:“You need tcl 8.5 or newer in order to run the Redis test”
>wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
>tar -zxvf tcl8.6.1-src.tar.gz
>cd tcl8.6.1/unix/
>./configure
>make && make install //安裝tcl完畢
#重新再安裝一次redis
>cd /路徑/redis-3.2.6
>make
>make test
>make install
#ok不管他有沒有報錯,反正沒報tcl的錯就行
#直接啟動redis-server服務
/路徑/redis-3.2.6/src/redis-server #這種啟動方式,會占用連接端口,關閉的話redis就會關閉
#配置守護進程
vi /路徑/redis-3.2.6/redis.conf
找到 daemonize no 改為 daemonize yes #保存退出
/路徑/redis-3.2.6/src/redis-server /路徑/redis-3.2.6/redis.conf #以守護進程模式啟動
#如果需要添加redis密碼的話
vi /路徑/redis-3.2.6/redis.conf
找到 #requirepass 去除前面的’#’ 修改為 requirepass pwd #保存退出
/路徑/redis-3.2.6/src/redis-server /路徑/redis-3.2.6/redis.conf #以配置啟動
