下載ActiveMQ5.14.0 或者 Linux下執行java
$ wget http://apache.fayea.com//activemq/5.14.0/apache-activemq-5.14.0-bin.tar.gz
解壓並重命名linux
$ tar -zxvf apache-activemq-5.14.0-bin.tar.gz $ mv apache-activemq-5.14.0 activemq-01
若是 activemq-01/bin/activemq 沒有可執行權限,須要對齊進行受權web
$ cd activemq-01/bin/ $ chmod 755 ./activemq
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start"> <!-- the default port number for the web console --> <property name="host" value="0.0.0.0"/> <property name="port" value="8161"/> </bean>
編輯iptables文件(若是Centos7中未安裝iptables 、能夠參照linux環境下zookeeper部署中的安裝)apache
vi /etc/sysconfig/iptables
增長端口配置bash
-A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 8161 -j ACCEP
重啓防火牆tcp
systemctl restart iptables.service
$ cd /home/longload/activemq-01/bin $ ./activemq start
出現下列命令啓動成功spa
INFO: Loading '/home/longload/activemq-01//bin/env' INFO: Using java '/opt/java/jdk1.7.0_79/bin/java' INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details INFO: pidfile created : '/home/longload/activemq-01//data/activemq.pid' (pid '62416')
$ vi /etc/rc.local
加入如下內容.net
## ActiveMQ su - longload -c '/home/longload/activemq-01/bin/activemq start'