3

Telnet on 127.0.0.1 doesn't work

127.0.0.1 connection refused

Trying to get the valet setup working. It appears when accessing 127.0.0.1 the connection is refused which is the message I get when I go to one of the *.dev sites setup. I've made sure apache is stopped and have been Googling all over the place and unable to find a solution.

Has anyone come across this or have any ideas on what to try next? I previously had httpd22 installed but I've now uninstalled this with brew which changed the 127.0.0.1 from responding with a list directory of /Users/Rick/Sites to now connection refused.

Rick Bolton
  • 169
  • 1
  • 8
  • Let me make sure I'm understanding. You uninstalled HTTPD and want to know why nothing is listening on port 80? It seems fairly obvious, at least on the surface. What's confusing is that you can do it via IPv6. Given then, that something *IS* actually listening, are you up against a firewall, perhaps? – Kevin_Kinsey Jul 12 '16 at 21:03
  • UBER:vue RickBolton$ sudo lsof -n -i:80 | grep LISTEN caddy 59 root 3u IPv6 0x800172de4f5ed877 0t0 TCP *:http (LISTEN) – Rick Bolton Jul 12 '16 at 21:05
  • Is what I get when I check what's listening on port 80 – Rick Bolton Jul 12 '16 at 21:05
  • Apache and Ngnix aren't needed for Laravel Valet and it uses a caddy driver but it seems the issue of IPv4 not listening perhaps? – Rick Bolton Jul 12 '16 at 21:06

2 Answers2

1

Fixed this. I followed a guide a while back to get a local dev setup and the issue was I had a .plist xml file within /Library/LaunchDaemons that forwarded port 80 to 8080 for 127.0.0.1.

The Run with Port 80 on this guide has caused me hours time trying to solve this one haha:

https://echo.co/blog/os-x-109-local-development-environment-apache-php-and-mysql-homebrew

Rick Bolton
  • 169
  • 1
  • 8
0

I had a similar connection issue between Valet and Nginx and fixed it by manually uninstalling and reinstalling Valet, found in this Stack Overflow answer:

$ rm -rf ~/.valet
$ brew unlink nginx && brew remove nginx
$ brew unlink php56 && brew remove php56 && brew uninstall --ignore-dependencies php56
$ brew unlink php72 && brew remove php72
$ brew unlink dnsmasq && brew remove dnsmasq

With a clean slate, I was able to successfully install a working Valet environment.

rjb
  • 9,036
  • 2
  • 44
  • 49