Recipe 12.19. Creating Application PoolsProblemYou want to create a new application pool. SolutionUsing a graphical user interface
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 DiscussionApplication 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 AlsoRecipe 12.22 |