Configuring IIS bindings

By default, web servers operate on port 80 and only service a single website. However, often times there is a need to host multiple websites on the same server and use different IP addresses, IP ports, or even names to differentiate between the sites.

This recipe will show how to set up multiple websites on the same server using different forms of web bindings.

How to do it...

Carry out the following steps to configure IIS bindings:

  1. Create a new website using a unique IP address
    New-Website -PhysicalPath C:\inetpub\IPBinding -Name IPBinding -IPAddress 10.10.10.250

    When finished, PowerShell will return information about the site and binding.

  2. Create a new website using a unique TCP port:
    New-Website -PhysicalPath C:\inetpub\PortBinding ...

Get Windows Server 2012 Automation with PowerShell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.