Last active
December 13, 2015 19:29
-
-
Save skt-bford/4963404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# requirements | |
yum -y install wget | |
# install redis | |
cd /usr/local/src | |
wget http://download.redis.io/redis-stable.tar.gz | |
tar zxf redis-stable.tar.gz | |
cd redis-stable | |
make | |
make install | |
sudo cp redis.conf /etc/redis.conf | |
sudo mkdir /var/redis | |
sudo chown nobody:nobody /var/redis | |
cd /usr/local/src | |
rm -rf redis-* | |
# modify redis config | |
sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf | |
sed -i 's/# bind 127.0.0.1/bind 127.0.0.1/g' /etc/redis.conf | |
sed -i 's/dir .\//dir \/var\/redis/g' /etc/redis.conf | |
# create redis init script | |
cd /usr/local/src | |
wget https://gist.github.com/skt-bford/4963390/raw/redis.init.sh | |
mv redis.init.sh /etc/init.d/redis-server | |
chmod +x /etc/init.d/redis-server | |
/sbin/chkconfig --levels 235 redis-server on | |
service redis-server start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment