-1

Why does navigation to localhost not work on Windows Server 2008 R2? The expected result is the IIS application hosted on the machine in question to be returned. Navigation to localhost/mySite returns a 404 however using machineName/mySite returns the application as expected.

Is there a way to fix this to allow localhost to properly work?

What has already been attempted to no avail, modifying the registry:

setting DWORD: DisableLoopbackCheck 1 at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

Chris Marisic
  • 1,404
  • 8
  • 33
  • 51
  • What do you mean it does not work? t works on my stock installed iwndows servers. – TomTom Dec 01 '11 at 17:16
  • do you have IE ESC turned on for your account? – Top__Hat Dec 01 '11 at 17:18
  • @ChrisMarisic If you have a problem, [meta] is the place to discuss it. Not comments. – MDMarra Dec 01 '11 at 18:42
  • IE ESC means Enhanced Security Configuration. What's IE SEC? – TristanK Dec 03 '11 at 03:49
  • Your description of how it doesn't work should ideally include: What you're trying to do; what the response is (you don't have a symptom listed right now); the program you're trying to do it in; what the server program you're using is; what you've tried (which you have in there); and any other relevant information; there's not a lot to go on here. Incidentally, Win2K8+ tends to go IPV6 first, so if there's no binding for ::1 (IPV6 localhost), that can be a problem. You've described authentication-related settings, but haven't demonstrated an authentication-related symptom. More info = better. – TristanK Dec 03 '11 at 03:54

2 Answers2

3

By default, this is not blocked. Chances are you haven't enabled the exception for IIS in Windows Firewall. To test, you can disable the firewall all together. If that works, you should re enable it and then enable just the necessary rules.


Update: Reading your comment, it seems that what I mentioned above isn't the problem. If 127.0.0.1 works in the browser and localhost does not, chances are something (someone?) borked your default HOSTS file. Make sure that 127.0.0.1 localhost is in there. There's nothing magic about the word "localhost". It's just an entry in the default HOSTS file that points to 127.0.0.1.

MDMarra
  • 100,183
  • 32
  • 195
  • 326
  • This answer is not relevant to my question, will downvote soon. – Chris Marisic Dec 01 '11 at 17:29
  • What exactly isn't relevant? It was entirely relevant, given the scant amount of detail in your original question. I then updated it when you commented on your own question with more details. Downvotes should be for wrong or misleading answers. Not for answers that make an attempt to answer a vague/incomplete question. – MDMarra Dec 01 '11 at 17:34
  • The firewall answer makes no sense, and your edit occurred after my initial comment. – Chris Marisic Dec 01 '11 at 17:37
  • 2
    Machinename/site works, localhost/site doesn't...are you only binding to a particular IP address and not listening to 0.0.0.0 or 127.*? – Bart Silverstrim Dec 01 '11 at 17:39
  • If 127.0.0.1/site works but localhost/site doesn't, your name resolution could be screwed up. If neither works but machinename/site works, it could be server application binding to a particular interface. – Bart Silverstrim Dec 01 '11 at 17:40
  • 2
    @ChrisMarisic It makes perfect sense. In your original question you didn't state that you could connect in any way. Logically, most people test using localhost before making DNS entries, so it's safe to assume (since you didn't say otherwise) that you couldn't connect at all. Then, when you commented that you could get there using the hostname, I edited my answer to make sure that your localhost-to-loopback mapping was happening properly, which is a valid suggestion given your problem. You might want to read [ask]. It outlines why detailed questions are important to getting good answers. – MDMarra Dec 01 '11 at 17:45
  • This answer still has nothing to do with this question – Chris Marisic Apr 07 '15 at 16:36
2

Windows Server 2008 R2 with IIS 7.5 does not appear to add an IIS binding to localhost by default. You need to explicitly add a binding for localhost. For information on adding a binding to IIS see http://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding

Choosing to not add the binding you must access the site via machineName/siteName or any other configured binding such as www.contoso.com even when local.

Chris Marisic
  • 1,404
  • 8
  • 33
  • 51