IIS 7.5, 2008rc2,经典asp, 500错误提示:
由于内部服务器错误,页面无法显示。
我需要知道如何配置IIS以获得更详细的错误。 我已经尝试将ASP配置中的所有调试选项设置为true。 但这并没有起作用。有人能帮帮我吗?
IIS 7.5, 2008rc2,经典asp, 500错误提示:
由于内部服务器错误,页面无法显示。
我需要知道如何配置IIS以获得更详细的错误。 我已经尝试将ASP配置中的所有调试选项设置为true。 但这并没有起作用。有人能帮帮我吗?
当前回答
TLDR:首先确定您从管道的哪个位置获得错误(滚动查找与您的错误类似的内容的截图),进行更改以获得新的内容,重复。
首先确定您实际看到的错误消息是什么。
如果你看到的文件位于这里…
SystemDrive % inetpub \ custerr < LANGUAGE-TAG > \ 500 htm。
...通常是这样的:
**那么你就知道你在IIS **中看到了当前配置的错误页面,你不需要更改ASP.net customErrors设置,asp error detail设置,或“显示友好的http错误”浏览器设置。
你可能想看看上面引用的路径,而不是相信我的截图,以防有人更改它。
“是的,我看到了上面描述的错误……”
在这种情况下,您将看到<httpErrors>的设置或在IIS管理器中它的错误页面—>编辑功能设置。这个默认值是errorMode=DetailedLocalOnly在服务器节点级别(而不是站点级别),这意味着当你在远程时看到这个配置的错误页面时,你应该能够在本地登录到服务器并看到完整的错误,它应该看起来像这样:
此时,您应该拥有修复当前错误所需的一切。
“但我甚至在服务器上浏览都没有看到详细的错误”
这就留下了几种可能性。
The browser you are using on the server is configured to use a proxy in its connection settings so it is not being seen as "local". You're not actually browsing to the site you think you are browsing to - this commonly happens when there's a load balancer involved. Do a ping check to see if dns gives you an IP on the server or somewhere else. Your site's httpErrors settings is set for "Custom" only. Change it to "DetailedLocalOnly". However, if you have a configuration error, this may not work since the site level httpErrors is also a configuration item. In that case proceed to #4 The default for httpErrors for all sites is set for "Custom". In this case you need to click on the top level server node in IIS Manager (and not a particular site) and change the httpErrors settings there to DetailedLocalOnly. If this is an internal server and you're not worried about divulging sensitive information, you could also set it to "Detailed" which will allow you to see the error from clients other than the server. You're missing a module on the server like UrlRewrite (this one bites me a lot, and it often gives the generic message regardless of the httpErrors settings).
“登录服务器不是我的选择”
将站点的httpErrors更改为“Detailed”,这样就可以远程查看它。但如果它不起作用,您的错误可能已经是配置错误,请参阅上面的#3。因此,您可能会受困于#4或#5,您将需要来自服务器团队的人员。
“我没有看到上面描述的错误页面。我看到了不同的东西"
如果你看到这个…
...你期望看到这样的东西…
...那么你需要在IIS管理器中,在站点——> IIS——> ASP——>调试属性下,将“发送错误到浏览器”更改为true
如果你看到这个…
或者这个……
...您需要禁用浏览器中的友好错误或使用fiddler's webview查看实际响应与浏览器选择显示的内容。
如果你看到这个…
...然后自定义错误是工作的,但你没有一个自定义错误页面(当然,在这一点上,我们谈论的是。net而不是经典的asp)。你需要改变你的网页中的customErrors标签。配置为“RemoteOnly”以在服务器上查看,或“Off”以远程查看。
如果你看到一些与你的网站样式相似的东西,那么自定义错误可能是On或RemoteOnly,并且它正在显示自定义页面(Views->Shared->Error。例如MVC中的cshtml)。也就是说,有人在IIS中更改了httpErrors的页面,这是不太可能的,但也有可能,所以请参阅第一部分。
其他回答
如果您在服务器上运行浏览器并使用本地ip测试项目的url,则会收到该项目的所有错误,而不会出现一般错误页面(例如500错误页面)。
在IIS管理的站点主界面双击“ASP”,展开“调试属性”,启用“发送错误到浏览器”,点击“应用”。
在主界面的“错误页面”下选择“500”,然后选择“编辑功能设置”,选择“详细错误”。
注意,相同的步骤适用于IIS 8.0 (Windows Server 2012)。
尝试将“existingResponse”httpErrors属性的值设置为“PassThrough”。我的设置为“替换”,导致YSOD不显示。
<httpErrors errorMode="Detailed" existingResponse="PassThrough">
TLDR:首先确定您从管道的哪个位置获得错误(滚动查找与您的错误类似的内容的截图),进行更改以获得新的内容,重复。
首先确定您实际看到的错误消息是什么。
如果你看到的文件位于这里…
SystemDrive % inetpub \ custerr < LANGUAGE-TAG > \ 500 htm。
...通常是这样的:
**那么你就知道你在IIS **中看到了当前配置的错误页面,你不需要更改ASP.net customErrors设置,asp error detail设置,或“显示友好的http错误”浏览器设置。
你可能想看看上面引用的路径,而不是相信我的截图,以防有人更改它。
“是的,我看到了上面描述的错误……”
在这种情况下,您将看到<httpErrors>的设置或在IIS管理器中它的错误页面—>编辑功能设置。这个默认值是errorMode=DetailedLocalOnly在服务器节点级别(而不是站点级别),这意味着当你在远程时看到这个配置的错误页面时,你应该能够在本地登录到服务器并看到完整的错误,它应该看起来像这样:
此时,您应该拥有修复当前错误所需的一切。
“但我甚至在服务器上浏览都没有看到详细的错误”
这就留下了几种可能性。
The browser you are using on the server is configured to use a proxy in its connection settings so it is not being seen as "local". You're not actually browsing to the site you think you are browsing to - this commonly happens when there's a load balancer involved. Do a ping check to see if dns gives you an IP on the server or somewhere else. Your site's httpErrors settings is set for "Custom" only. Change it to "DetailedLocalOnly". However, if you have a configuration error, this may not work since the site level httpErrors is also a configuration item. In that case proceed to #4 The default for httpErrors for all sites is set for "Custom". In this case you need to click on the top level server node in IIS Manager (and not a particular site) and change the httpErrors settings there to DetailedLocalOnly. If this is an internal server and you're not worried about divulging sensitive information, you could also set it to "Detailed" which will allow you to see the error from clients other than the server. You're missing a module on the server like UrlRewrite (this one bites me a lot, and it often gives the generic message regardless of the httpErrors settings).
“登录服务器不是我的选择”
将站点的httpErrors更改为“Detailed”,这样就可以远程查看它。但如果它不起作用,您的错误可能已经是配置错误,请参阅上面的#3。因此,您可能会受困于#4或#5,您将需要来自服务器团队的人员。
“我没有看到上面描述的错误页面。我看到了不同的东西"
如果你看到这个…
...你期望看到这样的东西…
...那么你需要在IIS管理器中,在站点——> IIS——> ASP——>调试属性下,将“发送错误到浏览器”更改为true
如果你看到这个…
或者这个……
...您需要禁用浏览器中的友好错误或使用fiddler's webview查看实际响应与浏览器选择显示的内容。
如果你看到这个…
...然后自定义错误是工作的,但你没有一个自定义错误页面(当然,在这一点上,我们谈论的是。net而不是经典的asp)。你需要改变你的网页中的customErrors标签。配置为“RemoteOnly”以在服务器上查看,或“Off”以远程查看。
如果你看到一些与你的网站样式相似的东西,那么自定义错误可能是On或RemoteOnly,并且它正在显示自定义页面(Views->Shared->Error。例如MVC中的cshtml)。也就是说,有人在IIS中更改了httpErrors的页面,这是不太可能的,但也有可能,所以请参阅第一部分。
如果你在远程服务器上,你可以配置你的网页。配置文件如下:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>