﻿{"id":408,"date":"2011-03-14T12:20:23","date_gmt":"2011-03-14T04:20:23","guid":{"rendered":"http:\/\/nick.workao.org\/?p=408"},"modified":"2011-03-14T12:20:24","modified_gmt":"2011-03-14T04:20:24","slug":"%e9%85%8d%e7%bd%ae-iis-7-%e6%98%be%e7%a4%ba%e8%af%a6%e7%bb%86%e9%94%99%e8%af%af%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/win\/408","title":{"rendered":"\u914d\u7f6e IIS 7 \u663e\u793a\u8be6\u7ec6\u9519\u8bef\u4fe1\u606f"},"content":{"rendered":"<p>\u5982\u679c\u4f60\u5728 IIS 7 \u4e2d\u53ea\u770b\u5230\u8bf8\u5982 HTTP Error 500 &#8211; Internal Server Error (500 &#8211; \u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef) \u7684\u7b80\u5355\u9519\u8bef\u4fe1\u606f\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u6b65\u9aa4\u914d\u7f6e IIS7 \u4ee5\u8f93\u51fa\u8be6\u7ec6\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<h3>\u901a\u8fc7 IIS \u914d\u7f6e<\/h3>\n<ol>\n    <li>\u6309\u4f4f WIN + R \u6253\u5f00\u547d\u4ee4\u884c\u8f93\u5165 inetmgr \u6253\u5f00 IIS \u7ba1\u7406<\/li>\n    <li>\u5de6\u8fb9\u76ee\u5f55\u9009\u62e9\u76ee\u6807\u7ad9\u70b9\uff0c\u5728\u53f3\u8fb9 IIS \u5757\u4e2d\u53cc\u51fb Error Pages<\/li>\n    <li>\u5728 Error Pages \u4e2d\u53f3\u8fb9\u7684 Actions\uff0c\u9009\u62e9 Edit Feature Settings<\/li>\n    <li>\u5728 Error Responses \u4e2d\uff0c\u9009\u62e9 Detailed errors\uff0c\u5355\u673a OK \u5b8c\u6210\u914d\u7f6e\u3002<\/li>\n<\/ol>\n<p><a href=\"http:\/\/blogs.leoworks.net\/feng\/upload\/dnbe_jc\/iis7-detailed-errors.png\"><img loading=\"lazy\" decoding=\"async\" title=\"iis7-detailed-errors\" src=\"http:\/\/nick.txtcc.com\/wp-content\/uploads\/remote_image\/2011\/03\/042023pzV.png\" border=\"0\" alt=\"iis7-detailed-errors\" width=\"305\" height=\"278\" \/><\/a><\/p>\n<h3>\u901a\u8fc7\u547d\u4ee4\u884c<\/h3>\n<p>\u542f\u7528\u8be6\u7ec6\u9519\u8bef\uff1a<\/p>\n<p><em><strong>%windir%\\system32\\inetsrv\\appcmd.exe set config &#8220;Default Web Site\/yourapp&#8221; \/section:httpErrors \/errorMode:Detailed<\/strong><\/em><\/p>\n<p>\u7981\u7528\u8be6\u7ec6\u9519\u8bef\uff1a<\/p>\n<p><em><strong>%windir%\\system32\\inetsrv\\appcmd.exe set config &#8220;Default Web Site\/yourapp&#8221; \/section:httpErrors \/errorMode:Custom<\/strong><\/em><\/p>\n<h3>\u901a\u8fc7 web.config \u914d\u7f6e<\/h3>\n<p>\u5176\u5b9e\uff0c\u4e0a\u9762\u5728\u4e24\u79cd\u914d\u7f6e\uff0c\u6700\u7ec8\u90fd\u4f1a\u53cd\u5e94\u5230\u5bf9\u5e94\u7684 web.config \u4e2d\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91  web.config\u3002\u7279\u522b\u662f\u5bf9\u4e8e\u4e70\u7684\u865a\u62df\u4e3b\u673a(Shared Web Hosting)\uff0c\u6ca1\u6709\u6743\u9650\u66f4\u6539IIS\u3002\u6253\u5f00\u7f51\u7ad9\u76ee\u5f55\uff0c\u627e\u5230  web.config \u6587\u4ef6\uff08\u5982\u679c\u6ca1\u6709\uff0c\u5c31\u5efa\u7acb\u4e00\u4e2a txt \u6587\u4ef6\u5b58\u4e3a web.config\uff09\uff0c\u627e\u5230 system.webServer  \u914d\u7f6e\u8282\uff0c\u6dfb\u52a0\u914d\u7f6e <em><httpErrors errorMode=\"DetailedLocalOnly\" \/><\/em>\u3002<\/p>\n<p>[code:xml]<\/p>\n<p><configuration>\n<system.webServer>\n<httpErrors errorMode=\"DetailedLocalOnly\" \/>\n<\/system.webServer>\n<\/configuration><\/p>\n<p>[\/code]<\/p>\n<p>\u6ce8\u610f<\/p>\n<ul>\n    <li>\u6b64\u53c2\u6570\u9009\u9879\u53ef\u4ee5\u5e94\u7528\u5230\u7f51\u7ad9\u6216\u5b50\u76ee\u5f55\u6216\u865a\u62df\u76ee\u5f55\u3002<\/li>\n    <li>\u6b64\u53c2\u6570\u9009\u9879\u5bf9\u6240\u6709 IIS \u5e94\u7528\u7a0b\u5e8f\u6709\u6548\uff0c\u5305\u62ec ASP, APS.NET, PHP \u7b49\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u662f ASP.NET \u7a0b\u5e8f\uff0c\u53ef\u80fd\u8fd8\u9700\u8981\u914d\u7f6e\u00a0 <customErrors mode=\u201dOff\u201d \/>\n[code:xml]<\/p>\n<p><system.web>\n<customErrors mode=\u201dOff\u201d \/>\n<\/system.web><\/p>\n<p>[\/code]<\/p>\n<p>\u6b64\u5916\uff0c\u5982\u679c\u662f ASP \u7a0b\u5e8f\uff0c\u8fd8\u53ef\u4ee5\u914d\u7f6e sendErrorsToBrowser \u9009\u9879\uff1a<\/p>\n<h3>\u901a\u8fc7 IIS \u914d\u7f6e<\/h3>\n<ol>\n    <li>\u6309\u4f4f WIN + R \u6253\u5f00\u547d\u4ee4\u884c\u8f93\u5165 inetmgr \u6253\u5f00 IIS \u7ba1\u7406<\/li>\n    <li>\u5de6\u8fb9\u76ee\u5f55\u9009\u62e9\u76ee\u6807\u7ad9\u70b9\uff0c\u5728\u53f3\u8fb9 IIS \u5757\u4e2d\u53cc\u51fb ASP<\/li>\n    <li>\u5728 ASP \u9875\u4e2d\u5c55\u5f00 Debugging Properties \u8282\u70b9<\/li>\n    <li>\u627e\u5230 Send Errors To Browser \uff0c\u9009\u62e9 true<\/li>\n    <li>\u53f3\u8fb9 Actions \u4e2d\uff0c\u5355\u51fb Apply<\/li>\n<\/ol>\n<p><a href=\"http:\/\/blogs.leoworks.net\/feng\/upload\/dnbe_jc\/iis7-detailed-errors-asp.png\"><img loading=\"lazy\" decoding=\"async\" title=\"iis7-detailed-errors-asp\" src=\"http:\/\/nick.txtcc.com\/wp-content\/uploads\/remote_image\/2011\/03\/042023Shl.png\" border=\"0\" alt=\"iis7-detailed-errors-asp\" width=\"379\" height=\"336\" \/><\/a><\/p>\n<h3>\u901a\u8fc7\u547d\u4ee4\u884c<\/h3>\n<p>\u542f\u7528\uff1a<\/p>\n<p><em><strong>%windir%\\system32\\inetsrv\\appcmd set config -section:asp -scriptErrorSentToBrowser:true<\/strong><\/em><\/p>\n<p>\u7981\u7528\uff1a<\/p>\n<p><em><strong>%windir%\\system32\\inetsrv\\appcmd set config -section:asp -scriptErrorSentToBrowser:false<\/strong><\/em><\/p>\n<p>\u6ce8\u610f\u4e0a\u9762\u53c2\u6570\u4e2d config \u540e\u9762\u4e0d\u80fd\u6307\u5b9a\u7ad9\u70b9\u76ee\u5f55<\/p>","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u5728 IIS 7 \u4e2d\u53ea\u770b\u5230\u8bf8\u5982 HTTP Error 500 &#8211; Internal Server Error (500 &#8211; \u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef) \u7684\u7b80\u5355\u9519\u8bef\u4fe1\u606f\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5982&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[226,254,99,253],"class_list":["post-408","post","type-post","status-publish","format-standard","hentry","category-win","tag-iis7","tag-254","tag-99","tag-253"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":1,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":409,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions\/409"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}