Install apache activeMQ on ubuntu 22.04; Through this tutorial, we will learn how to install apache activeMQ on linux ubuntu system.
ActiveMQ is an open source protocol developed by Apache which functions as an implementation of message-oriented middleware (MOM). Its basic function is to send messages between different applications, but includes additional features like STOMP, JMS, and OpenWire.
How to Install Apache ActiveMQ in Ubuntu 22.04
Steps to download and install apache activeMQ in linux ubuntu 22.04 system:
- Step 1 – Update System Dependencies
- Step 2 – Install JAVA
- Step 3 – Download & Install Apache ActiveMQ
- Step 4 – Enable ActiveMQ Access
- Step 5 – Configuration File for ActiveMQ
- Step 6 – Reload the systemctl daemon
- Step 7 – Test the Installation of Apache ActiveMQ
Step 1 – Update System Dependencies
First of all, update system dependencies by executing the following command on command line:
sudo apt update
Step 2 – Install JAVA
Then execute the following command on command line to install java on linux ubuntu system:
sudo apt install default-jdk
Then create a user on system by using the following command:
sudo adduser activemq
Set the password to complete the user creation.
Step 3 – Download & Install Apache ActiveMQ
Now, download Apache ActiveMQ in linux ubuntu system by executing the following command on command line or terminal:
wget https://dlcdn.apache.org//activemq/5.17.0/apache-activemq-5.17.0-bin.tar.gz tar xzf apache-activemq-5.17.0-bin.zip -C /opt
Once the download process has been done; Extract the file at /opt/apache-activemq-5.17.0 directory.
Step 4 – Enable ActiveMQ Access
Use the following command to enable ActiveMQ access for a local or public network, edit conf/jetty.xml configuration file.
sudo nano /opt/apache-activemq-5.17.0/conf/jetty.xml
Search for the below configuration section.
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start"> <!-- the default port number for the web console --> <property name="host" value="localhost"/> <property name="port" value="8161"/> </bean>
Step 5 – Configuration File for ActiveMQ
Then create a configuration file for ActiveMQ using the following command:
sudo nano /etc/systemd/system/activemq.service
Then update the following content into it:
[Unit] Description=Apache ActiveMQ Message Broker After=network-online.target [Service] Type=forking User=activemq Group=activemq WorkingDirectory=/opt/apache-activemq-5.17.0/bin ExecStart=/opt/apache-activemq-5.17.0/bin/activemq start ExecStop=/opt/apache-activemq-5.17.0/bin/activemq stop Restart=on-abort [Install] WantedBy=multi-user.target
Step 6 – Reload the systemctl daemon
Use the following command to reload the systemctl daemon to read the new configuration file:
sudo systemctl daemon-reload
After that, enable the ActiveMQ systemd service to auto-start on system boot. Also, start the service.
sudo systemctl enable activemq.service sudo systemctl start activemq.service
Once the service is started, make sure that ActiveMQ service is up and running:
sudo systemctl status activemq.service
Step 7 – Test the Installation of Apache ActiveMQ
ActiveMQ installation is finished on the linux Ubuntu 22.04 system. Let’s test if the installation is succeeded successfully.
If the UFQ firewall is active and are accessing the Apache ActiveMQ from a remote host, make sure to open the 8161 port. We can open the UFW port with the following command.
sudo ufw allow 8161/tcp
Finally, open a browser and hit the following url into it:
http://server-ip:8161/
Conclusion
Through this tutorial, we have learned how to install, configure and use apache activeMQ on linux ubuntu system.