BIP KB:
How To Install And Get Started With Redis

Article By BIP Admin


img

Install Redis Debian Software VPS BIP media

Introduction to Install Redis

If you’d like to Install Redis the most recent version of Redis on your Debian machine, follow along with this guide. Unfortunately, the install process is not as easy as `sudo apt-get install redis`, which is why you're probably reading this. The current version at the time of me writing this, is 2.6.13. Go to the website and copy the download link and be sure to change the version in the URL below:

# Install the required tools to build the source
sudo apt-get install build-essential
# Download and extract the files
wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz
tar -xzf redis-2.6.13.tar.gz
cd redis-2.6.13
# Compile
make install
Now that you’ve got it “installed”, you’re going to want to make it a Debian service (so that it can run on startup, and you can use commands like `sudo service redis start`):
# Create a user account for Redis
sudo adduser --system --no-create-home --disabled-login --disabled-password --group redis
# Make a writable log file
sudo touch /var/log/redis.log
sudo chown redis:redis /var/log/redis.log
sudo chmod u+w /var/log/redis.log
# Make an init script
cd /etc/init.d/
wget https://gist.github.com/peterc/408762/raw -O redis
sudo chmod u+x redis
sudo update-rc.d -f redis defaults
# Make a place to store your database
sudo mkdir /var/redis
sudo chown redis:redis /var/redis
sudo chmod u+xw /var/redis
Next, you’ll want to edit the configuration script. Do the following:
sudo mkdir /etc/redis
sudo touch /etc/redis/redis.conf
sudo chown redis:redis -R /etc/redis/
sudo vim /etc/redis/redis.conf
Here is what I use for my redis.conf file:
daemonize yes
pidfile /var/run/redis.pid
logfile /var/log/redis.log
port 6379
# bind 127.0.0.1
# unixsocket /tmp/redis.sock
timeout 300
loglevel verbose
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /var/redis/
# requirepass foobared
Once that’s all done, run the following to make sure everything was installed properly:
$ sudo service redis start
$ redis-cli
> INFO
If you see an error when the server is starting, or an error after running the CLI script that it cannot connect, something went wrong.  Go ahead and leave a comment and we'll be sure to help.


Tags: , , , , ,

Spin up a VPS server in no time flat

Simple setup. Full root access. Straightforward pricing.

DEPLOY VPS SERVER

Leave a Reply



Feedbacks