简体   繁体   English

发生错误时IIS7中出现500.19错误

[英]500.19 error in IIS7 when an error occurs

Setup: Windows 7, IIS7. 设置:Windows 7,IIS7。 I am working on an app that is being viewed through the local IIS server, not the built in debugging web server. 我正在开发一个通过本地IIS服务器查看的应用程序,而不是内置的调试Web服务器。 So my app url is http://localhost/foo/bar.aspx . 所以我的应用网址是http://localhost/foo/bar.aspx There is no <customErrors> section in my web.config, and I haven't changed any settings in IIS. 我的web.config中没有 <customErrors>部分,我没有更改IIS中的任何设置。

If any error occurs, I always get the following error screen: 如果发生任何错误,我总是会出现以下错误屏幕:

HTTP Error 500.19 - Internal Server Error HTTP错误500.19 - 内部服务器错误
Absolute physical path " C:\\inetpub\\custerr " is not allowed in system.webServer/httpErrors section in web.config file. web.config文件的system.webServer/httpErrors部分中不允许使用绝对物理路径“ C:\\inetpub\\custerr ”。 Use relative path instead. 请改用相对路径。

Here's my applicationhost.config contents: 这是我的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>

How can I get rid of this configuration error so I can see detailed errors? 如何摆脱此配置错误,以便查看详细错误?

I've been dealing with this issue for the last few days and found the solution. 我过去几天一直在处理这个问题,并找到了解决方案。 A Web.Config file is likely specifying an absolute path for one of the error pages. Web.Config文件可能指定其中一个错误页面的绝对路径。 This may not be the Web.Config of the application you are testing. 这可能不是您正在测试的应用程序的Web.Config。 For me, it was the website's Web.Config file. 对我来说,这是该网站的Web.Config文件。

  1. If you find the offending Web.Config file you can remove the absolute path and the problem should be fixed. 如果找到有问题的Web.Config文件,则可以删除绝对路径,并且应该修复问题。

  2. A much easier solution would be to alter your ApplicationHost.Config file to set the allowAbsolutePathsWhenDelegated property to true : 更简单的解决方案是更改ApplicationHost.Config文件以将allowAbsolutePathsWhenDelegated属性设置为true

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

I had the same problem when I installed Active Directory Certificate Services on the domain controller. 我在域控制器上安装Active Directory证书服务时遇到了同样的问题。 Both of them were using port 443. I change the one for certificate services to the server IP Address and left the exchange server unassigned. 它们都使用端口443.我将证书服务的一个更改为服务器IP地址,并将交换服务器保留为未分配状态。 That solved my problem. 这解决了我的问题。

I had this same issue in IIS 8.5. 我在IIS 8.5中遇到了同样的问题。 The fix was to delete any entries in the web.config file (located in the root directory of the website) that referenced the custom error pages. 修复是删除引用自定义错误页面的web.config文件(位于网站的根目录中)中的任何条目。 The entries were created by the system when I had attempted to make changes to custom pages. 当我尝试更改自定义页面时,系统创建了条目。

What helped me to resolve this error is setting allowAbsolutePathsWhenDelegated to true. 帮助我解决此错误的是将allowAbsolutePathsWhenDelegated设置为true。

Go to IIS > Configuration Editor > in Section type: system.webServer/httpErrors and Set allowAbsolutePathsWhenDelegated to true . 转到部分类型中的IIS>配置编辑器>:system.webServer / httpErrors并将allowAbsolutePathsWhenDelegated设置为true Reset IIS for good measure. 重新安装IIS以获得良好的衡

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM