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
Thank you for the very concise and detailed instructions, brilliant tutorial.
I can confirm that this also works to install redis 2.4.8 on Ubuntu 11.10 oneiric.
The only possible thing to add to this would be how to create the redis user.
To create a system user, with no shell and therefor no ability to log in, with /opt/redis as its home and a group named redis as primary group:
Will create the following entry on a new installation at the bottom of /etc/passwd.
Build and install redis 32bit on Ubuntu 64bit installation
Some gotchas when making a 32bit installation on a 64bit stack, which I couldn't find all in one place.
If you don't know why you would want to run redis in 32bit then you probably don't need these steps.
To install the libc6-dev-i386 dependency run:
To prevent the linker from rejecting the installation add -m32 to the CCLINK value on line 33 of the src/Makefile.
Take Note: You will have to manually remove the -m32 again if you want to build for 64bit.
Now try the install again and lets see what happens:
Some further notes:
Happy sailing...