activemq安装配置、外网禁用8161端口

谁借莪1个温暖的怀抱¢ 2022-01-31 01:53 881阅读 0赞
  1. 禁止外网端口访问
    到activemq 的conf目录中找到jetty.xml
    1. <!-- the default port number for the web console -->
    2. <property name="host" value="0.0.0.0"/>
    3. <property name="port" value="8161"/>

    把 name=”host” 行的value的值0.0.0.0 修改成 127.0.0.1 然后重启即可
  1. activemq安全设置—设置admin的用户名和密码:

ActiveMQ使用的是jetty服务器, 打开conf/jetty.xml文件,找到







将property name为authenticate的属性value=”true”改为”false”,登录http://localhost:8161/admin/时就不会弹出用户名密码要求输入。authenticate的属性value="true“ 时,控制台的登录用户名密码保存在conf/jetty-realm.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 users that can access the web (console, demo, etc.)
# username: password [,rolename …]
admin: admin, admin
user: user, user

  1. activemq 的安装配置
    linux上安装activeMQ

1.新建一个文件夹activeMQ
mkdir /server

2.授权
chmod 777 /server

3.下载activeMQ安装包,拷贝到/activeMQ目录下
apache-activemq-5.6.0-bin.tar.gz,下载地址http://activemq.apache.org/download.html

4.解压文件到运行目录/activeServer
tar -xzvf /server/apache-activemq-5.6.0-bin.tar.gz

5.修改activemq运行文件的权限
cd /server/apache-activemq-5.6.2/bin
chmod 755 activemq
运行./activemq

6.运行
三种运行方式:
(1)普通启动 ./activemq start
(2)启动并指定日志文件 ./activemq start >tmp/smlog
(3)后台启动方式nohup ./activemq start >/tmp/smlog
前两种方式下在命令行窗口关闭时或者ctrl+c时导致进程退出,采用后台启动方式则可以避免这种情况

7.检查已经启动
ActiveMQ默认采用61616端口提供JMS服务,使用8161端口提供管理控制台服务,执行以下命令以便检验是否已经成功启动ActiveMQ服务。
打开端口:nc -lp 61616 &
查看哪些端口被打开 netstat -anp
查看61616端口是否打开: netstat -an | grep 61616
检查是否已经启动:
(1).查看控制台输出或者日志文件
(2).直接访问activemq的管理页面:http://localhost:8161/admin/

8.关闭
如果开启方式是使用(1)或(2),则直接ctrl+c或者关闭对应的终端即可
如果开启方式是(3),则稍微麻烦一点:
先查找到activemq对应的进程:
ps -ef | grep activemq
然后把对应的进程杀掉,假设找到的进程编号为 168168

kill 168168

9.清空ActiveMQ 消息队列:
删除/www/apache-activemq-5.5.0/data/kahadb/ 下的文件 然后重启即可

发表评论

表情:
评论列表 (有 0 条评论,881人围观)

还没有评论,来说两句吧...

相关阅读

    相关 服务器端口映射到

    场景:一台路由器,一个外网IP接锐捷路由器wan口,三台服务器接lan口,服务器的远程端口要映射到外网,使得只要能连外网,就可以远程到这台服务器。 1、服务器端设置好远程,