This is my /etc/hosts configuration. I can use ip address 127.0.0.1 to open a loopback, but 'localhost' fails.... I have read these two posts:El Capitan Safari Can't open localhost and El Capitan Safari Can't open localhost, but none of the cases fits my problem.
The error message I got from Safari is
Safari can’t open the page “localhost” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.
I also tried the localhost on Chrome, it gave me similar message... Is there something wrong with setting alias?