Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Associate an application pool to site with appcmd

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 
like image 717
JAEP Avatar asked Dec 17 '10 13:12

JAEP


People also ask

How do you add a site to application pool?

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.

What is an application pool?

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.


1 Answers

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"

like image 151
Kev Avatar answered Sep 28 '22 13:09

Kev