linux – 在Tomcat中拒绝访问403

前端之家收集整理的这篇文章主要介绍了linux – 在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),但是当我输入它们时,我得到了:

@R_301_449@ 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安装路径] /conf/tomcat-users.xml中,您可以定义角色并将其影响到用户.例如 :

<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>

注意 :

您可能没有在此定义的任何默认用户名和密码,因此花时间进行此配置总是好的,或者在使用NetBeans中集成的IDE时遇到问题.实际上,它需要这些凭证才能正确使用它.

原文链接:https://www.f2er.com/linux/395749.html

猜你在找的Linux相关文章