问题描述
这是我的 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:
I restart tomcat and go to 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:
这是怎么回事?我几乎100%确定可以正确配置XML!
Whats going on here? I'm almost 100% sure I have the XML configured right!?! Is it possible something else isn't configured properly?
推荐答案
我刚刚从您的屏幕快照中意识到您正在使用Tomcat7。
角色有所改变。请参阅更新的
I just realized from your screenshot you are using Tomcat 7.Roles have changed a little bit. See the updated documentation
manager-gui-访问HTML界面。
manager-gui — Access to the HTML interface.
manager-status-仅访问服务器状态页面。
manager-status — Access to the "Server Status" page only.
manager-script —访问本文档中描述的工具友好的纯文本界面,以及服务器状态页面。
manager-script — Access to the tools-friendly plain text interface that is described in >this document, and to the "Server Status" page.
manager-jmx-访问JMX代理界面和服务器状态页面。
manager-jmx — Access to JMX proxy interface and to the "Server Status" page.
将您的角色更新为适当的设置。
update your role to the appropriate setting.
这篇关于Tomcat 403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!