Details of sites, applications, and virtual directories in IIS7

Source: Internet
Author: User

This is not about how to solve the problem of path rewriting or how to configure, but rather to explain the concept and role of site, application (application) and virtual directory (VM), and the similarities and differences between these three things in IIS6 and IIS7. Because sites, applications, and virtual directories are sure to be encountered when we build websites on IIS, their concepts are so vague (at least for me). I found some information on the internet to learn, one of the more detailed is written: Understanding Sites, Applications, and Virtual directories on IIS 7 and here is just a summary.

In IIS6, the probabilities of applications and virtual directories are somewhat ambiguous, and above IIS7, the three are normalized, defining the hierarchical relationships of the three at the IIS architecture level.

In IIS6, although there are two concepts of virtual directory and application, and it seems that these two concepts are independent, in IIS6 a application is actually a virtual directory, but a Application in the medabase can be AppFriendlyName, AppRoot, appisolated, AppPoolId these several properties to be set. However, the site in IIS6 is an exception, because even if the properties are not set, it is not considered a virtual directory, but is treated as a application.

And at IIS7 or above (but the highest version of IIS I can reach today is the IIS7.5 in Win7), the concept of site,application and virtual directory has been regulated and is not as vague as IIS6. In iis7+, they are independent and present a hierarchical relationship to the IIS organization architecture: one or more application in a site, one or more virtual directory in a application, A virtual directory corresponds to a physical path. A site by default will have at least one application, called the root application (root application) or default application (defaults application), and a application has at least one vitual The director, called the root virtual directory (root directory), looks at the structure of my IIS7.5 previous site and how this site's ApplicationHost.config file in IIS corresponds. :

 Note: The applicationhost.config file is in the directory: \%windir%\system\inetsrv\config directory

There are only two site,site in my IIS with an ID of 13 application CD and DH respectively. From the right of the config can be seen, in fact, in addition to CD and DH two application, the site itself is a application, that is, root application. You can also see that under each application, there is a virtual directory, root virtual directory, which acts as the root directory for this application and maps to the physical path where the application resides. Of course, each application can have multiple virtual directory, which can correspond to other physical paths (such as DH The physical path of the image virtual directory under application can cause a shared directory for another computer on the network)

In the iis7+ (in fact, IIS6 is the same, but the details are different, here is a bit vague, but also for further research ), a site running in a application pool, and a application Pool has a w3wp.exe (worker process) by default, and the application in the site runs in the app domain (application domains) in this w3wp.exe process (different application runs in different app fields, For isolation), while the same application virtual directory runs under the same app domain. But the site under the application do not necessarily have to run with this site in the same application pool,application can specify a different application pool with this application site.

The next step is to explain site,application and virtual derectory independently.

Sites (site)

A site contains one or more application and one or more virtual directories. We can access the site in different ways by making different bindings to the site. The "bindings" here contain two aspects, one is the binding protocol and the other is the binding information. The binding protocol is used to specify what protocol to use to communicate with the site. iis7+, the protocol to a site can include http,https,net.tcp,net.pipe,net.msmq,net.formatname. Of course, for a website, the most common is HTTP and HTTPS. The binding information defines the basic information of the communication, such as the IP address, communication port, and some header information of the site. As mentioned earlier, you can add more than one binding to a site, and you only need to edit the binding action on a site in IIS.

Applications (application)

Application is the basic unit that provides functionality for a site, such as a shopping site that can contain two application: one is responsible for presenting the product, buying it for the consumer, and putting it into the shopping cart, while the other appliation can focus on the user's login and payment business. When a site has only one application time, this application is the root application or default application, which represents the site itself, in the ApplicationHost " <application path= "/" > ", path="/"means that the application is the root application of the site.

Application runs in an application pool in IIS and is isolated from app domain. Application can run in any application pool in IIS, not necessarily in the application pool at the site where the application resides, However, for application developed with managed code, such as an ASP. NET Web site, you must run an application pool that is running on. You can set the application pool in IIS, including settings. NET version (or an unmanaged environment), as well as setting up the pipeline mode.

Virtual directory (Vsan)

A virtual directory is a mapping name on a local computer or a physical directory path on a remote computer on a site (actually application). A application can have at least one virtual directory. In ApplicationHost "<virtualdirectorypath="/">", path= "/" means that the virtual directory is the application (or the site) The root virtual directory.

When a virtual path is mapped to a physical path, the directory name in the physical path becomes part of the URL of this site (or application). A site (application) can have multiple virtual directories, for example, a virtual directory "Www.site.com/script" in a site that maps to a script folder in that site on the local computer, and "Www.site.com/image" is mapped to an image folder on the remote picture server. iis7+ uses the Web. config configuration file under the directory path directory of the virtual directory map to manage the virtual directory and its subdirectories (available in ApplicationHost.config sites/ Use the allowsubdirconfig= "false" property in the Virtualdirectorydefaults section to turn off control of the Web. config subdirectory. )

Detailed description of sites, applications, and virtual directories in IIS7 (GO)

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.