The primary function of the Internet Information Server (IIS) is to host Web based applications, such as ASP.NET. If you have to set your IIS 7 to host such an application, there are several terms you need to know and a procedure you have to follow. We will focus on them in this article.
In summary, with IIS 7, end users connect to an application by querying a site. Each site listens for clients’ requests through its bindings to virtual directories. Furthermore, each site is associated with a default, or root application, and one site may host many applications. Each application is also associated with an application pool. For each application pool there is at least one Worker Process (w3wp) and one application can be served by many Worker Processes (in a web garden). Now we’ll explain all of these terms one by one.
Virtual directories are paths in IIS that map to a physical location that stores files used by the application. Each application has at least one virtual directory, but creating more directories can be useful if you wish to use files outside of the default directory.
Bindings are combinations of sites and protocols on which they can serve requests. By default, IIS 7 supports bindings on ports 80 (HTTP) and 443 (HTTPS). However, you can also set custom ports for your applications.
Application pools are a security feature of IIS 7 allowing the separation of the applications. It allows an application in one pool to continue working in case an application from another pool fails. By isolating an application in one pool, you also can prevent it from accessing another application’s resources. Furthermore, you can enhance your server’s performance by assigning the most resource-consuming applications to their own application pools. This way, the performance of the other applications on the server won’t be affected.
Worker Process is a Windows process (w3wp.exe), which is responsible for handling web requests for a specific application pool. All the features of your ASP.NET applications are accessible through the use of the worker processes.
We call a web garden the situation when several worker processes are responsible for the same application pool. In this scenario, the load of the application is spread amongst multiple worker processes, and in the case of a single worker process failure, the remaining ones can continue to service application requests.
Now that we know all the terms, let’s focus on the process of deploying an ASP.NET application with IIS 7. The high-level steps are as follows:
1) Publish the application from Visual Studio
2) Copy the application to the default application folder (c:\intepub\wwwroot)
3) Right-click the application’s folder in IIS Manager and click “ConvertToApplication”
4) Set an application pool in the Application Pools node.
5) Apply the pool to your application by right-clicking its node in the IIS Manager -> Manage Application -> Advanced Settings -> Application Pool
6) Set the maximum number of Worker processes in the application pool if you intend to use web garden. You can do this by right-clicking the pool -> Advanced Settings -> Process Model -> Maximum Worker Processes.
Once you’ve deployed your application, it’s a good idea for you to monitor the IIS server for issues. You can do that easily with Monitis. Find out how here: http://www.monitis.com/blog/2011/06/25/monitoring-iis-with-vbscript-via-monitis/.