【转】 activemq安全设置 设置admin的用户名和密码
ActiveMQ使用的是jetty服务器,打开conf/jetty.xml文件,找到
<beanid="securityConstraint"class="org.eclipse.jetty.http.security.Constraint">
<propertyname="name"value="BASIC"/>
<propertyname="roles"value="admin"/>
<propertyname="authenticate"value="false"/>
</bean>
将propertyname为authenticate的属性value="false"改为"true",
控制台的登录用户名密码保存在conf/jetty-realm.properties文件中,内容如下:
##---------------------------------------------------------------------------
##LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
##contributorlicenseagreements.SeetheNOTICEfiledistributedwith
##thisworkforadditionalinformationregardingcopyrightownership.
##TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
##(the"License");youmaynotusethisfileexceptincompliancewith
##theLicense.YoumayobtainacopyoftheLicenseat
##
##http://www.apache.org/licenses/LICENSE-2.0
##
##Unlessrequiredbyapplicablelaworagreedtoinwriting,software
##distributedundertheLicenseisdistributedonan"ASIS"BASIS,
##WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
##SeetheLicenseforthespecificlanguagegoverningpermissionsand
##limitationsundertheLicense.
##---------------------------------------------------------------------------
#Definesusersthatcanaccesstheweb(console,demo,etc.)
#username:password[,rolename...]
admin:admin,admin
值得注意的是用户名和密码的格式是
用户名:密码,角色名