日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[转载]IIS7报500.23错误的解决方法

發布時間:2023/12/13 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [转载]IIS7报500.23错误的解决方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

原文出處:

原文作者:pizibaidu

原文鏈接:http://pizibaidu.blog.51cto.com/1361909/1794446

背景:今天公司終端上有一個功能打開異常,報500錯誤,我用Fiddler找到鏈接,然后在IE里打開,報500.23錯誤:檢測到在集成的托管管道模式下不適用的ASP.NET設置。后臺是一個IIS7tomcat7集成的環境,此處記錄一下。

HTTP 錯誤 500.23 - Internal Server Error

檢測到在集成的托管管道模式下不適用的 ASP.NET 設置。

為什么會出現以上錯誤?

IIS7的應用程序池有兩種模式,一種是集成模式,一種是經典模式

經典模式則是我們以前習慣的IIS6 的方式。

如果使用集成模式,那么對自定義的httpModules httpHandlers 就要修改配置文件,需要將他們轉移到<modules><hanlders>節里去。

兩種解決方法:

1)配置應用程序池

IIS7上配置應用程序池,并且將程序池的模式改為經典,之后一切正常。如圖:

?用了IIS7.x,但實際只發揮了6的功能,另外,在一些ASP.NET MVC程序中的效果也不好,所以,我們嘗試以下解決方法:

2)修改web.config配置文件

注:web.config路徑C:\inetpub\wwwroot\web.config

例如原先設置(你的環境中可能沒有httpModuleshttpHandlers節點)

1 <system.web> 2 ............ 3 <httpModules> 4 <add name="MyModule" type="MyApp.MyModule" /> 5 </httpModules> 6 <httpHandlers> 7 <add path="*.myh" verb="GET" type="MyApp.MyHandler" /> 8 </httpHandlers> 9 </system.web>

IIS7應用程序池為集成模式時,改為:

1 <system.web> 2 ........... 3 </system.web> 4 <system.webServer> 5 <modules> 6 <add name="MyModule" type="MyApp.MyModule" /> 7 </modules> 8 <handlers> 9 <add name="MyHandler" path="*.myh" verb="GET" type="MyApp.MyHandler" preCondition="integratedMode" /> 10 </handlers> 11 </system.webServer>

如果你的web.config沒有httpModuleshttpHandlers節點,則直接在節點system.webServer中添加:<validation validateIntegratedModeConfiguration="false" />禁止驗證集成模式,來避免錯誤。

當然你也可以使用IIS7.0提供的全新管理工具AppCmd.exe來修改web.config文件,關于AppCmd.exe的使用教程請參見:IIS7全新管理工具AppCmd.exe的命令使用實例。

IIS Log的位置:

IIS 6.0的Log日志存儲在:

c:\windows\system32\logfiles\

IIS 7 Log存儲在:

%SystemDrive%\inetpub\logs\LogFiles

經過我的測試, IIS日志是即時寫入的, 不需要IIS reset.

IIS 6, 7的日志寫入按不同站點寫入不同的文件夾, 位置文件夾的格式都是"w3svc{siteId}".

IIS6里, 查看站點ID的方式是通過IIS log的文件夾的名字來確定Site ID.

IIS7中, 在IIS管理器中的advanced settings中, General里的ID就是Site ID, 然后你需要通過這個ID來定位LogFiles文件夾中哪一個文件夾屬于你要查看的站點.

Intergrated和Classic的區別

IIS7的Application Pools有兩種mode,一種是Integrated,一種是classic。如果使用Integrated模式,那么對自定義的httpModules和httpHandlers就要修改配置文件了,需要將他們轉移到<modules>和<hanlders>節里去。

IIS7的兩種模式和IIS6有什么區別?

IIS7.0 Integrated modeasp.net 的modules和handlers從<system.webServer>下的<modules> 和<handlers>里讀取,以前的<system.web>下的<httpModules> 和<httpHandlers>配置節會被忽略,如果設置禁止驗證(disabledvalidation),是不會產生錯誤的。

IIS7.0?Classic mode 與 以上情況是相反的,<modules>和<handlers>會被忽略。

?

Classic vs Integrated

Classic mode (theonly mode in IIS6 and below) is a mode where IIS only works with ISAPIextensions and ISAPI filters directly. In fact, in this mode, Asp.net is justan ISAPI extension (aspnet_isapi.dll) and an ISAPI filter(aspnet_filter.dll).IIS just treats Asp.net as an external plugin implemented in ISAPI and workswith it like a black box (and only when it's needs to give out the request toASP.NET). In this mode, Asp.net is not much different from PHP or other technologies for IIS.

經典模式是IIS6.0以及以下版本的唯一工作模式(只工作在ISAPI EXTENSION,ISAPI FILTERS下)。在此種模式下asp.net只是一個分別實現了ISAPIEXTENSION和ISAPI FILTER的插件(aspnet_isapi.dll,aspnet_filter.dll),IIs的工作只是將特定的請求轉發給Asp.net,與 PHP等等寄宿在IIS中的插件別無二致。

Integrated mode,on the other hand, is a new mode in IIS7 where IIS pipeline is tightlyintegrated (i.e. is just the same) as?Asp.net request pipeline. ASP.NET cansee every request it wants to and manipulate things along the way. ASP.NET isno longer treated as an external plugin. It's completely blended and integratedin IIS. In this mode, Asp.net HttpModules basically have nearly as much poweras an ISAPI filter would have had and Asp.net HttpHandlers can have nearlyequivalent capability as an ISAPI extension could have. In this mode, Asp.netis basically a part of IIS.

然而在集成模式里,IIS的管道與Asp.net的請求管道是緊密集成 的,Asp.net可以完全控制,訪問整個請求管道。Asp.net不在作為一個外部插件,而是完全集成在IIS中。在此模式下,Asp.net HttpModules與ISAPI Filter擁有等同的控制權,Asp.net HttpHandlers與ISAPI Extension擁有等同控制權,換而言之Asp.net已經是IIS的一部分了。

?如 果要兼顧IIS6及IIS7,可在web.config中同時保留httpHandlers(for IIS6)及handlers(for IIS7)里的相同定義,但記得要加上<validation validateIntegratedModeConfiguration="false"/>,不然IIS7會因為定義重覆出現而發生錯誤。

轉載于:https://www.cnblogs.com/Scl891004X/p/6141326.html

總結

以上是生活随笔為你收集整理的[转载]IIS7报500.23错误的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。