Install redis and activeMQ on Linux

I have a series of blog posts I’m planning to add here soon; to illustrate one way for ensuring the separation of CMS and a web applications by having the CMS publish the model via a Message Queue to a key-value store, to be consumed by the view layer via a lightweight middle tier.

I’ve previously coded a proof of concept on a macbook pro. Installing redis and ActiveMQ was quite straightforward on OSX. I simply installed them using homebrew. I was surprised to find on my PC (running Linux Mint, which is based on Ubuntu) that I couldn’t use the APT package installer in a similar way

installing redis on Linux

You need to build redis on Linux, which is oddly satisfying to do. Start off by updating all of the apt-get packages:

sudo apt-get update

Once the process finishes, download a compiler with build essential which will help us install Redis from source. Get ‘buid-essential’ and ‘tcl’;

sudo apt-get install build-essential

sudo apt-get install tcl8.5

With everything we need now downloaded we can build and install redis from source. First download redis from redis.io. Version 2.8.2 was the latest  when I did this. Untar it and switch into your chosen folder:

tar xzf redis-2.8.2.tar.gz

Run the make command – not forgetting to run ‘make test’ afterwards.

make

make test

Finally install the program system-wide.

sudo make install

UPDATE: I’ve installed Fedora 20 (more about that in a future post) to dual-boot with Linux Mint and only the previous three steps are required once you’ve downloaded the tarball.

Redis comes with a script that sets up Redis to run as a background daemon. To access the script go to the utils directory. From there, run the install_server.sh script.

As the script runs,  choose the default options by pressing enter. Start and stop redis with  ‘sudo service redis_6379 start’ and ‘sudo service redis_6379 stop’.

install ActiveMQ

This was much easier. Download the latest version from here;

http://activemq.apache.org/download-archives.html

and simply run activeMQ with ‘./activemq start’ and ‘./activemq stop’ from the bin folder.

Don’t forget that the default user/password for activeMQ is admin/admin

Bookmark the permalink.

Leave a Reply