Use Host-Header Routing to Host Multiple IIS Web Sites

I have been working with Microsoft Internet Information Server (IIS) since very early on and sometimes take for granted some nice features in the current (pre-IIS7) versions.

Much of my work is from the development side of things, creating ASP.NET web sites and web services.  I do get involved in the management of those IIS servers from time-to-time.   One issue that we often face is how to host multiple web sites on the same IIS server.  There are three approaches that work, they are:

1. Separate IP address for each site hosted – this works but requires you to use a precious IP address that your hosting company may not want to give out.

2. Use different TCP port – since normal HTTP traffic uses port 80 there is nothing saying you can host your web site on a different port, say 8080.  The drawback to this is yoursite.com:8080 may have it’s port blocked by the firewall you are behind and it’s not a common port so your users may have a hard time finding it.

3. The best way, in my opinion is to use what is called Host-Header Routing, which is part of the HTTP 1.1 specification.  Host-Header Routing is simply using a single IP address in your IIS configuration for all of your web sites but differ them in the configuration by indicating their host name.

You can access this information by going to Internet Information Services and right-clicking on your website and choose Properties and go to the Web Site tab and click the Advanced button and see a screen like below:

IISAdvanced

Choose the Edit button which will reveal a dialog like this:

IISHostHeader

Simply enter your host like “www.microsoft.com” into the Host Header Name field and select OK.  You can now do the same thing for additional web sites using the (All Unassigned) IP Address but vary the Host Header Name.   This will save your IP addresses and is an nice way to host multiple web sites.

The only caveat is the browser needs to support HTTP 1.1, which almost all do today.

Technorati Tags: , ,

Advertisements

One response to “Use Host-Header Routing to Host Multiple IIS Web Sites

  1. Pingback: Ghillie Suits » Use Host-Header Routing to Host Multiple IIS Web Sites

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s