0

I am macOS Catalina and got my local webserver running following this article. And then I installed Local by Flywheel but am unable to use the Router Mode: Site Domains due to port conflicts.

It is inconvenient for my local WordPress sites to be localhost:30001 instead of sitename.dev. Is there a way to have both local by flywheels and the local server working together?

My host file is

> ##
> # Host Database
> #
> # localhost is used to configure the loopback interface
> # when the system is booting.  Do not change this entry.
> ##
> 127.0.0.1 localhost
> 255.255.255.255   broadcasthost ::1   localhost
> 
> ## Local by Flywheel - Start ## ::1 www.helpneeded.dev #Local Site
> 127.0.0.1 www.helpneeded.dev #Local Site
> ## Local by Flywheel - End ##

The local webserver is also using port 80.

Error Seen on Local Panel - Port Conflict:

error description

DarthQuack
  • 1,254
  • 3
  • 12
  • 22

1 Answers1

0

I would just use sitename.dev:30001, but if you really wanted to, there is a workaround at Using port number in Windows host file that you can use. The workaround uses netsh which manages network interface and is able to create a proxy on the network interface allowing you to forward traffic without actually having to bind to a specific port first. Combine that with the fact that everything in 127.x.x.x refers to yourself, and you just need to add 127.0.0.2 sitename.dev to your hosts file, and then use the workaround to forward 127.0.0.2:80 -> 127.0.0.1:3001.

See also Can two applications listen to the same port?

hostingutilities.com
  • 8,894
  • 3
  • 41
  • 51