Cannot use Local in router mode

Issue Summary

Cannot use Local in router mode, getting warning that there is a port conflict with the site’s domain

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?

YES for all sites.

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?

NO

I just installed the latest version of Local (the lightning).
So this is a fresh install. I imported an old site that I exported from the Classic.
The site showed as localhost:10008, which I do not want.

So I set the preferences to use the Router Mode, deleted the site.
But new sites (by clicking the + sign) give me an error “There is a port conflict with the site’s domain”

From the documentation https://localwp.com/help-docs/advanced/router-mode/ I learned that there must be another process running.

Terminal gives me this:

COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd   837 root    4u  IPv6 0x547f082d0fa77543      0t0  TCP *:http (LISTEN)
httpd   841 _www    4u  IPv6 0x547f082d0fa77543      0t0  TCP *:http (LISTEN)
httpd   901 _www    4u  IPv6 0x547f082d0fa77543      0t0  TCP *:http (LISTEN)
  PID TTY           TIME CMD
  837 ??         0:00.26 /usr/sbin/httpd -D FOREGROUND
  PID TTY           TIME CMD
  841 ??         0:00.01 /usr/sbin/httpd -D FOREGROUND
  PID TTY           TIME CMD
  901 ??         0:00.00 /usr/sbin/httpd -D FOREGROUND

No idea what those processes are to be honest.Tried killing those processes but that did not help.
Restarted the computer. Old Local is not running.

Tried killing the Apache web server:

sudo apachectl stop

Gives me this:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using MacBook-Pro-15r-van-Andre.local. Set the 'ServerName' directive globally to suppress this message

httpd (no pid file) not running

Any idea to solve this? I have been using Local by Flywheel (now the Classic) for a long time and would like to switch to the Lightning version. But I’d loathe to see the localhost:port number thing in the URL and want to use HTTPS.

What do?

Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!

System Details

  • Which version of Local is being used?

latest and greatest

  • What Operating System (OS) and OS version is being used?
    • For example: macOS Catalina or Windows 10 Professional

MacOS Mojave

Router logs give me this (truncuated)

2021/06/30 12:23:30 [emerg] 997#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:30 [emerg] 997#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:30 [emerg] 997#0: still could not bind()
2021/06/30 12:23:34 [emerg] 998#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: bind() to [::]:80 failed (48: Address already in use)
2021/06/30 12:23:34 [emerg] 998#0: still could not bind()

OK found it. Took me some time…

When I typed in localhost:80 in my browser, it showed IT WORKS (instead of “site not found”)
meaning that there is a webserver running.
This webserver starts up automatically.

In order to disable this, type this in a terminal window:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

more background on Stackexchange

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.