Tomcat中的403访问被拒绝

我在以下内容中tomcat-users.xml

<tomcat-users>

<role rolename="admin"/>

<role rolename="manager"/>

<user username="aname" password="apassword" roles="admin,manager"/>

</tomcat-users>

如果我转到http://localhost:8080/manager/html,系统会询问我用户名和密码(据我了解,来自tomcat-

users.xml),但是当我输入它们时,我得到:

403 Access Denied

You are not authorized to view this page.

If you have already configured the Manager application to allow access and you have used your browsers back button...

发生这种行为的原因可能是什么?提前致谢。

回答:

要使用Web管理gui,您必须添加gui role

[Tomcat installation path]/conf/tomcat-users.xml你可以定义role并影响到user。例如 :

<tomcat-users>

<role rolename="admin"/>

<role rolename="admin-gui"/>

<role rolename="manager"/>

<role rolename="manager-gui"/>

<user username="name" password="pwd" roles="admin,admin-gui,manager,manager-gui"/>

</tomcat-users>


您可能没有 在此处定义任何

,因此花点时间进行此配置总是很好的,否则在使用集成在IDE中的Tomcat(例如NetBeans)时会遇到问题。实际上,将需要这些凭据才能正确使用它。

以上是 Tomcat中的403访问被拒绝 的全部内容, 来源链接: utcz.com/qa/431722.html

回到顶部