2011-04-27 48 views
6

我想用我当前的源代码设置Tomcat。 我从tomcat网站下载了zip(6.0.32)。如何解决Tomcat HTTP状态403:访问请求的资源已被拒绝?

然后我把在配置文件中为我的项目在tomcatDir\conf\Catalina\localhost

我加入的用户tomcat-users.xml

当我使用localhost:8080/<context root>击中了我的申请,我得到的登录提示,因为我应该。提供正确的凭证后,tomcat会抛出403错误。 我能够与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"/> 
+0

我遇到了同样的问题......您是否设法解决它?我可以访问状态页面,但经理应用程序给出了这个错误.. – FailedDev 2011-09-17 11:48:00

回答

3

你需要改变形式的行动后,显然有一个与在6.0.32版的Tomcat GET方法有问题,它应该固定在tomcat的6.0.33版本中。

link to tomcat bugzilla

0

请检查您的web.xml在这把

admin而不是AllAuthenticatedUsers<role-name>AllAuthenticatedUser</role-name>

刚刚尝试这一点,让我知道它的工作与否。

3

您应该选择由tomcat而不是admin或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 

链接Configuring Manager Application access in tomcat

2

这一个对我的作品

<role rolename="manager"/> 
<user username="admin" password="admin" roles="manager"/> 
1

我有同样的问题。我需要做两件事。在 web.xml中你必须定义BASIC或其他方法导致基于表单的登录提示和角色的名称,例如管理员:

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>Protected Admin Area</web-resource-name> 
     <url-pattern>/Admin</url-pattern> 
    </web-resource-collection> 
    <auth-constraint> 
     <role-name>Admin</role-name> 
    </auth-constraint> 
    </security-constraint> 
    <login-config> 
     <auth-method>BASIC</auth-method> 
    </login-config> 

在tomcat-users.xml中添加用户与角色管理员,或者如果您使用像eclipse这样的图形界面,请执行以下操作:enter image description here

相关问题