香港服务器香港服务器租用

如何在CentOS 8上安装Apache ActiveMQ

步骤1、首先,让我们首先确保您的系统是最新的。
sudo dnf clean all
sudo dnf update
步骤2、安装Java。
Apache ActiveMQ是基于Java的应用程序,因此必须在系统中安装Java:
sudo dnf install java-11-openjdk-devel
步骤3、在CentOS 8上下载Apache ActiveMQ。
从他们的官方网站下载最新版本的ActiveMQ。您可以使用以下命令下载它:
wget https://www.apache.org/dist/activemq/5.15.12/apache-activemq-5.15.12-bin.tar.gz
下载后,解压缩下载的文件:
tar -xvzf apache-activemq-5.15.12-bin.tar.gz
mv apache-activemq-5.15.12 apache-activemq
接下来,创建一个ActiveMQ用户来运行该服务:
useradd activemq
chown -R activemq:activemq /opt/apache-activemq/
步骤4、创建Apache ActiveMQ Systemd。
我们将创建一个Systemd单元文件来管理Apache ActiveMQ服务:
nano /etc/systemd/system/apache-activemq.service
添加以下行:

[Unit]
Description=Apache ActiveMQ Messaging Server
After=network.target

[Service]
Type=forking
User=activemq
Group=activemq

ExecStart=/opt/apache-activemq/bin/activemq start
ExecStop=/opt/apache-activemq/bin/activemq stop

[Install]
WantedBy=multi-user.target
保存文件。然后使用以下命令重新加载systemd Manager配置以读取新创建的服务:
sudo systemctl daemon-reload
systemctl start apache-activemq
systemctl enable apache-activemq
步骤5、配置防火墙。
您将需要允许端口80和8161通过Firewalld。您可以使用以下命令允许它们:
firewall-cmd --zone=public --permanent --add-port=8161/tcp
firewall-cmd --zone=public --permanent --add-port=80/tcp
firewall-cmd --reload
步骤6、访问Apache ActiveMQ。
默认情况下,ActiveMQ将在使用8161端口。打开浏览器输入:你的域名或者IP/8161/admin/,系统将提示您输入用户名和密码。默认值为admin/admin
至此,您已经在CentOS 8上成功安装了Apache ActiveMQ,希望本文对您有所帮助。

A5互联https://www.a5idc.net/

posted @ 2020-09-07 07:57  A5互联  阅读(584)  评论(0编辑  收藏  举报
江苏镇江高防服务器BGP云服务器