Change an Application Pool for a Site (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

When you create a site, you must select an application pool in which the site's root application can run. If you have to change the application pool later, you can change the site properties. For example, you may discover a site that uses many resources and that adversely affects other sites in the application pool. You can move the site to its own application pool to prevent it from affecting the other sites.

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Sites Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To change an application pool for a site

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To use the UI

  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

  2. In the Connections pane, expand the Sites node in the tree, and then click to select a site for which you want to change the application pool.

  3. In the Actions pane, click Basic Settings to open the Edit Site dialog box.

  4. Click Select to open the Select Application Pool dialog box, and then select an application pool from the Application pool list and click OK.

  5. In the Edit Site dialog box, click OK.

Command Line

To change the application pool for a site, use the following syntax:

**appcmd set site /site.name:**string **/[path='string'].applicationPool:**string

The variable site.name string is the name of the site for which you want to change the application pool. The variable path string is the path of the application that will run in the application pool, such as / for the root application in a site or **/**application_name for other applications in a site. The variable applicationPool string is the name of the application pool in which you want the application to run. For example, to configure the root application in a site named contoso to run in an application pool named marketing, type the following at the command prompt, and then press ENTER:

appcmd set site /site.name:contoso /[path='/'].applicationPool:marketing

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:

<application> under <site> element

For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • SiteContainsApplication class

  • Application.ApplicationPool property

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Concepts

Managing Sites in IIS 7 Managing Application Pools in IIS 7