How to install ActiveMQ on CentOS

Status: This OS is no longer supported

This article, “How to install ActiveMQ on CentOS,” covers a version of CentOS that reached end of life (EOL) and is no longer supported. As such, this guide is no longer maintained. If you are currently operating a server running CentOS 6, we highly recommend contacting RoseHosting’s fully managed support to upgrade or migrate to a supported version of AlmaLinux.

In today’s article, we’ll explain how to install Apache ActiveMQ on a CentOS 5.X VPS. Apache ActiveMQ is is the most popular and powerful open source messaging and Integration Patterns server.

Installing Java JDK

First we’ll need to install Java 1.7 JDK. Oracle has recently disallowed direct downloads of java from their servers, luckily we can still use wget to download Java 1.7 JDK. If you have one of our Java Hosting packages this will already be installed and configured.

cd /tmp/
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" \
"http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-i586.rpm"
rpm -Uhv jdk-7u4-linux-i586.rpm

To begin, test if the installation is successful by typing

java -version

You should see something like this

java version "1.7.0_04"
 Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
 Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)

Installing Apache ActiveMQ

This is just as easy as installing Java.

cd /home/yourname
 wget http://www.apache.org/dyn/closer.cgi?path=%2Factivemq%2Fapache-activemq%2F5.6.0%2Fapache-activemq-5.6.0-bin.tar.gz
 tar zxvf apache-activemq-5.6.0-bin.tar.gz
 cd apache-activemq-5.6.0/bin
 ./activemq console &

To test if the installation is successful, type

netstat -an|grep 61616

You should see something like this

tcp 0 0 0.0.0.0:61616 0.0.0.0:* LISTEN

If you have any questions, please don’t hesitate to ask. We’ll help you out.

Finally, if you liked this post please share it with your friends or leave a reply below. Thanks.

2 thoughts on “How to install ActiveMQ on CentOS”

  1. Hi.
    Useful information.
    When I ran the [root@learn bin]# ./activemq console & command,
    I got the following errors.
    INFO: Invoke the following command to create a configuration file
    ./activemq setup [ /etc/default/activemq | /root/.activemqrc ]

    INFO: Using java ‘/usr/bin/java’
    INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)

    Can you share the configuration details for activemq in CentOS

    Reply
    • You can create a default configuration file using the following command:

      /etc/init.d/activemq setup /etc/default/activemq

      Then, edit the newly generated ‘/etc/default/activemq’ file according to your needs.

      Reply

Leave a Comment