远方蔚蓝
一刹那情真,相逢不如不见

文章数量 126

访问次数 199896

运行天数 1437

最近活跃 2024-10-04 23:36:48

进入后台管理系统

Linux Centos7下安装activeMq


一、安装
1、首先我们要把下载好的activeMQ压缩包上传到centos上,我已经上传完毕,前往存放的文件夹
[root@localhost file]# cd /home/file/
2、解压文件
[root@localhost file]# tar -zxvf ./apache-activemq-5.15.3-bin.tar.gz
3、把解压后的文件夹移动到,并重命名为activeMq
mv ./apache-activemq-5.15.3 /usr/local/activeMq
二、安全相关配置
安全验证有两个概念:1.控制台安全配置;2.JMS服务安全配置
1、控制台安全配置打开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>
将"false" 改为"true",重启ActiveMQ 即可。
 
2、修改控制台admin用户密码conf/credentials.properties
# username: password [,rolename ...]
admin: admin, admin
user: user, user
3、JMS服务安全配置 在conf/activemq.xml文件中加入以下内容
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
  ......
    <transportConnectors>
        <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
        <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
    </transportConnectors>
    <!-- destroy the spring context on shutdown to stop jetty -->
    <shutdownHooks>
        <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
    </shutdownHooks>
</broker>
这个${activemq.password} 在conf/credentials.properties文件中配置
三、登录
进入activeMq/bin,启动activeMq
[root@localhost bin]# ./activemq start
最后验证结果输入http://ip地址:8161/admin   用户名:admin 密码:admin