Virtual Hosting With Internet Information Services (IIS)

From the Apache 2.0 documentation:

The term Virtual Host refers to the practice of running more than one web site (such as www.company1.com and www.company2.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

Since most of our customers are running systems with only a single IP address we'll be dealing only with the configuring name based virtual hosts.

This document outlines how to host multiple web sites using the Windows IIS server, a single dynamic IP address, and multiple hostnames in our Dynamic DNS or Custom DNS services.

Configuring

First off, you need a version of IIS which actually supports virtual hosts. Versions of IIS prior to version 5 don't fully support these and we won't deal with those versions here.

Second, you must be running a version of Windows which supports virtual hosts. Windows 2000 Server for instance DOES support virtual hosts but IIS on Windows 2000 Pro does NOT.

For the purposes of the following instructions we're going to assume IIS 6.0.

  1. Open IIS Manager, expand the local computer, right-click on Web Sites and select New:WebSite

  2. Click "Next". In the Description box type the name you have selected for this web site. This is a descriptive name only you will see.

  3. In the Enter the IP address to use for this Web site box, select All Unassigned to allow IIS to respond to all unassigned IP addresses on the server.

  4. The TCP port is assigned to port 80 by default. To use an alternate port number (for instance if your ISP is blocking port 80), in the "TCP port this Web site should use" box, type a new port number.

  5. In the "Host Header for this Web site" box, type the host header name to identify a Web site. For example:

    test1.dyndns.org or example.com
    
  6. Add any additional host headers you want this site to respond for. For example:

    www.test1.dyndns.org or www.example.com
    
  7. In the Path box, type or browse to the path of your Web site home directory.

  8. Click Finish and you are done. Now repeat from step 1 with your second domain/hostname.

  9. Read more. It's not easy to find, but Microsoft does have on-line info on IIS and virtual hosts. At the time I wrote this the following URL contained a number of useful links, including one to the page which was used in putting together these instructions.