消息中间件activemq-5.14.1安全验证配置
activemq分为控制端和客户端,下面分别介绍安全认证配置方法。
1.控制端安全配置
(1). ActiveMQ目录conf下找到jetty.xml:
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="user,admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="true" />
</bean>
含义:
<property name="authenticate" value="true" /> true:需要认证; false:不需要认证
(2). ActiveMQ目录conf下找到jetty-realm.properties
# username: password [,rolename ...]
admin: admin123, admin
user: user, user
说明:
第一个admin,为认证用户名。
第二个admin123,为认证密码。
第三个admin,为角色。
(3). 重启ActiveMQ验证是否需要认证
重启activemq后,访问:http://127.0.0.1:8161/admin/,弹出http基本认证框,这时候认证生效。
1.客户端安全配置
(1). 解压目录/conf/activemq.xml的broken中添加:
<plugins>
<!-- use JAAS to authenticate using the login.config file on the classpath to configure JAAS -->
<!-- 添加jaas认证插件activemq在login.config里面定义,详细见login.config--> <jaasAuthenticationPlugin configuration="activemq" />
<!-- lets configure a destination based authorization mechanism -->
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry topic=">" read="admins" write="admins" admin="admins" />
<authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
<!--authorizationEntry topic="FirstTopic" read="smeall,smeadmin" write="smeadmin" admin="smeall,smeadmin" /-->
<authorizationEntry topic="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/>
<authorizationEntry queue="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
若是集群则broken中继续添加:
<networkConnectors>
<networkConnector userName="用户名" password="密码" uri="static:(tcp://localhost:61616)" duplex="true"/>
</networkConnectors>
此配置可以忽略掉
(2). 解压目录/conf/login.config中:
activemq{
org.apache.activemq.jaas.PropertiesLoginModule required
debug=true
org.apache.activemq.jaas.properties.user="users.properties"
org.apache.activemq.jaas.properties.group="groups.properties";
};
(3). 解压目录/conf/groups.properties中:
admins=用户名
(4). 解压目录/conf/users.properties中:
用户名=密码
三。其他配置说明
除了安全验证的配置需要我们理解,还有一部分配置需要理解:
<transportConnectors>
<!-- DOS protection, limit concurrent connections to and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://10.8.0.1:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://10.8.0.1:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://10.8.0.1:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://10.8.0.1:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://10.8.0.1:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
上述中的
name="openwire" uri="tcp://10.8.0.1:61616?ma name="amqp" uri="amqp://10.8.0.1:5672?max
其中 tcp:// 和 amqp:// 这都是指协议,而name是随意定义的,但是这个name是在管理url界面中显示的,如图:
# cat /etc/hosts
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 quanli_dev02.fistforward.com
10.8.0.1 quanli_dev02.fistforward.com
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
PEERNTP=no
GATEWAY=10.8.3.253
HOSTNAME=quanli_dev02.fistforward.com
消息中间件activemq-5.14.1安全验证配置的更多相关文章
- 消息中间件ActiveMQ使用详解
消息中间件ActiveMQ使用详解 一.消息中间件的介绍 介绍 消息队列 是指利用 高效可靠 的 消息传递机制 进行与平台无关的 数据交流,并基于 数据通信 来进行分布式系统的集成. 特点(作用) ...
- 关于ActiveMQ的几种集群配置
ActiveMQ的几种集群配置. Queue consumer clusters 此集群让多个消费者同时消费一个队列,若某个消费者出问题无法消费信息,则未消费掉的消息将被发给其他正常的消费者,结构图如 ...
- ActiveMQ的几种集群配置
ActiveMQ是一款功能强大的消息服务器,它支持许多种开发语言,例如Java, C, C++, C#等等.企业级消息服务器无论对服务器稳定性还是速度,要求都很高,而ActiveMQ的分布式集群则能很 ...
- C#微信开发-微信JS-SDK(1)之通过config接口注入权限验证配置
官方文档是微信JS-SDK的使用步骤http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#JSSDK.E4.BD.B ...
- ActiveMq+zookeeper+levelDB集群整合配置
ActiveMq+zookeeper+levelDB集群整合配置 环境:linux系统,jdk1.7 三台linux系统电脑.我这里使用一台window,分别远程3台linux电脑.三台电脑的ip分 ...
- nginx的启动、停止、重载配置、验证配置
[1]启动 启动nginx系统方式: (1)命令 nginx -c /usr/local/nginx/conf/nginx.conf 说明:-c 参数指定运行nginx系统的自定义配置文件. 若加:使 ...
- Ubuntu下SSH无密码验证配置
前言 SSH为Secure Shell 的缩写,是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议.越来越多的小伙伴们使用远程登录,而ssh安全性无疑是很高的,那么我们现在来看看如何实现ss ...
- 2.14 加载Firefox配置
2.14 加载Firefox配置(略,已在2.1.8讲过,请查阅2.1.8节课) 回到顶部 2.14-1 加载Chrome配置 一.加载Chrome配置chrome加载配置方法,只需改下面一个地方,u ...
- Python2.7.14安装和pip配置安装及虚拟环境搭建
目录 前言 1 Python2.7.14安装 2 pip配置安装 3 虚拟环境安装 前言 今天在搭建阿里云服务器,需要安装Python相关环境,之前在本机都已经安装过两遍,今天又来安装一遍,安装具 ...
随机推荐
- iphone微信 h5页音乐自动播放
iphone微信 h5页音乐自动播放: // iphone自动播放 document.addEventListener("WeixinJSBridgeReady", functio ...
- I/O模型(同步、非同步、阻塞、非阻塞)总结
I/O:同步(synchronous).异步(asynchronous).阻塞(blocking).非阻塞(nonblocking) 1.I/O内部机制 出于安全考虑,用户程序(用户态)是没办法直接操 ...
- HBase启动后发现HMaster进程消失了
HMaster没起来很多原因,这次看日志是这个.详细请看:http://www.bkjia.com/yjs/982064.html Hbase:namespace异常处理,hbase异常处理 Hbas ...
- SpringMVC系列(七)视图解析器和视图
在springmvc.xml里面配置视图解析器 <!-- 配置视图解析器: 如何把 handler 方法返回值解析为实际的物理视图 --> <bean class="org ...
- Eclipse SVN过滤文件夹及文件的方法
有两个步骤: 1.在TortoiseSVN中将文件.文件夹加入ignore list: 2.在Eclipse中Ignored Resources利用模式匹配忽略指定文件夹.文件类型. 这样,那些无需同 ...
- vue input 赋值无效
1.js代码如下 var vm = new Vue({ el:'#rrapp', data:{ q:{ name: null }, dict: {} }, }); 2.文本框代码如下 <inpu ...
- 作为一枚第二天上班的小小.net程序员(技术宅的那种)很迷茫哦,第一个随笔
作为一枚第二天上班的小小.net程序员(技术宅的那种)很迷茫哦,第一个随笔
- linux 上安裝lnmp
1.確保有一台服務器可以正常運行 2.熟練知道一些基本的命令 3.這裡我以lnmp集成環境為例 https://lnmp.org/install.html 4.安裝大約30分鐘左右 5.安裝完畢,訪問 ...
- css 设置背景图片铺满固定不动
#page{ position: relative; width: 100%; height: 100%; background-image:url(../img/bg.JPG); backgroun ...
- WPF TextBox属性IsReadOnlyCaretVisible
纠结了半天WPF下只读的TextBox怎么显示输入焦点提示,发现wpf 4中已有新属性“IsReadOnlyCaretVisible”,大善^_^
