到jboss目录 server/default/deploy/jmx-console.war 下
jmx-console.war就是 jboss的默认控制台 相当于tomcat的控制台 用于控制程序的发布
jboss的参数配置等
进入 server/default/deploy/jmx-console.war/WEB-INF下的 jboss-web.xml配置文件
<security-domain>java:/jaas/jmx-console</security-domain>默认是被注释的 可以将注释打开
打开它 意味着控制台将被打开
打开同一目录的web.xml 将如下 的注释拿掉
<!-- 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>
-->
而要进入控制台必须要输入用户名和密码 还要有角色控制
配置这个的文件是 server/default/conf/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是配置用户对应的 角色
修改好文件后 启动jboss
访问 http://localhost:8080/jmx-console.war
当然你可以去修改端口server/default/deploy/jboss-web.deployer/server.xml个文件