2011-04-27 47 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

相關問題