`
coolerbaosi
  • 浏览: 727912 次
文章分类
社区版块
存档分类
最新评论

jboss-as-7.0.2.Final 后台管理账号的配置

 
阅读更多

后台管理账号的配置

Jboss As 7的后台管理账号配置有三种模式,

第一种是直接在后台的配置文件书写

第二种是通过属性文件配置

第三种是通过与LDAP连接(这里不做案例,暂时没有LDAP无法做实验)

1)、第一种是直接在后台的配置文件书写

以standalone 启动模式 -- 直接配置文件方式为例

直接在jboss-as-7.0.2.Final/standalone/configuration下的standalone.xml配置

打开该文件,找到

<management>

<security-realms>

<security-realmname="PropertiesMgmtSecurityRealm">

<authentication>

<propertiespath="mgmt-users.properties"relative-to="jboss.server.config.dir"/><!--这行去掉-->

<!--添加以下3行-->

<users>

<userusername="你的用户"><password>你的密码</password></user>

</users>

</authentication>

</security-realm>

</security-realms>

<management-interfaces>

<native-interfaceinterface="management" port="9999" security-realm="PropertiesMgmtSecurityRealm"/><!--添加红色部分-->

<http-interfaceinterface="management" port="9990" security-realm="PropertiesMgmtSecurityRealm"/><!--添加红色部分-->

</management-interfaces>

</management>


在jboss-as-7.0.2.Final/bin目录下通过终端控制台启动standalone.sh,比如

[root@ServerName]./standalone.sh


启动成功之后,打开浏览器,输入http://127.0.0.1:9990/console/



只有输入用户名和密码才能进入Jboss As7的管理控制台



2)、第二种是通过属性文件配置

以domain启动模式 - 配置属性文件方式为例

直接在jboss-as-7.0.2.Final/domain/configuration下的host.xml配置

打开该文件,找到

<management>

<security-realms>

<security-realmname="PropertiesMgmtSecurityRealm">

<authentication>

<propertiespath="mgmt-users.properties"relative-to="jboss.server.config.dir"/>

</authentication>

</security-realm>

</security-realms>

<management-interfaces>

<native-interfaceinterface="management" port="9999" security-realm="PropertiesMgmtSecurityRealm"/><!--添加红色部分-->

<http-interfaceinterface="management" port="9990" security-realm="PropertiesMgmtSecurityRealm"/><!--添加红色部分-->

</management-interfaces>

</management>


再打开同目录的mgmt-users.properties文件

格式如下:

#
# Properties declaration of users for 'PropertiesMgmtSecurityRealm' which can be used to
# secure the management interfaces. Further authentication mechanism can be configured
# as part of the <management /> in standalone.xml.
#
# Management interfaces can be associated with a configured security realm like:
#
# <management-interfaces>
# <native-interface interface="management" port="9999" security-realm="PropertiesMgmtSecurityRealm"/>
# <http-interface interface="management" port="9990" security-realm="PropertiesMgmtSecurityRealm"/>
# </management-interfaces>
#
# or by executing secure-standalone-mgmt.cli script using the command line interface:
#
# bin/jboss-admin.sh -c --file=bin/scripts/secure-standalone-mgmt.cli
#
# against a running server

#Format: username=password
#
#admin=admin

#添加你的账号和密码,用等号对起来,比如

domainadmin=1234567890


保存


在jboss-as-7.0.2.Final/bin目录下通过终端控制台启动domain.sh,比如

[root@ServerName]./domain.sh


启动成功之后,打开浏览器,输入http://127.0.0.1:9990/console/



界面和standalone唯一不同的就是地址栏的地址信息

同样只有输入用户名和密码才能进入Jboss As7的管理控制台




分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics