tomcat登录问题解决办法

转自   http://blog.csdn.net/babyfacer/article/details/6839972?reload

配置好 Tomcat 7.0 后,在 tomcat-users.xml 中配置用户角色来访问 localhost:8080 的这样三个按钮总出现问题:

Server Status

Manager App

Host Manager

要么是三个都不能访问,要么是只能访问其中一个,或者两个。

 

后来发现是角色没有添加全,特别是针对第三个按钮“Host Manager”

 

 

 

其实解决点在这样两个症结上:

 

前两个按钮和manager相关,具体角色名为

manager-gui - allows access to the HTML GUI and the status pages

manager-script - allows access to the text interface and the status pages

manager-jmx - allows access to the JMX proxy and the status pages

manager-status - allows access to the status pages only

第三个按钮和admin相关,具体角色名为

    admin-gui - allows access to the HTML GUI and the status pages

    admin-script - allows access to the text interface and the status pages

所以在 tomcat-users.xml 如果不注重安全性,只是测试用的话,对应部分可以简单地写成下面这个样子:

 

---------------------------------

 

  <role rolename="admin"/>

  <role rolename="manager-script"/>

  <role rolename="manager-gui"/>

  <role rolename="manager-jmx"/>

  <role rolename="manager-status"/>

  <role rolename="admin-gui"/>

  <role rolename="admin-script"/>

 

  <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

 

---------------------------------

 

很多网页没说到第三个按钮针对的角色。不添加admin-gui和admin-script的话,第三个按钮就会出现访问被拒绝的问题(access denied ....)。

 

详细说明可以参考 Tomcat 的文档(http://tomcat.apache.org/migration.html#Manager_application):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值