# ActiveMQ安裝與配置
ActiveMQ(activemq.apache.org)是Apache出品,流行的、能力強勁的開源消息總線,完全支持JMS1.1和J2EE 1.4規范(持久化,XA消息,事務\),盡管JMS規范出臺已經是很久的事情了,但是JMS在當今的J2EE應用中間仍然扮演著特殊的地位。ActiveMQ支持多種語言和協議編寫客戶端。語言包括:Java,C,C++,C\#,Ruby,Perl,Python,PHP,應用協議包括: OpenWire,Stomp REST,WS Notification,XMPP,AMQP等
在云上購買鏡像后,請參考本章關于ActiveMQ鏡像的安裝路徑、配置說明以及常見的操作命令等
## 版本
以鏡像的最新版本為例:
軟件版本:ActiveMQ5.15.3(Bitnami版)
環境軟件:Java1.8.0\_161,
## 目錄
| 名稱 | 路徑 |
| :--- | :--- |
| 安裝路徑 | /opt/activemq-\*/ |
| 日志文件路徑 | /opt/activemq-\*/activemq/data/activemq.log |
| Java路徑 | /opt/activemq-\*/java/ |
| admin password配置文件 | /opt/activemq-\*/activemq/conf/jetty-realm.properties |
\*代指版本號
## 開始使用
1. 通過瀏覽器訪問:[http://服務器公網IP:8161/,即可進入ActiveMQ管理界面](http://服務器公網IP:8161/,即可進入ActiveMQ管理界面)

2. 點擊“Manage ActiveMQ broker”,輸入默認賬號(admin/admin),成功登錄到ActiveMQ后臺

3. 需要修改默認密碼請通過修改配置文件的方式實現:/opt/activemq-\*/activemq/conf/jetty-realm.properties
> 如不能正常訪問,請確保您的服務器安全組8161端口是打開的
## 常見命令
本鏡像提供了啟停腳本,cd到安裝目錄后,運行./ctlscript.sh
```
[root@iZ2ze6yhnik25xrq39ttxnZ ~]# cd /opt/activemq-5.15.3-0/
[root@iZ2ze6yhnik25xrq39ttxnZ activemq-5.15.3-0]# ./ctlscript.sh
usage: ./ctlscript.sh help
./ctlscript.sh (start|stop|restart|status)
./ctlscript.sh (start|stop|restart|status) activemq
help - this screen
start - start the service(s)
stop - stop the service(s)
restart - restart or start the service(s)
status - show the status of the service(s)
```