IIS application initialization setup srcipt

cd C:/windows/system32/inetsrv

set Arr[0]=NathanTesting


set "x=0"

:SymLoop
if defined Arr[%x%] (
call    appcmd set apppool "%%Arr[%x%]%%" /autoStart:true /startMode:AlwaysRunning /processModel.idleTimeout:00:00:00
call    appcmd set site "%%Arr[%x%]%%" /serverAutoStart:true
call    appcmd list apps /site.name:"%%Arr[%x%]%%" /xml |appcmd set app /in /preloadEnabled:true
call    appcmd set config -section:system.applicationHost/sites "/[name='%%Arr[%x%]%%'].applicationDefaults.preLoadEnabled:true" /commit:apphost
    set /a "x+=1"
    GOTO :SymLoop
)


上面會做:
  1. Set Application Pool autoStart = true, startMode = AlwaysRunning, IdleTimeout = 0
  2. Set Site serverAutoStart = true
  3. Set EVERY application within the site to preloadEnabled = true
  4. Set applicationDefaults.preLoadEnabled of site to true

留言

這個網誌中的熱門文章

msdeploy include ApplicationPool setting and ignore recycle time

Invoke generic method