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:
分享到:
相关推荐
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...
jboss-4.2.2.GA.part04.rar
jboss-logging-3.1.0.GA.jar jboss-transaction-api_1.1_spec-1.0.0.Final.jar jedis-2.1.0.jar json.jar jsp-api-2.1.jar jstl.jar log4j-1.2.16.jar log4j-api-2.2.jar log4j-core-2.2.jar ...
- 或者,直接编辑 `jboss-4.2.0.GA/server/default/deploy/jboss-web.deployer/server.xml` 文件,将 `<Connector>` 元素的 `address` 参数改为你的局域网 IP 或者 `0.0.0.0`。 6. **解决 Facelets 错误** 如果...
`JBOSS_HOME`指向JBoss安装目录,例如`D:\Develop\jboss-4.2.0.GA`。 接下来,在命令行中执行以下命令,将JBoss注册为服务: ```batch %JBOSS_HOME%\bin\JavaService.exe install JBoss %Java_Home%\jre\bin\server...
- 解压jboss-5.1.0.GA-jdk6.zip文件至指定目录。 - **配置**: 1. **Jboss-5.1.0.GA目录结构**: - `bin`:包含用于启动和关闭JBoss的脚本文件。 - `client`:存放客户端与JBoss通信所需的Java库(JARs)。 - ...
根据不同的JBoss版本,可能需要修改`server.xml`配置文件,例如在Jboss 4.0.5.GA中,修改`jbossweb-tomcat55.sar`下的`server.xml`,而在Jboss 4.2.0.GA中,需要修改`jboss-web.deployer`下的`server.xml`。配置中`...
- JBoss 4.2.0.GA - JCE Policy 1_5_0 - Apache Ant 1.8.0 - Oracle 10G - ojdbc14.jar - EJBca 3.10.1 - Tomcat 5.5.27 - WebLogic 10.3 - WebSphere Application Server 6.1 ##### 2. 环境配置 - **安装 JDK**: ...
- 部署服务器:EJB3.0应用需要在兼容的Java EE服务器上运行,如JBOSS 4.2.0.GA。 3. **创建EJB工程** - 在Eclipse或MyEclipse中创建一个新的EJB工程,指定工程名和持久化单元(Persistence Unit)配置。持久化...
SRM-1.0-JBOSS-4.2.0.GA表明该版本基于JBOSS应用服务器4.2.0.GA运行。JBOSS是Red Hat公司提供的一个开源Java应用服务器,它提供了企业级服务,如事务处理、安全和集群功能。这表示STJUDE-SRM是用Java语言开发的,且...
在使用`seam-gen`之前,需要确保系统中已安装了Ant 1.6或更高版本以及支持EJB3的JBoss Application Server 4.2.0 GA或更高版本。 #### 二、Seam-gen命令详解 `seam-gen`命令位于Seam框架的根目录下,它提供了多种...