国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

首頁(yè) php教程 PHP開(kāi)發(fā) IIS7報(bào)500.23錯(cuò)誤的原因分析及解決方法

IIS7報(bào)500.23錯(cuò)誤的原因分析及解決方法

Jan 06, 2017 pm 04:21 PM

?背景:今天公司終端上有一個(gè)功能打開(kāi)異常,報(bào)500錯(cuò)誤,我用Fiddler找到鏈接,然后在IE里打開(kāi),報(bào)500.23錯(cuò)誤:檢測(cè)到在集成的托管管道模式下不適用的ASP.NET設(shè)置。后臺(tái)是一個(gè)IIS7和tomcat7集成的環(huán)境,此處記錄一下。

HTTP 錯(cuò)誤 500.23 - Internal Server Error

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

IIS7報(bào)500.23錯(cuò)誤的原因分析及解決方法

為什么會(huì)出現(xiàn)以上錯(cuò)誤?

在IIS7的應(yīng)用程序池有兩種模式,一種是“集成模式”,一種是“經(jīng)典模式”。

經(jīng)典模式則是我們以前習(xí)慣的IIS 6 的方式。

如果使用集成模式,那么對(duì)自定義的httpModules 和 httpHandlers 就要修改配置文件,需要將他們轉(zhuǎn)移到節(jié)里去。

兩種解決方法:

第一種方法、配置應(yīng)用程序池

在IIS7上配置應(yīng)用程序池,并且將程序池的模式改為“經(jīng)典”,之后一切正常。如圖:

IIS7報(bào)500.23錯(cuò)誤的原因分析及解決方法

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

第二種方法、修改web.config配置文件:

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

例如原先設(shè)置(你的環(huán)境中可能沒(méi)有httpModules,httpHandlers節(jié)點(diǎn))

<system.web>
............
<httpModules>
<add name="MyModule"type="MyApp.MyModule" />
</httpModules>
<httpHandlers>
<add path="*.myh"verb="GET"type="MyApp.MyHandler" />
</httpHandlers>
</system.web>

在IIS7應(yīng)用程序池為“集成模式”時(shí),改為:

<system.web>
...........
</system.web>
<system.webServer>
<modules>
<add name="MyModule"type="MyApp.MyModule" /> 
</modules>
<handlers>
<add name="MyHandler"path="*.myh"verb="GET"type="MyApp.MyHandler"preCondition="integratedMode" />
</handlers>
</system.webServer>

(如果你的web.config沒(méi)有httpModules,httpHandlers節(jié)點(diǎn),則直接在節(jié)點(diǎn)system.webServer中添加:

<validation validateIntegratedModeConfiguration="false" />

禁止驗(yàn)證集成模式,來(lái)避免錯(cuò)誤。

IIS Log的位置
IIS 6.0的Log日志存儲(chǔ)在:
c:\windows\system32\logfiles\

IIS 7 Log存儲(chǔ)在:
%SystemDrive%\inetpub\logs\LogFiles

經(jīng)過(guò)我的測(cè)試, IIS日志是即時(shí)寫(xiě)入的, 不需要IIS reset.

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

IIS6里, 查看站點(diǎn)ID的方式是通過(guò)IIS log的文件夾的名字來(lái)確定Site ID.

IIS7中, 在IIS管理器中的advanced settings中, General里的ID就是Site ID, 然后你需要通過(guò)這個(gè)ID來(lái)定位LogFiles文件夾中哪一個(gè)文件夾屬于你要查看的站點(diǎn).

Intergrated和Classic的區(qū)別

IIS7的Application Pools有兩種mode,一種是Integrated,一種是classic。如果使用Integrated模式,那么對(duì)自定義的httpModules和httpHandlers就要修改配置文件了,需要將他們轉(zhuǎn)移到節(jié)里去。

IIS7的兩種模式和IIS6有什么區(qū)別?

IIS7.0 Integrated mode:asp.net 的modules和handlers從下的里讀取,以前的下的配置節(jié)會(huì)被忽略,如果設(shè)置禁止驗(yàn)證(disabledvalidation),是不會(huì)產(chǎn)生錯(cuò)誤的。

IIS7.0 Classic mode: 與 以上情況是相反的,會(huì)被忽略。

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.

經(jīng)典模式是IIS6.0以及以下版本的唯一工作模式(只工作在ISAPI EXTENSION,ISAPI FILTERS下)。在此種模式下asp.net只是一個(gè)分別實(shí)現(xiàn)了ISAPIEXTENSION和ISAPI FILTER的插件(aspnet_isapi.dll,aspnet_filter.dll),IIs的工作只是將特定的請(qǐng)求轉(zhuǎn)發(fā)給Asp.net,與 PHP等等寄宿在IIS中的插件別無(wú)二致。

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的請(qǐng)求管道是緊密集成 的,Asp.net可以完全控制,訪問(wèn)整個(gè)請(qǐng)求管道。Asp.net不在作為一個(gè)外部插件,而是完全集成在IIS中。在此模式下,Asp.net HttpModules與ISAPI Filter擁有等同的控制權(quán),Asp.net HttpHandlers與ISAPI Extension擁有等同控制權(quán),換而言之Asp.net已經(jīng)是IIS的一部分了。

如 果要兼顧IIS6及IIS7,可在web.config中同時(shí)保留httpHandlers(for IIS6)及handlers(for IIS7)里的相同定義,但記得要加上,不然IIS7會(huì)因?yàn)槎x重覆出現(xiàn)而發(fā)生錯(cuò)誤。

更多IIS7報(bào)500.23錯(cuò)誤的原因分析及解決方法相關(guān)文章請(qǐng)關(guān)注PHP中文網(wǎng)!

本站聲明
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費(fèi)脫衣服圖片

Undresser.AI Undress

Undresser.AI Undress

人工智能驅(qū)動(dòng)的應(yīng)用程序,用于創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用于從照片中去除衣服的在線人工智能工具。

Clothoff.io

Clothoff.io

AI脫衣機(jī)

Video Face Swap

Video Face Swap

使用我們完全免費(fèi)的人工智能換臉工具輕松在任何視頻中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費(fèi)的代碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

功能強(qiáng)大的PHP集成開(kāi)發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺(jué)化網(wǎng)頁(yè)開(kāi)發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級(jí)代碼編輯軟件(SublimeText3)

熱門(mén)話題