https://activemq.apache.org/components/classic/download/
注意5.17版本要求jdk11。
https://activemq.apache.org/download-archives.html
文件上传到/home/activemq目录

mkdir -p /usr/local/activemq
tar -xzvf apache-activemq-5.16.5-bin.tar.gz
mv apache-activemq-5.16.5/* /usr/local/activemq/
vim /usr/local/activemq/conf/jetty.xml
输入 :set number,显示行号,找到119行
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
<!-- the default port number for the web console -->
<property name="host" value="127.0.0.1"/>
<property name="port" value="8161"/>
</bean>
将127.0.0.1改为0.0.0.0,否则无法访问
cd /usr/local/activemq/bin/linux-x86-64
# 启动
./activemq start
# 停止
./activemq stop

#检查是否启动
lsof -i:8161

ActiveMQ默认启动到8161端口,浏览器地址栏输入:http://192.168.5.178:8161,要求输入用户名密码,默认为admin/admin(可在conf/users.properties中配置)。

点击第一个连接即可进入管理界面。
vim /etc/profile
添加以下内容:
export ACTIVEMQ_HOME=/usr/local/activemq
export ACTIVEMQ_BIN=$ACTIVEMQ_HOME/bin/linux-x86-64
export PATH=${PATH}:${ACTIVEMQ_BIN}
配置生效
source /etc/profile
这样不输入路径也可直接启动或停止
activemq start