系统是centos 6.5的
下载ActiveMq的包 下载地址 http://activemq.apache.org/download.html
我下载的是 apache-activemq-5.14.5-bin.tar.gz 版本
新建activemq目录将下载好的吧上传到这个目录里
解压
tar -zxf apache-activemq-5.14.5-bin.tar.gz
cd 到解压包里的bin目录下 启动
查看端口61616
如果用防火墙配置如下
- [# vi + /etc/sysconfig/iptables
- #添加下面两行
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 8161 -j ACCEPT
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT
端口8161是访问的端口
如果没有直接ip:8161/admin 用户密码默认都是admin
可以在配置文件中修改用户密码:
打开conf/jetty.xml
将property name为authenticate的属性value="false" 改为"true",高版本的已经默认为true了
控制台的登录用户名密码保存在conf/jetty-realm.properties文件中,内容如下
值得注意的是 用户名和密码的格式是:用户名 : 密码 ,角色名
.修改客户端连接密码
1.修改activemq.xml配置,需要新增一个插件,在<broker>节点里面<systemUsage>节点前面添加如下
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="${activemq.username}" password="${activemq.password}" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
或者直接修改为(即直接将username和password赋值,所赋的值即为用户名和密码。如果使用这一种方式的话,下面的第二步则不需要了):
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="testUserName" password="testPassword" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
2.用户名密码文件为:credentials.properties
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## --------------------------------------------------------------------------- # Defines credentials that will be used by components (like web console) to access the broker activemq.username=system # 用户名
activemq.password=manager # 密码
guest.password=password