1. 程式人生 > >ActiveMQ 安全設定----設定安全認證賬戶和密碼

ActiveMQ 安全設定----設定安全認證賬戶和密碼

第一步:開啟ActiveMQ 安裝目錄下的conf 資料夾,開啟conf/jetty.xml,

 <bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
        <property name="name" value="BASIC" />
        <property name="roles" value="admin" />
        <property name="authenticate" value="true" />
    </bean>
將property   name 為authenticate的屬性值value ="false",修改為value ="true"。其含義是:啟動登入安全認證機制

第二步:配置ActiveMQ 安全登入賬戶和密碼

控制ActiveMQ 安全登入的賬戶和密碼資訊儲存在,conf/jetty-real.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
語法格式:

賬戶 : 密碼  [角色]

ActiveMQ 系統自帶預設賬戶:admin,密碼:admin,角色:admin。