1. 關閉防火牆和Selinux
2. 下載並安裝ActiveMQ 5.15.x Release版本
3. 啓動並驗證
4.配置ActiveMQ 5.15.x Release自啓動
5.注意事項以及說明
Linux的防火牆是我們新手的噩夢,不少狀況會出現能ping通,可是訪問不了Web頁面。因此開始就幹掉它!html
1.1 關閉防火牆java
[root@localhost ~]# /etc/init.d/iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ]
1.2 開機自動關閉防火牆linux
[root@localhost ~]# chkconfig iptables off
1.3 查看Selinux狀態apache
[root@localhost ~]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 28
1.4 關閉selinuxvim
[root@localhost ~]# vi /etc/selinux/config
修改 SELINUX=disabled ,重啓機器。
注:永久開啓->改爲:SELINUX=enforcing瀏覽器
注:爲了方便管理,建立一個文件夾專門放所需軟件jsp
[root@localhost /]# mkdir developer [root@localhost /]# cd developer
2.1 下載ActiveMQ 5.15.x Releaseui
[root@localhost developer]# wget http://www.apache.org/dyn/closer.cgi?filename=/activemq/5.15.2/apache-activemq-5.15.2-bin.tar.gz&action=download
注:ActiveMQ 5.15.x Release 官網url以下:url
http://activemq.apache.org/activemq-5152-release.htmlspa
2.2 解壓ActiveMQ 5.15.x Release
[root@localhost developer]# tar -zxvf apache-activemq-5.15.2-bin.tar.gz
3.1 進入ActiveMQ文件夾
[root@localhost developer]# cd apache-activemq-5.15.2
3.2 啓動ActiveMQ
[root@localhost apache-activemq-5.15.2]# ./bin/activemq start
3.3 驗證ActiveMQ是否啓動
方式1:打開瀏覽器,輸入ip:8161/admin/index.jsp,好比:192.168.163.129:8161/admin/index.jsp
帳號:admin,密碼:admin
方式2:檢查端口號,或者進程,再者檢查狀態
檢查端口號
[root@localhost apache-activemq-5.15.2]# netstat -an | grep 61616
檢查進程
[root@localhost apache-activemq-5.15.2]# ps -ef | grep activemq
檢查狀態
[root@localhost apache-activemq-5.15.2]# ./bin/activemq status
4.1 複製ActiveMQ解壓文件夾(爲了自啓動方便)
[root@localhost apache-activemq-5.15.2]# cd .. [root@localhost developer]# cp -r /developer/apache-activemq-5.15.2/ /usr/local/activemq
4.2 複製ActiveMQ啓動文件
[root@localhost developer]# cp /usr/local/activemq/bin/activemq /etc/init.d
4.3 編輯ActiveMQ啓動文件
[root@localhost developer]# vim /etc/init.d/activemq
並在最後一行添加以下代碼
export JAVA_HOME=/usr/java/jdk1.8.0_144
ACTIVEMQ_HOME=/usr/local/activemq
4.4 賦予ActiveMQ啓動文件的權限
[root@localhost init.d]# chmod +x /etc/init.d/activemq
4.5 添加到系統啓動文件中,並配置啓動
[root@localhost init.d]# chkconfig --add activemq [root@localhost init.d]# chkconfig activemq on
4.6 檢驗查看列表
[root@localhost init.d]# chkconfig --list|grep activemq activemq 0:off 1:off 2:on 3:on 4:on 5:on 6:off
注意事項:
ActiveMQ 5.15.x Release 有對應的JDK版本最低爲1.8,檢查jdk版本是否匹配,不則啓動ActiveMQ就會報錯
檢查jdk:
[root@localhost apache-activemq-5.15.2]# java -version java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
說明:本次使用
操做系統:CentOS 6.8 64位
ActiveMQ版本:5.15.2Release
JDK版本:1.8.0_144