Installation commands:
$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
$ touch /var/log/redis.log
$ chown redis:redis /var/log/redis.log
Create this upstart script at /etc/init/redis-server.conf
:
description "redis server"
start on runlevel [23]
stop on shutdown
exec sudo -u redis /opt/redis/bin/redis-server /opt/redis/redis.conf
respawn
Configure it, here's what I changed:
bind 127.0.0.1
timeout 300
loglevel notice
logfile /var/log/redis.log
dir /opt/redis/
And run it!
$ sudo start redis-server
$ sudo restart redis-server
$ sudo stop redis-server
You're most welcome! I'm glad it came to good use :)
Yes you definitely would want to add your own redis user. I left out the step as I already had an old redis version installed from
sudo apt-get install redis
, which once again removed leaves the startup scripts and the redis user lying around.