Tuesday, November 11, 2008

Host Headers on IIS 6 - nice guide

 

http://www.4guysfromrolla.com/webtech/080200-1.shtml

 

In the aforementioned article the author explains how to create an ASP page that will check for the domain name requested by the client and automatically send the client the correct page for that site. This will all work just fine but in my opinion it is slow and more difficult to administer than "Host Header Names."

Host Header Names are a feature of Microsoft Internet Information Server (versions 4 and 5, I’m unsure about earlier versions) that allows you to operate multiple domains from one I.P address. As far as I can tell, using IIS to run more than one domain name from a machine with a single I.P address will work in much the same way as the ASP based solution except that the server does all the work for you.

Below is a screenshot of the Host Header Name configuration window as it appears in the Internet Services Manager. (We are using Windows 2000 Advanced Server so the screenshots may differ slightly from your system)

The column on the left is for your I.P address, since I only have one address, and that address is subject to change, I use (All Unassigned), the second column is your Port number and the third all-important column is for your Host header Name. This is the name that people will have typed into their web browser in order to access your site. In the example, the Host Header Name in use is after12.sale.net. This is a test website running over our intranet but the host header names function just the same way. If I type http://after12.sale.net in to my browser, the site comes up, even though my machine has only one I.P address.

If your site is on the Internet, you may use a Host header Name similar to this: www.mysitename.com

Here are a bunch of sites on this machine and their associated host header names:

To access the Host Header Name options, do the following:

  • In the Internet Services Manager, Right click on one of your sites and choose "properties" from the pop-up menu.
  • In the "Website Identification Area" of that page click on the "Advanced" button.
  • Now select your site in the "Multiple Identities For This Website" area of the page and click on the "Edit" button.
  • In the edit window type your chosen Host Header Name into the appropriate box and click OK.
  • Click OK on the other open options windows to close them all and save your new settings.

That's about all there is to it, although in order for you to run this on a single machine you must have some kind of DNS system up and running although you do not need a real (internet registered) domain name.

Happy Programming!

 

 

At the Datamail Group we value teamwork, respect, achievement, client focus, and courage.  This email with any attachments is confidential and may be subject to legal privilege.   If it is not intended for you please advise by replying immediately, destroy it and do not  copy, disclose or use it in any way.  The Datamail Group, through our GoGreen programme, is committed to environmental sustainability.   Help us in our efforts by not printing this email. __________________________________________________________________   This email has been scanned by the DMZGlobal Business Quality               Electronic Messaging Suite. Please see http://www.dmzglobal.com/dmzmessaging.htm for details. __________________________________________________________________  

No comments: