IIS7出现错误时出现500.19错误
设置:Windows 7、IIS7。我正在开发一个通过本地 IIS 服务器查看的应用程序,而不是内置的调试 Web 服务器。所以我的应用程序网址是 http://localhost/foo/bar.aspx
。我的 web.config 中没有
部分,并且我没有更改 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>
如何摆脱此配置错误以便可以看到详细的错误?
Setup: 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. So my app url is http://localhost/foo/bar.aspx
. There is no <customErrors>
section in my web.config, and I haven't changed any settings in IIS.
If any error occurs, I always get the following error screen:
HTTP Error 500.19 - Internal Server Error
Absolute physical path "C:\inetpub\custerr
" is not allowed insystem.webServer/httpErrors
section in web.config file. Use relative path instead.
Here's my applicationhost.config
contents:
<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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
过去几天我一直在处理这个问题并找到了解决方案。 Web.Config 文件可能指定错误页面之一的绝对路径。这可能不是您正在测试的应用程序的 Web.Config。对我来说,它是网站的 Web.Config 文件。
如果您找到有问题的 Web.Config 文件,您可以删除绝对路径,问题应该得到解决。
如果您找到有问题的 Web.Config 文件,
更简单的解决方案是更改您的 ApplicationHost.Config 文件将
allowAbsolutePathsWhenDeleerated
属性设置为true
: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. This may not be the Web.Config of the application you are testing. For me, it was the website's Web.Config file.
If you find the offending Web.Config file you can remove the absolute path and the problem should be fixed.
A much easier solution would be to alter your ApplicationHost.Config file to set the
allowAbsolutePathsWhenDelegated
property totrue
:当我在域控制器上安装 Active Directory 证书服务时,我遇到了同样的问题。两者都使用端口 443。我将证书服务的端口更改为服务器 IP 地址,并保留交换服务器未分配。这解决了我的问题。
I had the same problem when I installed Active Directory Certificate Services on the domain controller. 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. That solved my problem.
我在 IIS 8.5 中也遇到了同样的问题。修复方法是删除 web.config 文件(位于网站的根目录中)中引用自定义错误页面的所有条目。当我尝试更改自定义页面时,这些条目是由系统创建的。
I had this same issue in 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. The entries were created by the system when I had attempted to make changes to custom pages.
帮助我解决此错误的方法是将
allowAbsolutePathsWhenDeleerated
设置为 true。转到 IIS >配置编辑器>在部分类型:system.webServer/httpErrors
并将
allowAbsolutePathsWhenDeleerated
设置为 true。重置IIS以获得良好的效果。What helped me to resolve this error is setting
allowAbsolutePathsWhenDelegated
to true.Go to IIS > Configuration Editor > in Section type: system.webServer/httpErrors
and Set
allowAbsolutePathsWhenDelegated
to true. Reset IIS for good measure.对我来说,解决方案是设置自定义帐户
在右侧窗格中选择应用程序 --> 基本设置 --> 连接为 --> 提供用户名和密码,然后授予该用户对 inetpub>wwwroot> 文件夹名称上的项目文件夹的完全权限
For me the solution was to set custom account
select application-->basic settings in the right pane--->connect as -->provide username and password then give this user full permissions on the project folder on inetpub>wwwroot>foldername