Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

localhost on MacOSX connection refused

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?

like image 591
tim peterson Avatar asked Oct 25 '13 16:10

tim peterson


People also ask

Can't connect to localhost connection refused?

If you're unable to access the web server via localhost, there's a chance that your firewall may be blocking the connection. You can often resolve this problem by modifying your firewall settings to allow incoming connections for the port that MAMP is trying to access.

Why is 127.0 0.1 refused to connect?

The default port number for the web server is 80. If you're trying to access it by typing localhost in your browser – which will direct to localhost:80 – but it turns out your web server is not configured to use the default port, you'll get the localhost error or 127.0 0.1 refused to connect message.


1 Answers

you may want to run

apachectl configtest

first.

like image 74
DrustZ Avatar answered Sep 21 '22 10:09

DrustZ