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

15,037

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).

Share:
15,037

Related videos on Youtube

Jerad Rose
Author by

Jerad Rose

C#, MVC, and React web developer. Developer at Kaggle. Founder of Animal Crossing Community. My Stack Overflow resume.

Updated on September 18, 2022

Comments

  • Jerad Rose
    Jerad Rose over 1 year

    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.

    • Jerad Rose
      Jerad Rose almost 11 years
      Why would this get down voted having shown so much troubleshooting effort and having given so much details? Does it not belong here?
  • Jerad Rose
    Jerad Rose almost 11 years
    Thanks Falcon, I figured out what I did. I was afraid it would be something silly, but my pride was hoping it was something more complicated. Ended up being something silly. When setting up my hosts file, my brain saw the sample IP (127.0.0.1) and used the "127" part, when the actual server IP was 192.168.1.125. I think I would have realized it wasn't hitting the server at all, except for the fact that browsing the IP (the *correct IP) failed when shutting the site down/pulling the network cable. I never noticed the discrepancy in 127 & 192. :(