Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选

首页 / 软件开发 / JAVA / Windows下JBoss配置详解

Windows下JBoss配置详解2012-01-14 JavaEye kenterJBoss配置

1.jmx-console 登录的用户名和密码设置

默认情况访问 http://localhost:8080/jmx-console 就可以浏览jboss的部署管理的一些信息,不需要输入用户名和密码,使用起来有点安全隐患。下面我们针对此问题对jboss进行配置,使得访问jmx-console也必须要知道用户名和密码才可进去访问。JBoss配置步骤如下:

1)找到JBoss安装目录/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,去掉<security-domain>java:/jaas/jmx-console</security-domain>的注释。修改后的该文件内容为:

<jboss-web>     <!-- Uncomment the security-domain to enable security. You will         need to edit the htmladaptor login configuration to setup the         login modules used to authentication users.-->        <security-domain>java:/jaas/jmx-console</security-domain>  </jboss-web>
2)修改与i)中的jboss-web.xml同级目录下的web.xml文件,查找到<security-constraint/>节点,去掉它的注释,修改后该部分内容为:

<!-- A security constraint that restricts access to the HTML JMX console      to users with the role JBossAdmin. Edit the roles to what you want and      uncomment the WEB-INF/jboss-web.xml/security-domain element to enable      secured access to the HTML JMX console.-->     <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>