---
title: "ActiveMQ 在linux下安装"
author: "m2000hsf"
date: "2011-05-14T12:40:45Z"
tags: ["ActiveMQ", "Apache", "Linux", "SuSE", "防火墙"]
categories: ["编程语言"]
slug: "activemq-linux"
draft: false
lastmod: "2011-05-14T12:40:45Z"
id: 1044139
url: "https://develop.iteye.com/blog/1044139"
---

1.	操作系统
本文假设linux操作系统的版本是SUSE 10 Enterperise Server
2.	ActiveMQ版本
ActiveMQ 5.1.0 二进制版本
3.	安装和配置
在安装前先把JDK装好

1)	把apache-activemq-5.1.0-bin.tar.gz上传到/usr下
2)	执行tar  –xvz  apache-activemq-5.1.0-bin.tar.gz,将会把文件解压到/usr/ apache-activemq-5.1.0下(注意命令中的-xvz是小写)
3)	把该解压的文件架改名为activemq,命令如下：
mv apache-activemq-5.1.0 activemq
4)	把附件解压 ，然后把这些文件拷贝覆盖到activemq/conf下
5)	把附件 放到activemq/bin下，注意：文件名改为小写，
activemq/bin下的activemq为可执行文件，可通过chmod +x activemq授权
6)	配置文件为activemq/conf/myConf.xml
7)	为了安全，可把activemq/webapps下的目录删除
4.	端口
默认使用端口为61616
注意：防火墙必须开放该端口，否则无法服务。
4.1.	可能的端口冲突
因为activemq也用了jmxremote，目前使用的端口已改为1199

5.	启动和关闭
1)	启动
通过cd命令进入bin下，输入
activemq –Dxbean:conf/myConf.xml &

在等到完全启动后,输入回车键(必须),然后输入exit命令退出shell

2)	关闭
通过ps –ef|grep activemq 查看进程，然后把相应的进程杀死
kill -9 pid
