0

I had a Windows 2000 server running two web-sites:

Web-site: Newland

IP Address        TCP Port  Host Header Name
================  ========  ================
(all unassigned)  80

Web-site: Matchstick

IP Address        TCP Port  Host Header Name
================  ========  ================
(all unassigned)  80        matchstick.com
(all unassigned)  80        www.matchstick.com
(all unassigned)  80        m.matchstick.com

And all was well. People requesting matchstick.com (or the other two variants) would get the Matchstick web-site. Requests for web-sites by any other name would go to the "default" Newland site.


This morning I changed the router to point to a new Windows Server 2003, rather than a Windows 2000 Server. The two sites on the Windows Server 2003 are configured as:

Web-site: Newland

IP Address        TCP Port  Host Header Name
================  ========  ================
Default           80

Web-site: Matchstick

IP Address        TCP Port  Host Header Name
================  ========  ================
Default           80        matchstick.com
Default           80        www.matchstick.com
Default           80        m.matchstick.com

And all is not right; anyone requesting:

  • matchstick.com
  • www.matchstick.com
  • m.matchstick.com

get the default Newland site, rather than the Matchstick site.

Note: You'll notice that Windows 2000 Server shows "(All unassigned)" as the IP address. Windows Server 2003 shows the word "Default" as the IP address - even though you selected "(All unassigned)"

Windows Server 2003:

enter image description here

Windows 2000 Server:

enter image description here

I presume the bug has something to do with this; since this is the only difference.

How do you configure host-header name resolution on Windows Server 2003 - with fallback to a default site.


Found the problem:

Web-site: Newland

Home Directory: D:\WebSites\Newland

Web-site: Matchstick

Home Directory: D:\WebSites\Newland D:\WebSites\Matchstick

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Ian Boyd
  • 5,131
  • 14
  • 57
  • 79
  • The issue with it showing "Default" when you select "(All Unassigned)" is just semantic. It's still serving up the site on all unassigned IPs. Are you sure that no traffic is routed to the older server? Are the logs on the old Win2000 machine showing any activity? It looks as though you've got this configured correctly. – pk. Mar 28 '11 at 14:12
  • IIS on the older server is stopped. i've added content to the web-sites to prove i'm using the new server. And i added a custom header `X-IsThisTheNewServer: serverfault.com`. In Fiddler i see the request contains the `matchstick` host header name, and the response contains the response header. i even test this locally on the server; adding a `matchstick.com` entry to the hosts file pointing to `127.0.0.1`. – Ian Boyd Mar 28 '11 at 14:36
  • 2
    Do the logs show access to the right or wrong site? And sanity check: are you sure the content folders didn't get backwards-ed? If you type newland or a non-matchstick header in, does it go to the other one, or the same one? – TristanK Mar 28 '11 at 14:40
  • i thought of TristanK's idea which solved the problem. i stopped the "default" web-site, just leaving **matchstick**, and i *still* saw Newland. i checked the physical folder to make sure it had the correct content (it did). Then i happened to notice the files listing in IIS Manager showed the wrong files. Problem: both web-sites pointed to the same physical folder. If your comment were an answer, TristanK, i suppose you would have to get the accept. But technically since my original question is the proper way to configure host-header name resolution: i answered my own question. – Ian Boyd Mar 28 '11 at 15:03
  • So what do i do; do i vote to close my own question since i solved it? Do i put my *i'm an idiot* answer and accept it? Does TristanK put his comment as an answer and accept it? – Ian Boyd Mar 28 '11 at 15:04
  • Yep - put your answer in as the solution. Glad you fixed it! – TristanK Mar 28 '11 at 15:15

1 Answers1

0

Found the problem:

Web-site: Newland

Home Directory: D:\WebSites\Newland

Web-site: Matchstick

Home Directory: D:\WebSites\Newland D:\WebSites\Matchstick

i stopped the "default" web-site, leaving just Matchstick, and i still saw Newland. i checked the physical folder to make sure it had the correct content (it did). Then i happened to notice the files listing in IIS Manager showed the wrong files. Problem: both web-sites pointed to the same physical folder.

Ian Boyd
  • 5,131
  • 14
  • 57
  • 79