系统环境: ubuntu 12.04 tomcat-7
需要在界面中登陆managerApp界面:
已经修改了:conf/ tomcat-users.xml
1.自行建立
<role rolename="manage"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manage"/>
报错403.修改了该文件的权限777,还是报错。
查看一些资料说是rolename不能够自己瞎定义。所以修改了如下代码:
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>
<user username="admin" password="admin" roles="admin-gui"/>
重启了tomcat还是出现403错误。
在欢迎界面中serverstatus 和hotmanager都能够通过第二次配置的密码登陆,并显示相应的内容,只有managerApp不能够通过第二次配置的帐号密码登陆。
求大神们解释解释这是为什么!!!!!
ringa_lee2017-04-24 09:15:52
This is the modified answer.
After verification, I successfully accessed the Manager App. In fact, the first one of your questions
username
为tomcat
的用户已经可以正常登陆了,只是又你写了一个错误的用户<user username="admin" password="admin" roles="admin-gui"/>
(这里的roles
应该是manager-gui
only works), so I can’t log in,The following is the verification process: I logged in with the user
<user username="admin" password="admin" roles="admin-gui"/>
, and indeed an error 403 was reported.Here is a piece of code that illustrates how to set permissions and passwords if you want to log in:
// 举个例子,想增加一个用户名是tomcat,密码是 s3cret 的 "manager-gui" 角色,则按照下面的配置:
For example, to add the manager-gui role to a user named tomcat with a password of s3cret,
add the following to the config file listed above.
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/> // 这里的roles必须写对