« | Home

Can’t connect to localhost

By SaWey | March 10, 2009

Today I was working on one of my php projects on my local WAMP server, and when I wanted to load my app in my browser, suddenly I couldn’t connect to http://localhost anymore.
First, since my laptop hadn’t been rebooted for 2 weeks,  I rebooted to see if that would help, but that didn’t help. I tried looking in my Apache logs and saw nothing there from my tries to connect.
Then I connected to http://127.0.0.1 and … it worked without a hitch.

This got me to think it was a windows update, I looked through the update history and saw that Windows Defender got an update. So I started Defender to look for a log and this brought me to the problem and the solution.

SettingsModifier:Win32/PossibleHostsFileHijack
Source: 
file:
C:\Windows\system32\drivers\etc\hosts

More info over here: microsoft.comraman amplifier

 

Apperently something changed my ‘hosts’ definition file. I opened the file and there was no mapping of localhost to a descent IP address, so I added it myself like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 1993-2006 Microsoft Corp. 
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 
# This file contains the mappings of IP addresses to host names. Each 
# entry should be kept on an individual line. The IP address should 
# be placed in the first column followed by the corresponding host name. 
# The IP address and the host name should be separated by at least one 
# space. 
# Additionally, comments (such as these) may be inserted on individual 
# lines or following the machine name denoted by a '#' symbol. 
# For example: 
# 102.54.94.97 rhino.acme.com # source server 
# 38.25.63.10 x.acme.com # x client host 

127.0.0.1 localhost
::1 localhost  
 
 

леглаonline casino
Note: When you try to save this file, Defender will prompt you with the message ‘Win32/PossibleHostsFileHijack’, which you have to ignore.
After saving the file, everything should work as before.

Topics: Small talk | No Comments »

Comments