gpt4 book ai didi

java - Tomcat 403 错误

转载 作者:行者123 更新时间:2023-11-28 22:33:58 25 4
gpt4 key购买 nike

这是我的 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>

我重新启动 tomcat 并转到 localhost:8080/manager。它要求我登录。我输入管理员/经理凭据(u = MyAdmin 和 p = pswd)但它失败了,给我以下 403:

enter image description here

这是怎么回事?我几乎 100% 确定我的 XML 配置正确!?!是否有其他配置不正确?

最佳答案

我刚刚从您的屏幕截图中了解到您使用的是 Tomcat 7。角色发生了一些变化。查看更新的 documentation

You can find the role names in the web.xml file of the Manager web application. The available roles are:

manager-gui — Access to the HTML interface.

manager-status — Access to the "Server Status" page only.

manager-script — Access to the tools-friendly plain text interface that is described in >this document, and to the "Server Status" page.

manager-jmx — Access to JMX proxy interface and to the "Server Status" page.

将您的角色更新为适当的设置。

关于java - Tomcat 403 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9648212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com