IIS 8 and IIS 8.5 Create a Website from Command Line
Very busy at the moment with a new job but I do have tons of articles to upload. Just a quick one to start with. In Internet Information Servers (IIS) 8.0 (Server 2012) and 8.5 (Server 2012R2), if you need to quickly make a website via command line the you can with the syntax below. First the syntax then the explanation, we first install IIS 8.0 or 8.5 from command line with all features.
Install-WindowsFeature Web-Server -IncludeManagementTools –IncludeAllSubFeature
Then create the site;
Appcmd add site /name:MyLovelyNewWebsite /id:10 /physcialPath: c:\MyLovelyWebsite /bindings:http:/*80:MyLovelyWebsite.com
The syntax above will create a new website called www.mylovelywebsite.com.
/Name: Is a friendly name to store in IIS so you can identify the website.
/ID: is as it says an ID number for the site.
/PhysicalPath: is the location where the website files will be stored.
/Bindings: relates the the protocol used, if you want to use non secure then its http and/*80 :and if you require a secure site then its https:/443: followed by the name of the website.
Simply upload the website to the physical folder with the index.htm or html and point your firewall port (80 or 80 and 443) and the website is ready.