Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to create a site and also change the physical directory in IIS through CLI  (Read 2782 times)

0 Members and 1 Guest are viewing this topic.

mohitht

  • Guest
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>