Thursday, July 26, 2012

Apache ActiveMQ 5 Installation Guide for Ubuntu 11.10

If you are not familiar with Apache ActiveMQ, you better start with my previous post: Introduction: JMS (with) Spring and Apache ActiveMQ.

As I was installing Apache ActiveMQ on my Ubuntu 11.10 machine, I encountered a strange problem. If you go and read the official Installation Guide, it should be relatively easy to start ActiveMQ with the following commands after you download it:
 
$ cd [installation_dir]/

bin/activemq

OR

[insllation_dir]$: bin/activemq > /tmp/smlog  2>&1 &;
Note: /tmp/smlog may be changed to another file name.  

However, instead of running, it generated the following error message:

Configuration of this script:
    The configuration of this script can be placed on /etc/default/activemq or /home/amir/.activemqrc.
    To use addtional configurations for running multiple instances on the same operating system
    rename or symlink script to a name matching to activemq-instance-.
    This changes the configuration location to /etc/default/activemq-instance- and
    $HOME/.activemqrc-instance-. Configuration files in /etc have higher precedence. 

The issue as I observed was that for some reason, ApacheMQ had not created any configuration file, which supposed to be in /etc/default/apachemq. Therefor after extracting the apache-activemq-x.x.x.tar.gz file, run the following command:

$ [installation_dir]: ./bin/activemq setup activemq

and after that copy that activemq configuration file into /etc/default (Root privileges needed here):
 
$[installation_dir]: sudo cp activemq /etc/default

Now just run:
 
$[installation_dir]: bin/activemq start 
 
Now ActiveMQ should be up and running on http://localhost:8161/admin/.
Note: Remember not to close the terminal which you started ActiveMQ with, as it will terminate the ActiveMQ process or run it with the following command:

nohup bin/activemq > /tmp/smlog 2>&1 &

1 comment: