I want create a site by command line using appcmd.
How can I associate a specific application pool to site?
To create a site, I write in this way:
appcmd add site /name:"prova" bindings:http://localhost:8080 /physicalPath:c:\sites\prova
In the Connections pane, expand Sites, and then navigate to the Web site or application you want to add to the application pool. In the General section of the Advanced Settings dialog box, click the Application Pool entry, and then click the ellipses button.
Application pools in Internet Information Services (IIS) is a mechanism designed to comprise a group of web applications corresponding to one or more worker processes (w3wp.exe) sharing a common configuration.
You can do this:
APPCMD.exe set app "prova/" /applicationPool:"YOUR_APP_POOL_NAME_HERE"
Note the trailing slash appended to prova
, that's important.
For example if I wish to set the application pool for prova
to the DefaultAppPool
I would issue the following command:
APPCMD.exe set app "prova/" /applicationPool:"DefaultAppPool"
Picking up from Chris's comment below, if you have an existing application in your site, say /mybloggy
and you wish to change application pool it belongs to then you'd issue the following:
APPCMD.exe set app "prova/mybloggy" /applicationPool:"DefaultAppPool"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With