Home / Articles / Messaging / apache-activemq / 5.6.13 / install-using-tarball

Apache ActiveMQ Install

Setup

PackageVersionInstall Location
Apache ActiveMQ5.16.3/opt/apache-activemq-5.16.3
Data StoreKahaDB/opt/apache-activemq-5.16.3/data/kahadb
Javajdk1.8.0_241/opt/jdk1.8.0_241

Prerequisites

  • Access as root user or user having root privileges
  • Latest version of Java 8
  • Download Java 8 latest version from Oracle official website and install on server

    # /opt/jdk1.8.0_241/bin/java -version java version "1.8.0_241" Java(TM) SE Runtime Environment (build 1.8.0_241-b07) Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
  • Create a new user and group "activemq". This user will be used to run ActiveMQ services
  • # useradd activemq
    # id activemq
    uid=1003(activemq) gid=1003(activemq) groups=1003(activemq)

Download Apache ActiveMQ

  • Login as root user or with user having root privileges
  • Download Apache ActiveMQ from the official website using the following link.
  • Download Apache ActiveMQ 5

    # ls -l /tmp/apache-activemq-5.16.3-bin.tar.gz -rw-r--r-- 1 root root 65041245 Sep 5 14:01 apache-activemq-5.16.3-bin.tar.gz
  • Extract ActiveMQ tarball into /opt
  • # tar xfz apache-activemq-5.16.3-bin.tar.gz -C /opt
  • Change the ownership of extracted files to activemq user
  • # chown -R activemq:activemq /opt/apache-activemq-5.16.3
  • Check the contents of activemq install directory
  • # ls -l /opt/apache-activemq-5.16.3 -rwxr-xr-x 1 activemq activemq 18624763 Aug 10 02:03 activemq-all-5.16.3.jar drwxr-xr-x 5 activemq activemq 147 Sep 5 14:12 bin drwxr-xr-x 2 activemq activemq 4096 Sep 5 14:12 conf drwxr-xr-x 2 activemq activemq 26 Sep 5 14:12 data drwxr-xr-x 2 activemq activemq 76 Sep 5 14:12 docs drwxr-xr-x 7 activemq activemq 71 Aug 10 01:48 examples drwxr-xr-x 6 activemq activemq 4096 Sep 5 14:12 lib -rw-r--r-- 1 activemq activemq 40581 Aug 10 01:48 LICENSE -rw-r--r-- 1 activemq activemq 3335 Aug 10 01:48 NOTICE -rw-r--r-- 1 activemq activemq 2611 Aug 10 01:48 README.txt drwxr-xr-x 6 activemq activemq 95 Sep 5 14:12 webapps drwxr-xr-x 3 activemq activemq 18 Sep 5 14:12 webapps-demo

ActiveMQ Web Console Setup

  • Setup custom IP Address for web console. By default web console listens on localhost address.
  • Change following entry to replace localhost with your server IP address.

    # vi /opt/apache-activemq-5.16.3/conf/jetty.xml Search for: <property name="host" value="localhost"/> Replace with: <property name="host" value="192.168.50.73"/>

Start ActiveMQ Service

  • Open a new SSH terminal and login as activemq user
  • Start ActiveMQ as a daemon process
  • # /opt/apache-activemq-5.16.3/bin/activemq start INFO: Loading '/opt/apache-activemq-5.16.3//bin/env' INFO: Using java '/opt/jdk1.8.0_241/bin/java' INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details INFO: pidfile created : '/opt/apache-activemq-5.16.3//data/activemq.pid' (pid '3436')
  • Start ActiveMQ as a foregroud process
  • # /opt/apache-activemq-5.16.3/bin/activemq console INFO: Loading '/opt/apache-activemq-5.16.3//bin/env' INFO: Using java '/opt/jdk1.8.0_241/bin/java' INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C) INFO: Creating pidfile /opt/apache-activemq-5.16.3//data/activemq.pid Java Runtime: Oracle Corporation 1.8.0_241 /opt/jdk1.8.0_241/jre Heap sizes: current=63360k free=59164k max=1013632k JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/apache-activemq-5.16.3//conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/opt/apache-activemq-5.16.3//tmp -Dactivemq.classpath=/opt/apache-activemq-5.16.3//conf:/opt/apache-activemq-5.16.3//../lib/: -Dactivemq.home=/opt/apache-activemq-5.16.3/ -Dactivemq.base=/opt/apache-activemq-5.16.3/ -Dactivemq.conf=/opt/apache-activemq-5.16.3//conf -Dactivemq.data=/opt/apache-activemq-5.16.3//data Extensions classpath: [/opt/apache-activemq-5.16.3/lib,/opt/apache-activemq-5.16.3/lib/camel,/opt/apache-activemq-5.16.3/lib/optional,/opt/apache-activemq-5.16.3/lib/web,/opt/apache-activemq-5.16.3/lib/extra] ACTIVEMQ_HOME: /opt/apache-activemq-5.16.3 ACTIVEMQ_BASE: /opt/apache-activemq-5.16.3 ACTIVEMQ_CONF: /opt/apache-activemq-5.16.3/conf ACTIVEMQ_DATA: /opt/apache-activemq-5.16.3/data Loading message broker from: xbean:activemq.xml INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@2ac273d3: startup date [Sun Sep 05 18:35:10 EDT 2021]; root of context hierarchy INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/opt/apache-activemq-5.16.3/data/kahadb] INFO | KahaDB is version 7 INFO | Recovering from the journal @1:3592 INFO | Recovery replayed 1 operations from the journal in 0.028 seconds. INFO | PListStore:[/opt/apache-activemq-5.16.3/data/localhost/tmp_storage] started INFO | Apache ActiveMQ 5.16.3 (localhost, ID:mgs-73.linuxtechspace.com-38447-1630881312781-0:1) is starting INFO | Listening for connections at: tcp://mgs-73.linuxtechspace.com:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector openwire started INFO | Listening for connections at: amqp://mgs-73.linuxtechspace.com:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector amqp started INFO | Listening for connections at: stomp://mgs-73.linuxtechspace.com:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector stomp started INFO | Listening for connections at: mqtt://mgs-73.linuxtechspace.com:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector mqtt started INFO | Starting Jetty server INFO | Creating Jetty connector WARN | ServletContext@o.e.j.s.ServletContextHandler@5a709816{/,null,STARTING} has uncovered http methods for path: / INFO | Listening for connections at ws://mgs-73.linuxtechspace.com:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600 INFO | Connector ws started INFO | Apache ActiveMQ 5.16.3 (localhost, ID:mgs-73.linuxtechspace.com-38447-1630881312781-0:1) started INFO | For help or more information please see: http://activemq.apache.org WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: /opt/apache-activemq-5.16.3/data/kahadb only has 4899 mb of usable space. - resetting to maximum available disk space: 4899 mb WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: /opt/apache-activemq-5.16.3/data only has 4899 mb of usable space. - resetting to maximum available disk space: 4899 mb INFO | ActiveMQ WebConsole available at http://192.168.50.73:8161/ INFO | ActiveMQ Jolokia REST API available at http://192.168.50.73:8161/api/jolokia/