Installation ActiveMQ - kwantu/platformconfiguration GitHub Wiki

back

Installation

https://activemq.apache.org/installation.html

Install java 11

sudo yum update
yum install java-11-openjdk-devel
sudo update-alternatives --config java

activemq installation

cd /opt
wget https://archive.apache.org/dist/activemq/5.17.0/apache-activemq-5.17.0-bin.tar.gz
tar -xvzf apache-activemq-5.17.0-bin.tar.gz 
mv apache-activemq-5.17.0 apache-activemq

Create the user to be used

useradd activemq

Create the service file to make activemq as systemctl service

vim /usr/lib/systemd/system/activemq.service

[Unit]
Description=activemq message queue
After=network.target

[Service]

PIDFile=/opt/apache-activemq/data/activemq.pid
ExecStart=/opt/apache-activemq/bin/activemq start
ExecStop=/opt/apache-activemq/bin/activemq stop

User=activemq
Group=activemq

[Install]

WantedBy=multi-user.target

and

Inside /conf folder setup jetty-realm.properties

there is a file jetty-realm.properties where we have user credentials stored

# username: password [,rolename ...]
admin: <password>, admin
activemquser: <password>, user

###Configure nginx

Add upstrsm in /etc/nginx/conf.d/kwantu.conf

upstream activemq61614 {
ip_hash;
server 127.0.0.1:61614;
}

/etc/nginx/conf.d/kwantu_443.conf

location /apicall/amqws {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host;

          proxy_pass http://activemq61614;

          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
        }

now we need to configure our env with the URL and credentials on app server

cd /opt/betterdata-mobile/conf vim GOPROD01.js vim PROD01.js

"amq": {
        "restURL": "http://localhost:8161/api/message/",
        "username": "admin",
        "password": "<password>"
        
    },
⚠️ **GitHub.com Fallback** ⚠️