Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
What do you mean it does not work? t works on my stock installed iwndows servers. –  TomTom Dec 1 '11 at 17:16
    
do you have IE ESC turned on for your account? –  Top__Hat Dec 1 '11 at 17:18
    
@ChrisMarisic If you have a problem, Meta Server Fault is the place to discuss it. Not comments. –  MDMarra Dec 1 '11 at 18:42
    
IE ESC means Enhanced Security Configuration. What's IE SEC? –  TristanK Dec 3 '11 at 3: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 3 '11 at 3:54

2 Answers 2

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.

share|improve this answer
    
This answer is not relevant to my question, will downvote soon. –  Chris Marisic Dec 1 '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 1 '11 at 17:34
    
The firewall answer makes no sense, and your edit occurred after my initial comment. –  Chris Marisic Dec 1 '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 1 '11 at 17:39
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 How to Ask. It outlines why detailed questions are important to getting good answers. –  MDMarra Dec 1 '11 at 17:45
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.