简体   繁体   English

Tomcat 403错误

[英]Tomcat 403 Error

Here's my tomcat-users.xml : 这是我的tomcat-users.xml

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
    <role rolename="tomcat"/>
    <role rolename="role1"/>
    <role rolename="admin"/>
    <role rolename="manager"/>

    <user username="tomcat" password="tomcat" roles="tomcat"/>
    <user username="MyAdmin" password="pswd" roles="admin,manager"/>
</tomcat-users>

I restart tomcat and go to localhost:8080/manager . 我重新启动tomcat并转到localhost:8080/manager It asks me to log in. I enter the admin/manager credentials (u = MyAdmin and p = pswd) and it fails, giving me the following 403: 它要求我登录。我输入管理员/管理员凭据(u = MyAdmin和p = pswd),但操作失败,显示以下403:

在此处输入图片说明

Whats going on here? 这里发生了什么? I'm almost 100% sure I have the XML configured right!?! 我几乎100%确定我已正确配置XML !!! Is it possible something else isn't configured properly? 是否有其他可能配置不正确?

I just realized from your screenshot you are using Tomcat 7. Roles have changed a little bit. 我刚刚从您的屏幕快照中意识到您正在使用Tomcat7。角色有些变化。 See the updated documentation 请参阅更新的文档

You can find the role names in the web.xml file of the Manager web application. 您可以在Manager Web应用程序的web.xml文件中找到角色名称。 The available roles are: 可用角色为:

manager-gui — Access to the HTML interface. manager-gui-访问HTML界面。

manager-status — Access to the "Server Status" page only. manager-status-仅访问“服务器状态”页面。

manager-script — Access to the tools-friendly plain text interface that is described in >this document, and to the "Server Status" page. manager-script —访问本文档中描述的工具友好的纯文本界面,以及“服务器状态”页面。

manager-jmx — Access to JMX proxy interface and to the "Server Status" page. manager-jmx-访问JMX代理界面和“服务器状态”页面。

update your role to the appropriate setting. 将您的角色更新为适当的设置。

Those roles are gone. 这些角色不见了。 Your account needs the manager-gui role. 您的帐户需要使用manager-gui角色。 You obviously did not read the docs . 您显然没有阅读文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM