1、下载activemq,下载地址:http://archive.apache.org/dist/activemq。测试版本为apache-activemq-5.14.1。

2、在/ursr/local/目录下新建activemq文件夹,并进入该文件夹,执行如下命令解压文件。

cd /usr/local
mkdir activemq
tar -xzvf apache-activemq-5.14.1-bin.tar.gz

3、在/etc/init.d/目录增加增加activemq文件,文件内容为:

cd /etc/init.d/
vi activemq
#!/bin/sh
#
# /etc/init.d/activemq
# chkconfig: 345 63 37
# description: activemq servlet container.
# processname: activemq 5.14.1

# Source function library.
#. /etc/init.d/functions
# source networking configuration.
#. /etc/sysconfig/network

#export JAVA_HOME=/
export CATALINA_HOME=/usr/local/activemq/apache-activemq-5.14.1

case $1 in
    start)
        sh $CATALINA_HOME/bin/activemq start
    ;;
    stop)
        sh $CATALINA_HOME/bin/activemq stop
    ;;
    restart)
        sh $CATALINA_HOME/bin/activemq stop
        sleep 1
        sh $CATALINA_HOME/bin/activemq start
    ;;

esac
exit 0

4、对activemq文件授予权限。

chmod 777 activemq

5、设置开机启动并启动activemq

chkconfig activemq on
service activemq start

5、访问地址:http://IP地址:8161/。

访问成功,ActiveMQ安装完毕。默认用户名密码为:admin/admin。

6、其他

  查看activemq状态

service activemq status

  其他和关闭activemq服务

service activemq start
service activemq stop

   设置开机启动或不启动activemq服务

chkconfig activemq on
chkconfig activemq off

 

说明:activemq需要预先安装JDK,请查看JDK安装

posted on 2016-10-05 11:52  玄同太子  阅读(8527)  评论(0编辑  收藏  举报