Linux下安装ActiveMQ设置开机启动
1、在/etc/init.d目录下面 创建一个activemq 文件
添加一下内容
#!/bin/sh
export JAVA_HOME=/home/BAB-SERVER/sys-env/JDK/jdk1.8.0_231
export CATALINA_HOME=/home/BAB-SERVER/sys-env/ActiveMQ/apache-activemq-5.16.0
case $1 in
start)
sh $CATALINA_HOME/bin/activemq start
;;
stop)
sh $CATALINA_HOME/bin/activemq stop
;;
status)
sh $ACTIVEMQ_HOME/bin/activemq status
;;
restart)
sh $CATALINA_HOME/bin/activemq stop
sleep 1
sh $CATALINA_HOME/bin/activemq start
;;
esac
exit 0
2、设置权限:
chmod +x activemq
3、加入开机启动
systemctl enable activemq
4、重新启动服务器验证
reboot
5、访问管理页面