一、下載安裝Redis: cd /tmp wget http://redis.googlecode.com/files/redis-2.4.6.tar.gz tar -zxf redis-2.4.6.tar.gz cd redis-2.4.6 make sudo make install 2. 配置init腳本: wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf sudo mv redis-server /etc/init.d/redis-server sudo chmod +x /etc/init.d/redis-server sudo mv redis.conf /etc/redis.conf 3. 初始化用戶和日誌路徑 第一次啓動Redis前,建議爲Redis單獨創建一個用戶,並新建data和日誌文件夾 sudo useradd redis sudo mkdir -p /var/lib/redis sudo mkdir -p /var/log/redis sudo chown redis.redis /var/lib/redis sudo chown redis.redis /var/log/redis 四、設置開機自動啓動,關機自動關閉 update-rc.d redis-server defaults 五、啓動Redis: /etc/init.d/redis-server startgit