IIS 5.x/ 6.0/7.0 and ASP. NET, 5.xasp.net

Source: Internet
Author: User
Tags metabase

IIS 5.x/ 6.0/7.0 and ASP. NET, 5.xasp.net

 

This article describes the different processing methods for Web requests of the three major IIS versions.

Content
  • IIS 5.x and ASP. NET
  • IIS 6.0 and ASP. NET
  • IIS 7.0 and ASP. NET
  • ASP. NET Integration
IIS 5.x and ASP. NET

How does IIS 5.x process ASP. NET Resources (such as. aspx and. asmx) requests.

IIS 5.x runs in the process inetinfo.exe, which hosts a Windows Service named World Wide Web Hing Service (W3SVC. W3SVC provides the following functions: HTTP request listening, working process, and configuration management (by loading configuration information from metabase.

Resource ing is stored in metabase of IIS. During installation, ASP. NET modifies IIS metabase to ensure that aspnet_isapi.dll can process all resources identified by extension.

Figure 1 IIS 5.x and ASP. NET

When an HTTP request for a resource arrives, IIS first determines the resource type based on the extension. If static resources (such as text files, HTML pages, ASP pages without scripts) are used and external modules are not used, IIS directly processes them and directly returns the content in the form of an HTTP response; otherwise, dynamic resources (such. aspx ,. asp ,. by using the extension, you can find the corresponding ISAPI Dynamic Link Library from the IIS Script ing (Script Map.

 

ISAPI (Internet Server Application Programming Interface) is a set of local Win32 APIs. It is a link between IIS and other dynamic Web applications or platforms. ISAPI is defined in a dynamic link library (DLL) file. The DLL file corresponding to ASP. net isapi is aspnet_isapi.dll. ISAPI supports ISAPI Extension and ISAPI Filter. The former is an interface that truly processes HTTP requests, the latter can view, modify, forward, or reject HTTP requests before they are actually processed. For example, IIS can use ISAPI Filtering for request verification.

The ISAPI extension does not process the. aspx file, but serves as a scheduler. It collects all relevant information about the called URL and underlying resources, and then forwards the request to the ASP. NET workflow.

If the request is based on ASP. NET resource type ,. asp is asp. dll ISAPI extension for processing ,. aspx is assigned to the ISAPI extension of aspnet_isapi.dll, while ASP. NET Extension will create ASP. NET working process (if the process is not started ). For IIS 5.x, the working process is aspnet_wp.exe. The IIS process (aspnet_isapi.dll) communicates with the working process (aspnet_wp.exe) through the Named pipe (Named Pipes.

 

ASP. NET worker process indicates ASP. NET Runtime Library environment, composed of a Win32 unmanaged executable file named aspnet_wp.exe, which is hosted on. NET Common Language Runtime Library (CLR ). The ASP. NET workflow activates the HTTP pipeline and processes page requests. The HTTP pipeline is a set of. NET Framework classes. It is responsible for compiling page assembly and instantiating related page classes.

During Worker Process initialization,. net clr is loaded and a managed environment is built. For the first request of a Web Application, CLR will create an Application Domain for it ). In the application domain, HTTP Runtime is loaded and Corresponding applications are created. All Web applications hosted on IIS 5.x run in different application domains of the same job (aspnet_wp.exe.

IIS 6.0 and ASP. NET

IIS 5.x has at least two shortcomings:

  • 1. isapi is redirected to inetinfo.exe, and the process and the job process aspnet_wp.exe are a typical cross-process communication method. Although named pipelines are used, there are still performance bottlenecks;
  • 2. All Web applications run in different application domains in the same process (aspnet_wp.exe. Isolation Based on application domains cannot fundamentally resolve the impact of one application on another.

To solve the first problem, IIS 6.0 directly loads the ISAPI Dynamic Link Library to the working process;

To solve the second problem, the Application Pool mechanism is introduced. You can create an application pool for one or more Web applications. Because each application pool corresponds to an independent working process, it provides process-based isolation level for Web applications running in different application pools. The IIS 6.0 workflow name is w3wp.exe.

In addition to the above two improvements, IIS 6.0 also has some commendable points. The most important thing is to create an HTTP listener named HTTP. SYS. HTTP. SYS runs as a driver in Windows kernel Mode. It is part of the TCP/IP network subsystem of Windows 2003, in terms of structure, it belongs to a network driver on TCP.

Strictly speaking, HTTP. SYS is no longer in the scope of IIS, so the configuration information of HTTP. SYS is not stored in Metabase of IIS, but defined in the registry. The benefits of HTTP. SYS are as follows:

  • 1. continuous listening. HTTP. SYS is a network driver that is always running and responds to users' HTTP requests in a timely manner;
  • 2. Better stability. HTTP. SYS runs in the operating system kernel mode and does not execute any user code. Therefore, it is not affected by Web applications, working processes, and IIS processes;
  • 3. data cache in kernel mode. If a resource is frequently requested, HTTP. SYS caches the Response Memory and the cached content can directly respond to subsequent requests. Because this is a cache based on the kernel mode, there is no switch between the kernel mode and the user mode, and the response speed will be greatly improved.

Figure 2 describes the structure of IIS and the process for processing HTTP requests. Unlike IIS 5.x, W3SVC is detached from the inetinfo.exe process (for IIS 6.0, inetinfo.exe can basically be seen as a pure IIS management process and runs in another process svchost.exe. The basic functions of W3SVC have not changed, but are improved accordingly. Like IIS 5.x, Metabase still exists in the inetinfo.exe process.

Figure 2 IIS 6.0 and ASP. NET

When HTTP. when SYS listens to an HTTP request, it distributes the request to W3SVC. W3SVC parses the request URL and obtains the target application based on the ing relationship between the URL obtained from Metabase and the Web application, and obtain the application pool or worker process that the target application runs. If the worker process does not exist (not created or recycled), a new worker process is created for the request. During the initialization process, the corresponding ISAPI Dynamic Link Library is loaded. For ASP. NET applications, the loaded ISAPI is aspnet_iaspi.dll. ASP. net isapi is responsible for CLR loading, application domain creation, and Web application initialization.

Figure 3 how to handle Web applications in IIS 6.0

IIS 7.0 and ASP. NET

IIS 7.0 has improved the request listening and distribution mechanism. Windows Process Activation Service (WAS) is introduced, and some functions of IIS 6.0 W3SVC are diverted to WAS. IIS 6.0 W3SVC has three main functions:

  • 1. Receive HTTP requests. Receives HTTP requests listened to by HTTP. SYS;
  • 2. Configuration Management. Load configuration information from Metabase to configure related components;
  • 3. process management. Create, recycle, and monitor processes.

IIS 7.0 implements the last two features into WAS. The introduction of WAS provides non-HTTP support for IIS 7.0. WAS abstracts different protocol listeners through the Listener Adapter Interface (Listener Adapter Interface), such as TCP listeners, named pipe listeners, and MSMQ listeners.

Figure 4 shows the overall structure of IIS 7.0 and the entire request processing process. Whether it is an HTTP request received from W3SVC or a request received through the WCF listener adapter, it will eventually be passed to WAS. If the corresponding Worker Process (or application pool) has not been created, it is created; otherwise, the request is distributed to the corresponding Worker Process for subsequent processing. During request processing, WAS loads the relevant configuration information through the built-in configuration management module and configures the relevant information. Unlike the Metabase-based storage of configuration information in IIS 5.x and IIS 6.0, most of the configuration information in IIS 7.0 is stored in XML files, and basic configuration is stored in Applicationhost. config.

Figure 4 IIS 7.0 and ASP. NET

ASP. NET Integration

IIS 5.x and IIS 6.0, IIS and ASP. NET are two independent pipelines. Within their respective scopes, they have their own mechanisms to process HTTP requests. The two pipelines are connected through the ISAPI. IIS is the first method to handle HTTP requests in the early stage. For example, for identity authentication, requests are distributed to ASP. NET pipelines through ISAPI. After ASP. NET completes processing the HTTP request, the processed result is returned to IIS, and IIS performs post-processing on it, such as logging and compression, to generate an HTTP response.

However, the dual-Pipeline Design of IIS 5.x and IIS 6.0 has some limitations and shortcomings.

Therefore, IIS 7.0 integrates the two.


An error occurred while migrating the ASPnet application from IIS60 to IIS70.

It should not be about IIS, but it is mainly about your code.

Why can't I browse * asp files after setting directories in iis 60?

Iis 6.0, it must be WIN2003. You may not have the permission set, or ASP running is not checked in IIS.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.