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安裝