jboss默认配置了以下服务:
• JMX Console
• JBoss Web Console
为了安全起见,需要用户通过授权进行访问。
一、JMX安全配置
STEP 1:
找到%JBOSS_HOME%/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,根据说明,去掉注释。
<jboss-web>
<security-domain>java:/jaas/jmx-console</security-domain>
</jboss-web>
STEP 2:
与jboss-web.xml同级目录下还有一个文件web.xml,找到其中的节点,根据说明,取消注释。
<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安全域和第二步中的运行角色JBossAdmin都是在login-config.xml中配置,我们在%
<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文件,根据说明,去掉注释。
<jboss-web>
<depends>jboss.admin:service=PluginManager</depends>
</jboss-web>
STEP 2:
与jboss-web.xml同级目录下还有一个文件web.xml,找到其中的节点,根据说明,取消注释。
<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两个文件更名为:
<application-policy name = "web-console">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name="usersProperties">web-console-users.properties</module-option>
<module-option name="rolesProperties">web-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
启动服务输入http://localhost:8080/
然后分别点击JMX Console以及Jboss Web Console测试安全机制
user.properties和role.propertie并修改users.properties其中的用户名和密码修改%JBOSS_HOME%/server/default/conf/login-config.xml中web-console节点修改为以下:
到后自行修改或重新定义用户名、密码。JBOSS_HOME%/server/default/config下找到它。查找名字为:jmx-console的application-policy:
分享到:
相关推荐
赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....
解决jboss启动报错vfs解析异常问题,缺少依赖包问题。包含jboss-as-sprint-int-5.0.0.GA.jar jboss-spring-int-vfs.jar
从Tomcat移植到JBoss所需要新增的两个jar包:jboss-as-sprint-int-5.0.0.GA.jar 和 jboss-spring-int-vfs.jar
赠送jar包:jboss-logging-3.4.3.Final.jar; 赠送原API文档:jboss-logging-3.4.3.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.3.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.3.Final....
赠送jar包:jboss-logging-3.3.2.Final.jar; 赠送原API文档:jboss-logging-3.3.2.Final-javadoc.jar; 赠送源代码:jboss-logging-3.3.2.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.3.2.Final....
赠送jar包:jboss-logging-3.4.1.Final.jar; 赠送原API文档:jboss-logging-3.4.1.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.1.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.1.Final....
jboss-logging-3.1.0.ga.jar.z
jboss-4.0.5.GA.zip
jboss-spring-int-vfs.jar
This is the final release of JBoss Application Server v4.2.0. JBoss AS 4.2 is a stepping stone from JBoss 4.0 to JBoss 5.0. It combines a lot (but not all) of the exciting new features of JBoss 5, but...
安全,可以对其进行数字签名,只让能够识别数字签名的用户使用里面的东西。 加快下载速度; 压缩,使文件变小,与ZIP压缩机制完全相同。 包封装。能够让JAR包里面的文件依赖于统一版本的类文件。 可移植性,能够...
jboss-as-sprint-int-5.0.0.GA
赠送jar包:jboss-logging-3.4.2.Final.jar; 赠送原API文档:jboss-logging-3.4.2.Final-javadoc.jar; 赠送源代码:jboss-logging-3.4.2.Final-sources.jar; 赠送Maven依赖信息文件:jboss-logging-3.4.2.Final....
有人向我要,所以传上来! 错误信息:java.lang.ClassNotFoundException: org.jboss.logging.BasicLogger 解决办法:加入jboss-logging-3.1.0.GA.jar就好了。hibernate4日志机制改了
jboss-4.2.3.GA_下的jboss-4.2.3.GA_下的jboss-4.2.3.GA_下的jboss-4.2.3.GA_下的jboss-4.2.3.GA_下的
JBoss-4.2.3.GA-jdk6.zip
commons-logging-1.1.0.jboss.jar, commons-logging-1.1.1-javadoc.jar, commons-logging-1.1.1-sources.jar, commons-logging-1.1.1.jar, commons-logging-1.1.jar, commons-logging-1.1.src.jar, commons-logging-...
jboss-logging-3.0.0.GA.jar
jboss-web.xml jndi.properties oracle-ds.xml三个文件,EJB+JPA 所需要的一些配置文件