12.22. Isolating Applications into Pools


You want to isolate an application from other applications so that when the application fails, it won't bring down other applications on the server.


Using a graphical user interface

  1. Create a new application pool for your application (see Recipe 12.19)

  2. Open Internet Information Services (IIS) Manager.

  3. In the left pane, expand the console tree and select the web site (or virtual directory) where your application starting point is defined.

  4. Right-click on the web site (or virtual directory) and select Properties.

  5. Select the Home Directory (or Virtual Directory) tab.

  6. Assign your application to the appropriate application pool and click Apply.

Using a command-line interface

The following command displays the process ID (PID) of all worker processes running on the computer, plus the application pool each worker process is assigned to:

> iisapp

The following command displays the application pool to which the worker process having PID 2765 is assigned:

> iisapp /p 2765

Using VBScript

' This code assigns an application to an app pool.
strComputer = "<ServerName>"
strAppPoolName = "<AppPoolName>"
strApp = "<AppPath>" ' e.g., /W3SVC/1/Root/CGI
' ------ END CONFIGURATION ---------
set objVirtualDir = GetObject("IIS://" & strComputer & strApp)
objVirtualDir.AppPoolId = strAppPoolName
objVirtualDir.SetInfo( )
WScript.Echo "Application " & objApp.Name & _" isolated to App Pool " _
             & strAppPoolName


In previous ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.