簡體   English   中英

發生錯誤時IIS7中出現500.19錯誤

[英]500.19 error in IIS7 when an error occurs

設置:Windows 7,IIS7。 我正在開發一個通過本地IIS服務器查看的應用程序,而不是內置的調試Web服務器。 所以我的應用網址是http://localhost/foo/bar.aspx 我的web.config中沒有 <customErrors>部分,我沒有更改IIS中的任何設置。

如果發生任何錯誤,我總是會出現以下錯誤屏幕:

HTTP錯誤500.19 - 內部服務器錯誤
web.config文件的system.webServer/httpErrors部分中不允許使用絕對物理路徑“ C:\\inetpub\\custerr ”。 請改用相對路徑。

這是我的applicationhost.config內容:

<httpErrors errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
  <error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
  <error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
  <error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
  <error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
  <error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
  <error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
  <error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
  <error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
  <error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
</httpErrors>

如何擺脫此配置錯誤,以便查看詳細錯誤?

我過去幾天一直在處理這個問題,並找到了解決方案。 Web.Config文件可能指定其中一個錯誤頁面的絕對路徑。 這可能不是您正在測試的應用程序的Web.Config。 對我來說,這是該網站的Web.Config文件。

  1. 如果找到有問題的Web.Config文件,則可以刪除絕對路徑,並且應該修復問題。

  2. 更簡單的解決方案是更改ApplicationHost.Config文件以將allowAbsolutePathsWhenDelegated屬性設置為true

     <httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath"> 

我在域控制器上安裝Active Directory證書服務時遇到了同樣的問題。 它們都使用端口443.我將證書服務的一個更改為服務器IP地址,並將交換服務器保留為未分配狀態。 這解決了我的問題。

我在IIS 8.5中遇到了同樣的問題。 修復是刪除引用自定義錯誤頁面的web.config文件(位於網站的根目錄中)中的任何條目。 當我嘗試更改自定義頁面時,系統創建了條目。

幫助我解決此錯誤的是將allowAbsolutePathsWhenDelegated設置為true。

轉到部分類型中的IIS>配置編輯器>:system.webServer / httpErrors並將allowAbsolutePathsWhenDelegated設置為true 重新安裝IIS以獲得良好的衡

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM