NO IMAGE

後臺管理賬號的配置

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,比如

[[email protected]]./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,比如

[[email protected]]./domain.sh

啟動成功之後,開啟瀏覽器,輸入http://127.0.0.1:9990/console/

介面和standalone唯一不同的就是位址列的地址資訊

同樣只有輸入使用者名稱和密碼才能進入Jboss As7的管理控制檯