[英]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文件。
如果找到有问题的Web.Config文件,则可以删除绝对路径,并且应该修复问题。
更简单的解决方案是更改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.