Accessing localhost on Vista/Windows 7
After installing WAMP on Windows Vista we came across a problem where we cannot access the default website using http://localhost – The name just doesn’t seem to resolve.
For some reason in Vista and Windows 7 localhost doesn’t work out of the box. To get it working you have to add this line to the c:\windows\system32\drivers\etc\hosts file:
127.0.0.1 locahost
Now the hosts file is a Windows system file so the only way Windows will allow you to edit the file is if you do it as Administrator. To do this click Start and type CMD in the search box, when Windows shows cmd.exe right-click it and click run as administrator then when the DOS box opens type:
edit c:\windows\system32\drivers\etc\hosts
Then add the 127.0.0.1 localhost line and save and close the file. Then localhost should work as it did in XP.
October 30th, 2009 at 14:56
[…] I thought it may be Windows firewall and when I shut the firewall down then requests to Apache speeded up to normal speed. Obviously running with the firewall down isn’t ideal so I thought it might be related to a problem I had using localhost on Vista. […]
July 26th, 2010 at 19:43
[…] with the firewall down isn’t ideal so I thought it might be related to a problem I had using localhost on Vista. ← […]
July 26th, 2010 at 19:45
[…] with the firewall down isn’t ideal so I thought it might be related to a problem I had using localhost on Vista. ← […]