Difference between revisions of "How to install Redis on a Centos 6.4 Server"
From Brian Nelson Ramblings
(→Add a second instance of Redis) |
(→Add a second instance of Redis) |
||
Line 20: | Line 20: | ||
vim /etc/init.d/redis2 | vim /etc/init.d/redis2 | ||
− | Change | + | '''Change''' |
pidfile="/var/run/redis/redis.pid" to pidfile="/var/run/redis/redis2.pid" | pidfile="/var/run/redis/redis.pid" to pidfile="/var/run/redis/redis2.pid" | ||
REDIS_CONFIG="/etc/redis.conf" to REDIS_CONFIG="/etc/redis2.conf" | REDIS_CONFIG="/etc/redis.conf" to REDIS_CONFIG="/etc/redis2.conf" | ||
Line 26: | Line 26: | ||
vim /etc/redis2.conf | vim /etc/redis2.conf | ||
− | Change | + | '''Change''' |
port 6379 to port 6380 | port 6379 to port 6380 | ||
unixsocket /tmp/redis.soc to unixsocket /tmp/redis2.sock | unixsocket /tmp/redis.soc to unixsocket /tmp/redis2.sock | ||
Line 32: | Line 32: | ||
service redis2 start | service redis2 start | ||
− | Let also make this instance start up on boot | + | '''Let also make this instance start up on boot''' |
chkconfig redis2 on | chkconfig redis2 on | ||
− | Now | + | '''Now verify its set to start at boot''' |
chkconfig --list redis2 | chkconfig --list redis2 |
Revision as of 03:15, 1 September 2013
Contents
How to install redis on a Centos Server
yum install redis
service redis start
chkconfig redis on
Now verify its set to start at boot
chkconfig --list redis
redis 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Now that was pretty simple, but lets say you want to add a second instance to your server on a different port
Add a second instance of Redis
cp redis.conf redis2.conf && cp /etc/init.d/redis /etc/init.d/redis2 vim /etc/init.d/redis2
Change
pidfile="/var/run/redis/redis.pid" to pidfile="/var/run/redis/redis2.pid" REDIS_CONFIG="/etc/redis.conf" to REDIS_CONFIG="/etc/redis2.conf"
vim /etc/redis2.conf
Change
port 6379 to port 6380 unixsocket /tmp/redis.soc to unixsocket /tmp/redis2.sock
service redis2 start
Let also make this instance start up on boot
chkconfig redis2 on
Now verify its set to start at boot
chkconfig --list redis2
redis2 0:off 1:off 2:on 3:on 4:on 5:on 6:off
To install a web interface for redis
cd /downloads/
git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git
cd phpRedisAdmin/includes
cp config.sample.inc.php config.inc.php
Make sure the setting are correct
vim config.inc.php
Lets add the RedisAdmin configuration file to Apache
vim /etc/httpd/conf.d/redisadmin.conf
Now add the following
# # Web Interface for RedisAdmin # <Directory "/downloads/phpRedisAdmin/"> Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from <your ipaddress> </Directory> Alias /redisAdmin /downloads/phpRedisAdmin Alias /redisadmin /downloads/phpRedisAdmin