Recipe12.19.Creating Application Pools


Recipe 12.19. Creating Application Pools

Problem

You want to create a new application pool.

Solution

Using a graphical user interface

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the server node in the console tree and select Application Pools.

  3. Right-click on Application Pools and select New

    Type a descriptive name for the new pool.

  4. Choose whether to use an existing pool as a template (select the existing pool whose configuration settings you want to copy) or leave the configuration settings for the new pool at their default values.

  5. Click OK to create the new pool.

Using VBScript
' This code creates an app pool. ' ------ SCRIPT CONFIGURATION ------ strComputer = "<ServerName>" strAppPoolName = "<AppPoolName>" ' ------ END CONFIGURATION ---------     set objAppPools = GetObject("IIS://" & strComputer & "/w3svc/AppPools") set objNewAppPool = objAppPools.Create("IIsApplicationPool", strAppPoolName)     ' Recycle this app pool every 2,000 requests  objNewAppPool.AppPoolRecycleRequests = True  objNewAppPool.PeriodicRestartRequests = 2000     ' Run this app pool as NETWORK SERVICE (just like the default app pool)  objNewAppPool.AppPoolIdentityType = 2     ' Save new app pool objNewAppPool.SetInfo( )     WScript.Echo "App Pool created successfully: " & objNewAppPool.Name

Discussion

Application pools are used to assign worker processes for dynamic applications running on IIS. An application pool can have one or more worker processes servicing one or more applications assigned to that pool, and if multiple worker processes service the pool, the pool is called a web garden. When IIS is installed, a Default Application Pool is created, and if you create a new application (see Recipe 12.21) it is automatically added to the default pool. By right-clicking on the pool, you can stop and start it, recycle worker processes associated with the pool, configure the settings for the pool, or save its configuration.

Application pools are generally created to isolate applications along process boundaries. That way, if an application in one pool fails, applications running in different pools are unaffected. Note that IIS must be running in worker process isolation mode in order to create and use application pools (IIS 5.0 isolation mode does not support application pools).

See Also

Recipe 12.22



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net