Admin-Ahead Community

Windows => General Windows => Topic started by: mohitht on March 03, 2014, 10:38:42 pm

Title: How to create a site and also change the physical directory in IIS through CLI
Post by: mohitht on March 03, 2014, 10:38:42 pm
Hi All,

We can create a site in IIS using the IIS webserver manger by right clicking and add new sites under the "site" category. This can be done using CLI

first open the command prompt and type the following

Consider lets create a site called mohithtom.com

Code: [Select]
appcmd add site /name:mohith /id:2 /physicalPath: c:\mohith\ /bindings:http/*:80: mohithtom.com
The physical path can be any location but you should give the proper security permissions to the folder so that the users can access the site.



we can change the virtual directory here  using the  command line by

Code: [Select]

Appcmd list vdir <sitename>  /physicalPath:<path>