Skip to content

Instantly share code, notes, and snippets.

@bkono
Created May 7, 2012 05:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bkono/2626168 to your computer and use it in GitHub Desktop.
Save bkono/2626168 to your computer and use it in GitHub Desktop.
Ubuntu Redis Install
#!/bin/bash
mkdir /opt/redis
#RedisVersion=2.2.14
RedisVersion=2.4.8
wget http://redis.googlecode.com/files/redis-$RedisVersion.tar.gz
tar -zxvf redis-$RedisVersion.tar.gz
cd redis-$RedisVersion
make
cp ~/redis-$RedisVersion/redis.conf /opt/redis/redis.conf.default
cp ~/redis-$RedisVersion/redis.conf /opt/redis/redis.conf
cp ~/redis-$RedisVersion/src/redis-benchmark /opt/redis/
cp ~/redis-$RedisVersion/src/redis-cli /opt/redis/
cp ~/redis-$RedisVersion/src/redis-server /opt/redis/
cp ~/redis-$RedisVersion/src/redis-check-aof /opt/redis/
cp ~/redis-$RedisVersion/src/redis-check-dump /opt/redis/
cd /opt
wget -O init-deb.sh http://library.linode.com/assets/629-redis-init-deb.sh
# edit the file and update it to /opt/redis not /opt/redis/bin
mv /opt/init-deb.sh /etc/init.d/redis
adduser --system --no-create-home --disabled-login --disabled-password --group redis
chmod +x /etc/init.d/redis
chown -R redis:redis /opt/redis
touch /var/log/redis.log
chown redis:redis /var/log/redis.log
update-rc.d -f redis defaults
/etc/init.d/redis start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment