How to properly set bindings in IIS server

21,136

There are two main options to run a multiple web sites on a single server like you have described.

Update: Server Name Indication (SNI) changed support for this, allowing supported browsers/servers to access/host multiple TLS protected sites on one IP using host headers to separate them.

Host Header on one IP

IIS can be configured to look at the host header for an incoming request route it to the correct web site even on a single IP address.

This is done by configuring the site bindings and specifying a host name value for all websites on the same IP address. Your web sites will commonly fail to start or generate errors if you have only some of web sites on the same IP bound to a host header. See http://technet.microsoft.com/en-us/library/cc753195%28v=WS.10%29.aspx for more information.

This method does not work for HTTPS i.e. SSL/TLS encrypted. This is because the protocol itself is an encrypted tunnel between IP addresses that does not parse a host header in the tunnel establishment.

Website on individual IP Addresses

Another approach is to separate each website on a separate IP address. This may not be an option available to you for Internet facing websites because you may not have access to more then one IP address. It is great for intranet websites because you can easily troubleshoot issues from the network layer. This option will also work for HTTPS web sites.

To configure this you would:

  1. Assign an additional IP address to the operating system using network connections and then editing the TCP/IP properties on the network connection. After you have added an addition IP address it will appear in IIS to bind to.
  2. If you have any existing web sites make sure that they are not bound to the same IP address.
  3. Add or edit a site binding to the new IP address. See http://technet.microsoft.com/en-us/library/cc771629.aspx

Hope that helps.

Share:
21,136

Related videos on Youtube

sed
Author by

sed

Updated on September 18, 2022

Comments

  • sed
    sed over 1 year

    I have multiple websites and of course I can't run them all in port 80 so one of my websites is using port 9090.

    I've registered my IP in the domain DNS server and added hostname in the site bindings. But now I can enter my website only like that: http://website.com:9090. How can I make it open correct website by running http://website.com?

    • Bernie White
      Bernie White over 11 years
      What type of web site are you running just static html files or something like WordPress? My question being is the web site outside of IIS only configured to respond to or redirect to a base URL?
    • Bernie White
      Bernie White over 11 years
      Also what happens if you create a new website with a single index.html and access HTTP://website.com/index.html
    • Bernie White
      Bernie White over 11 years
      Has either of these answered your question?
    • Kiquenet
      Kiquenet over 6 years
      How did you get solution? I have the same issue subdomain.domain.com:5000 is ok, but I want subdomain.domain.com for a website in IIS using port 5000.
  • sed
    sed over 11 years
    I did excatly what it said in the documentation. It runs on localhost when I set no host header, and when I set host header it shows 404.
  • Brent Pabst
    Brent Pabst over 11 years
    Are you running everything on port 80 when you setup the host headers? You should be.
  • sed
    sed over 11 years
    Yes, of course. I can give some screenshots displaying my configuration later. Currently I have only one website anyway.