Skip to content

Instantly share code, notes, and snippets.

@techgaun
Created October 17, 2014 19:19
Show Gist options
  • Save techgaun/5139ac166ae1f0a3ad7e to your computer and use it in GitHub Desktop.
Save techgaun/5139ac166ae1f0a3ad7e to your computer and use it in GitHub Desktop.
redis 2.8.x installation on aws ec2 amazon linux
#!/bin/bash
#lost original file so rewrote for future reference, untested
#installs latest 2.8.17
#run as root
yum install -y gcc gcc-c++ make
wget "http://download.redis.io/releases/redis-2.8.17.tar.gz"
tar xvfz redis-2.8.17.tar.gz
rm -f redis-2.8.17.tar.gz
cd redis-2.8.17
make distclean && make
mkdir /etc/redis /var/redis
cp src/redis-server src/redis-cli /usr/local/bin
#edit /etc/redis/redis.conf to your liking
#sensible changes below
sed -e "s/^daemonize no$/daemonize yes/" -e "s/^# bind 127.0.0.1$/bind 127.0.0.1/" -e "s/^dir \.\//dir \/var\/redis\//" -e "s/^logfile stdout$/logfile \/var\/log\/redis.log/" redis.conf | tee /etc/redis/redis.conf
wget "https://raw.githubusercontent.com/saxenap/install-redis-amazon-linux-centos/master/redis-server" -O /etc/init.d/redisd
chmod 755 /etc/init.d/redisd
chkconfig --add redisd
chkconfig --level 345 redisd on
service redisd start
#do your cleanup now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment