Skip to content

Instantly share code, notes, and snippets.

@cjjavellana
Created May 4, 2015 16:19
Show Gist options
  • Save cjjavellana/c2ab52963595c7c8316e to your computer and use it in GitHub Desktop.
Save cjjavellana/c2ab52963595c7c8316e to your computer and use it in GitHub Desktop.
Installing redis on centos 6.5
Credit https://aurobindapothal.wordpress.com/2013/06/22/redis-install-in-centos-6-5/
Redis install in centos 6.5
BY AUROBINDAPOTHAL ON JUNE 22, 2013
How to install Redis in Centos/RHEL/Fedora System
Step:1 Install necessary packages
yum install make gcc wget
Step:2 Download the Redis Packages
wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz
tar -xf redis-2.2.12.tar.gz
cd redis-2.2.12
make
make install
Step:3 We are going to change the default redis.conf file to daemonize it,change the location of the database,change the log notices to a production acceptable level, and change the logfile location.
mkdir /etc/redis /var/lib/redis
sed -e “s/^daemonize no$/daemonize yes/” -e “s/^dir \.\//dir \/var\/lib\/redis\//” -e “s/^loglevel debug$/loglevel notice/” -e “s/^logfile stdout$/logfile \/var\/log\/redis.log/” redis.conf > /etc/redis/redis.conf
Step:4 To make management easy, we’re going to use an init script that I found here on github.
The install location on this script doesn’t match where the /usr/local/bin/redis-server location we’re using, so I’m using sed to update it.
wget https://gist.github.com/paulrosania/257849/raw/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
sed -i “s/usr\/local\/sbin\/redis/usr\/local\/bin\/redis/” redis-server
chmod u+x redis-server
mv redis-server /etc/init.d
/sbin/chkconfig –add redis-server
/sbin/chkconfig –level 345 redis-server on
/etc/init.d/redis-server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment