6

I've had my app running on localhost port 80 via nginx on my mac for quite awhile. Recently I did some software updates and was trying to run other apps on different ports and now I can't run my first app on localhost:80.

I've very confused on where to start but think this is a firewall issue based on the following:

Tims-MacBook-Pro-2:html TimPeterson$ telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host 

pointing the browser to http://localhost gives this Oops! Google Chrome could not connect to localhost

thoughts?

tim peterson
  • 23,653
  • 59
  • 177
  • 299
  • The answer is provided in this SO thread http://stackoverflow.com/questions/19607457/cant-run-web-app-on-localhost-mac – tim peterson Oct 26 '13 at 19:20
  • I'm having trouble seeing the answer you're referring to on that link. I also got this error (along with MySql error) after installing ngnix, but I think via a different method than you. – MikeiLL Sep 25 '14 at 02:51
  • I'm guessing @timpeterson is referring to that you should be using `127.0.0.1` instead of `localhost`. – Kristofer Sommestad Aug 06 '15 at 21:51

3 Answers3

4

you may want to run

apachectl configtest

first.

DrustZ
  • 342
  • 1
  • 5
  • 19
0

My problem was specific, but might help another user. On Mac OS go to system preferences/sharing and check your computer name/localhost name (click edit to see the localhost name). My computer was reset by Apple in a non-English speaking country. They stuck some of their language in my computer name (great idea!) and it broke the Cisco login to localhost

Herbert
  • 21
  • 2
-1

What worked for me was uncommenting the following line in my /etc/hosts file:

::1    localhost