install and config redis on ubuntu14.04

1.installation:

(1)download redis from http://redis.io/download
(2)installation:
$ tar -xvf redis-3.0.7.tar.gz
$ cd reids-3.0.7
$ make && make install

2.config and start redis:

$ cd redis-3.0.7/utils/
$ mv redis_init_script.tpl  redis_6379.sh
$ vim redis_6379.sh
#edit it,add following to it
#                REDISPORT=6379
#                EXEC=/usr/local/bin/redis-server
#                CLIEXEC=/usr/loca/bin/redis-cli
#                PIDFILE=/var/run/redis_${REDISPORT}.pid
#                CONF="/etc/redis/redis_${REDISPORT}.conf"
$ cp redis_6379.sh /etc/init.d/redis_6379
$ mkdir /var/redis/  #redis data directory
$ mkdir /etc/redis/  #redis configuration directory
$ cd redis-3.0.7
$ cp redis.conf /etc/redis/redis_6379.conf
$ vim /etc/redis/redis_6379.conf
# config following items in redis_6379.conf:
#         daemonize yes
#         pidfile /var/run/redis_6379.pid
#         port 6379
#         dir /var/redis/6379
$ update-rc.d redis_6479 defaults # update init service of linux,let redis start with system
$ service redis_6379 start # start redis server
$ redis-cli shutdown #shutdown redis-server

posted on 2016-02-29 22:00  yeah,youcandoit  阅读(149)  评论(0编辑  收藏  举报

导航