小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

JBOSS的安全配置--『爪洼橙樹園』

 石榴 2007-08-30

版本:JBoss 4.0.5GA

jboss默認(rèn)配置了以下服務(wù):
  JMX Console
  JBoss Web Console
為了安全起見,需要用戶通過授權(quán)進(jìn)行訪問。
一、JMX安全配置
STEP 1:
    找到%JBOSS_HOME%/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,根據(jù)說明,去掉注釋。

<jboss-web>   
   
<security-domain>java:/jaas/jmx-console</security-domain>   
</jboss-web>   

STEP 2:
    與jboss-web.xml同級(jí)目錄下還有一個(gè)文件web.xml,找到其中的節(jié)點(diǎn),根據(jù)說明,取消注釋。

<security-constraint>   
     
<web-resource-collection>   
       
<web-resource-name>HtmlAdaptor</web-resource-name>   
       
<description>An example security config that only allows users with the    
         role JBossAdmin to access the HTML JMX console web application    
       
</description>   
       
<url-pattern>/*</url-pattern>   
       
<http-method>GET</http-method>   
       
<http-method>POST</http-method>   
     
</web-resource-collection>   
     
<auth-constraint>   
       
<role-name>JBossAdmin</role-name>   
     
</auth-constraint>   
</security-constraint>   

STEP 3:
    在第一步中的jmx-console安全域和第二步中的運(yùn)行角色JBossAdmin都是在login-config.xml中配置,我們?cè)?

<application-policy name = "jmx-console">   
       
<authentication>   
          
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"   
             flag 
= "required">   
           
<module-option name="usersProperties">props/jmx-console-users.properties</module-option>   
           
<module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>   
          
</login-module>   
       
</authentication>   
    
</application-policy>   

文件props/jmx-console-users.properties定義了用戶名、密碼;props/jmx-console-roles.properties定義了用戶所屬角色

注:
jmx-console-users.properties 格式是:用戶名=密碼明文
jmx-console-roles.properties 格式是:用戶名=角色1,角色2,角色3

二、WEB-CONSOLE的安全配置
STEP 1:
找到%JBOSS_HOME%/server/default/deploy/ management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml文件,根據(jù)說明,去掉注釋。

<jboss-web>   
   
<depends>jboss.admin:service=PluginManager</depends>   
</jboss-web> 

STEP 2:
與jboss-web.xml同級(jí)目錄下還有一個(gè)文件web.xml,找到其中的節(jié)點(diǎn),根據(jù)說明,取消注釋。


<security-constraint>   
   
<web-resource-collection>   
   
<web-resource-name>HtmlAdaptor</web-resource-name>   
   
<description>An example security config that only allows users with the    
   role JBossAdmin to access the HTML JMX console web application    
   
</description>   
   
<url-pattern>/*</url-pattern>   
   
<http-method>GET</http-method>   
   
<http-method>POST</http-method>   
   
</web-resource-collection>   
   
<auth-constraint>   
   
<role-name>JBossAdmin</role-name>   
   
</auth-constraint>   
   
</security-constraint>   

STEP 3:
在本目錄的classes文件夾下找到web-console-users.properties和web-console-roles.properties兩個(gè)文件更名為:

<application-policy name = "web-console">   
       
<authentication>   
          
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"   
             flag 
= "required">   
             
<module-option name="usersProperties">users.properties</module-option>   
             
<module-option name="rolesProperties">roles.properties</module-option>   
          
</login-module>   
       
</authentication>   
</application-policy>   

啟動(dòng)服務(wù)輸入http://localhost:8080/
 然后分別點(diǎn)擊JMX Console以及Jboss Web Console測(cè)試安全機(jī)制

user.properties和role.propertie并修改users.properties其中的用戶名和密碼修改%JBOSS_HOME%/server/default/conf/login-config.xml中web-console節(jié)點(diǎn)修改為以下:
到后自行修改或重新定義用戶名、密碼。JBOSS_HOME%/server/default/config下找到它。查找名字為:jmx-console的application-policy:

然后分別點(diǎn)擊jmx console以及jboss web console測(cè)試安全機(jī)制

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多