如何修复Tomcat HTTP状态403:对请求资源的访问已被拒绝? [英] How to fix Tomcat HTTP Status 403: Access to the requested resource has been denied?
问题描述
我正在尝试使用当前的源代码设置Tomcat. 我从tomcat网站(6.0.32)下载了zip.
I am trying to setup Tomcat with my current source code. I downloaded the zip from tomcat site (6.0.32).
然后我将项目的配置文件放入tomcatDir\conf\Catalina\localhost
I then put in the config file for my project in tomcatDir\conf\Catalina\localhost
然后我将用户添加到tomcat-users.xml
当我使用localhost:8080/<context root>
打我的应用程序时,我得到了应该的登录提示.提供正确的凭据后,tomcat将引发403错误.
我可以通过localhost:8080/manager/
When I hit my application using localhost:8080/<context root>
, I get the login prompt as I am supposed to. After providing the right credentials, the tomcat throws 403 error.
I am able to access the manager with localhost:8080/manager/
tomcat-users.xml
:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="5c50nD" roles="admin,manager"/>
<user username="nih\kishorev" password="altum" roles="admin,manager"/>
推荐答案
您应该选择由tomcat定义的管理员角色,而不是admin或manager.
You should choose manager roles which are defined by tomcat instead of admin or manager.
manager-gui - Allows access to the html interface
manager-script - Allows access to the plain text interface
manager-jmx - Allows access to the JMX proxy interface
manager-status - Allows access to the read-only status pages
这篇关于如何修复Tomcat HTTP状态403:对请求资源的访问已被拒绝?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!