Home  >  Article  >  php教程  >  Analysis and solutions to the causes of 500.23 error reported by IIS7

Analysis and solutions to the causes of 500.23 error reported by IIS7

高洛峰
高洛峰Original
2017-01-06 16:21:391740browse

Background: Today there was a function opening exception on the company's terminal, reporting a 500 error. I used Fiddler to find the link, and then opened it in IE, reporting a 500.23 error: ASP.NET not applicable in the integrated hosting pipeline mode was detected. set up. The background is an environment integrated with IIS7 and tomcat7, which is recorded here.

HTTP Error 500.23 - Internal Server Error

An ASP.NET setting that is not applicable in integrated hosting pipeline mode was detected.

Analysis and solutions to the causes of 500.23 error reported by IIS7

Why do the above errors occur?

The application pool in IIS7 has two modes, one is "integrated mode" and the other is "classic mode".

Classic mode is the IIS 6 method we were used to.

If you use integrated mode, you need to modify the configuration file for custom httpModules and httpHandlers, and transfer them to the and sections.

Two solutions:

The first method is to configure the application pool

Configure the application pool on IIS7 and change the mode of the application pool to "Classic" ” and everything went fine after that. As shown in the picture:

Analysis and solutions to the causes of 500.23 error reported by IIS7

I used IIS7. , we try the following solutions:

Second method, modify the web.config configuration file:

Note: web.config path C:\inetpub\wwwroot\web.config

For example, the original settings (you may not have httpModules, httpHandlers nodes in your environment)

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

When the IIS7 application pool is in "integrated mode", change it to:

<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>

(if you If the web.config does not have httpModules or httpHandlers nodes, add directly to the node system.webServer:

<validation validateIntegratedModeConfiguration="false" />

Disable verification of integrated mode to avoid errors

IIS Log location
IIS. The 6.0 Log is stored in:
c:\windows\system32\logfiles\

IIS 7 Log is stored in:
%SystemDrive%\inetpub\logs\LogFiles

After my test, IIS logs are written immediately, and IIS reset is not required.

The logs of IIS 6 and 7 are written to different folders according to different sites. The format of the location folder is "w3svc{siteId}".

In IIS6, the way to view the site ID is to determine the Site ID through the name of the IIS log folder.

In IIS7, in the advanced settings in the IIS manager, the ID in General is the Site ID, and then you need to use this ID to locate which folder in the LogFiles folder belongs to the site you want to view.

The difference between Intergrated and Classic

IIS7 Application Pools has two modes, one is Integrated and the other is classic. If you use Integrated mode, then use custom httpModules and httpHandlers. It’s time to modify the configuration file and move them to the and sections.

##What are the differences between the two modes of IIS7 and IIS6?

#IIS7.0 Integrated mode: The modules and handlers of asp.net are read from and under . The previous The ;httpModules> and configuration sections are ignored, and no error will be generated if disabledvalidation is set.

IIS7.0 Classic mode: Contrary to the above situation, and will be ignored.

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 works with 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.


Classic mode is the only working mode for IIS6.0 and below (only works on ISAPI EXTENSION, ISAPI FILTERS (under). In this mode, asp.net is just a plug-in (aspnet_isapi.dll, aspnet_filter.dll) that implements ISAPI EXTENSION and ISAPI FILTER respectively. The job of IIs is just to forward specific requests to Asp.net and host it with PHP and so on in IIS. The plugins in .

Integrated mode,on the other hand, is a new mode in IIS7 where IIS pipeline is tightly integrated (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 is no longer treated as an external plugin. It's completely blended and integrated in IIS. In this mode, Asp.net HttpModules basically have nearly as much power as an ISAPI filter would have had and Asp.net HttpHandlers can have nearly equivalent capability as an ISAPI extension could have. In this mode, Asp.netis basically a part of IIS.

However, in the integrated mode, the IIS pipeline is tightly integrated with the Asp.net request pipeline. .net has full control and access to the entire request pipeline. Asp.net is no longer an external plug-in, but is fully integrated into IIS. In this mode, Asp.net HttpModules and ISAPI Filter have equal control rights, and Asp.net HttpHandlers and ISAPI Extension have equal control rights. In other words, Asp.net is already part of IIS.

If you want to take into account both IIS6 and IIS7, you can keep the same definitions in httpHandlers (for IIS6) and handlers (for IIS7) in web.config, but remember to add , otherwise IIS7 will cause an error due to repeated definitions.

For more related articles on the cause analysis and solutions of IIS7 reporting 500.23 error, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn