Setup Redis Database - charleshross/soarin GitHub Wiki
This guides assumes you have already installed a fresh copy of Debian Linux Wheezy 64bit (https://www.debian.org/distrib/netinst) on your server or virtual machine.
- Words
like thisare commands to run on your server or virtual machine. - The 'pico' text editor used in this documentation comes with Debian and is super simple to use. To open a file just type
pico [location of your file]. Use arrow keys to navigate, and in order press "[CTRL]+[X], [Y], [ENTER]" to save file changes.
To begin installing, SSH into your Linux Debian server as root.
Redis
Redis is a super fast NoSQL database that helps when typical relational databases (Percona Server, MySQL, PostgreSQL, etc.) may not be as good (heavy amounts of writes/reads, chat systems, job queues, reddit/twitter sites, cacheable data).
Compiling and Installing Redis from Source Code
Make install directory and move into it
mkdir /opt/redis
cd /opt/redis
Download latest Redis source code
wget http://download.redis.io/releases/redis-2.8.13.tar.gz
Decompress file
tar -xvf redis-2.8.13.tar.gz
Move into the new Redis source folder
cd redis-2.8.13
Make to /opt/redis
make PREFIX=/opt/redis install
Copy Redis config file over
cp /opt/redis/redis-2.8.13/redis.conf /opt/redis/redis.conf
Edit /opt/redis/redis.conf file
pico /opt/redis/redis.conf
change the line:
daemonize no
to this:
daemonize yes
Save file and close
Download this ready to go Redis startup script to your init.d folder
wget --no-check-certificate https://googledrive.com/host/0BxzEKwWYLHKNU3ZxN2lFeVJ4NzA -O /etc/init.d/redis
Set permissions on boot script
chmod +x /etc/init.d/redis
Add script to boot
update-rc.d -f redis defaults
Start Redis service up
service redis start
Redis should now be installed and will broadcast on reboot to localhost:6379 by default
Adding binaries to bash
Add Redis binaries to your bash, edit your .bashrc file
pico ~/.bashrc
Add :/opt/redis/bin to the end of your path line
PATH=$PATH:/opt/redis/bin
Reset bash
source ~/.bashrc
Note: If you'd like to test if Redis is running on your next reboot run the two commands
redis-cliand thenping, it should return 'PONG'