Iis – New sites on new Windows 2012 Server (IIS 8) returns 404 from Windows 7

iisiis-8windows-server-2008windows-server-2012

I have a brand new install of Windows 2012 Server, and trying to set up a simple web site. I'm able to hit the default web site (returns the IIS 8 home page) using the IP address. But I'm getting a 404 on a newly created site containing a single .html page.

Here are the steps I took on the server:
1) Create a new site (leave all default settings, except:)
2) Set host name (header) to "test" (leave IP at *, port at 80)
3) Set physical path to wwwroot\test
4) Create a single index.html file under wwwroot\test

Here are the steps I took on my client (Windows 7 Pro):
1) Update hosts file to point "test" to server IP (verify through ping of "test" that it resolves to right IP)
2) Browse to test/index.html

The response:

Not Found


HTTP Error 404. The requested resource is not found.

Additional Clues:

  • I checked the logs, and no activity is getting logged for "test" — all I see are logs for the default site requests.
  • If I stop the default site and just browse to the IP, I get the same 404.
  • If I stop both sites and browse to the IP, I get a connection timeout.
  • If I stop both sites and browse to "test", I get the same 404.
  • Inspecting the "test" (404) request through Fiddler, the headers are:

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 22 Jun 2013 04:39:10 GMT
Connection: close
Content-Length: 315

  • Inspecting the default site (200) request through Fiddler, the headers are:

HTTP/1.1 200 OK
Content-Type: text/html
Content-Encoding: gzip
Last-Modified: Sat, 22 Jun 2013 02:45:45 GMT
Accept-Ranges: bytes
ETag: "3b69f897f26ece1:0"
Vary: Accept-Encoding
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Date: Sat, 22 Jun 2013 04:58:31 GMT
Content-Length: 820

Further, after pulling the network cable on the server:

  • Pinging "test" still responds and resolves to the server's IP (127.168.1.125)
  • Checking my router, I confirmed that 127.168.1.125 was mapped to the new web server
  • Browsing to the default site continues to time out
  • Browsing to "test" still gives me the 404
  • Inspecting the request IP in Fiddler confirms that requests to "test" are resolving to the right IP (127.168.1.125)

It seems, based on the results after pulling the network cable that it's not an issue w/ the server (same thing happens whether or not cable is plugged in), but based on the Fiddler results, the client is doing everything it's supposed to do (routing to the right IP, and still getting a 404 even when it's not connected).

There are so many things going inexplicably wrong:
– Why am I getting a 404 on "test" even when the cable is unplugged?
– Why is my ping responding even when the cable is unplugged?
– Where is the 404 even coming from, if the server is not serving it?
– Why does browsing to the IP when the default site is shut down give me a 404?

I don't know what else to troubleshoot at this point. And the more I troubleshoot and try to rule things in/out, the muddier the waters get.

I never would have imagined getting a simple site with a single html page on a brand new server install would give me so much trouble.

Best Answer

127.168.1.125 is a loopback address (along with all of 127.0.0.0/8). This IP isn't in an RFC1918 (private) range; only 172.16.0.0/12, 192.168.0.0/16 and 10.0.0.0/8 should be used for this purpose. RFC1700 specifically prohibits the 127.0.0.0/8 subnet from being used for communication between different hosts.

Most likely, the server you are talking to is actually whatever you are browsing from, though this needn't be the case.

Because of your test with the network cable unplugging, I can tell that you're contacting something other than your intended server. You should renumber your test network to use a private range to avoid confusing things, and your troubles will likely be gone.

If somehow your environment already uses all the available RFC1918 IP addresses, you can also use 169.254.0.0/24 and 169.254.255.0/24, which are APIPA (autoconfiguration) ranges reserved for use by statically numbered hosts (eg. no workstation will ever choose numbers in those ranges).