localhost on MacOSX connection refused
Asked Answered
R

3

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?

Regine answered 25/10, 2013 at 16:13 Comment(3)
The answer is provided in this SO thread #19607957Regine
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.Nosy
I'm guessing @timpeterson is referring to that you should be using 127.0.0.1 instead of localhost.Shifrah
S
4

you may want to run

apachectl configtest

first.

Slapdash answered 27/3, 2016 at 3:58 Comment(3)
While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value.Martinemartineau
It will run a test in your terminal and show you syntax errors and such so you know exactly what to fix for your apache to run againEveryman
Syntax OK it says, still ERR_CONNECTION_REFUSED Tribromoethanol
B
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

Brachylogy answered 5/7, 2022 at 0:27 Comment(0)
E
-1

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

::1    localhost
Engulf answered 27/8, 2016 at 22:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.