beyondcode / herd-community

80 stars 1 forks source link

[Bug]: Port 80 nginx blocked #860

Closed cooffeeRequired closed 1 month ago

cooffeeRequired commented 2 months ago

Platform

Windows

Operating system version

WIN 10

System architecture

Intel (x86)

Herd Version

1.8

PHP Version

8.2

Bug description

Ngninx wont start with strange rror 2024/07/05 21:43:46 [emerg] 9896#2068: bind() to 127.0.0.1:80 failed (10013: Do�lo k pokusu o pr�stup k soketu zpusobem zak�zan�m jeho pr�stupov�mi opr�vnen�mi)

Steps to reproduce

No response

Relevant log output

No response

sschlein commented 2 months ago

Can you please translate the error or post it with the correct char set so that we can run it through a translator? I just get broked characters for your issue.

My guess is that something else is already on port 80 and so nginx can't start

cooffeeRequired commented 2 months ago

2024/07/05 21:43:46 [emerg] 9896#2068: bind() to 127.0.0.1:80 failed (10013: Attempted to access socket in a manner prohibited by its access controls)

tesune commented 1 month ago

2024/07/05 21:43:46 [emerg] 9896#2068: bind() to 127.0.0.1:80 failed (10013: Attempted to access socket in a manner prohibited by its access controls)

In this case. I guess others application is using the port: 80. I have the same problem, I change herd.conf, and adminer.conf listen to port 8080. It works when only change both of these config files.

However, another problem is adminer.conf will regenerate every time you open/restart HERD, which cause the port you changed went back to default 80. This is annoying, you have to change port every time you plan to use the service.

This solution helps me, open services look for World Wide Web Publishing Service -> Stop / Disable it. Then, try start all service in HERD again. This services related to IIS, if you're working with IIS, this is not the best solution for you.

GashyDev commented 1 month ago

I too was experiencing a similar NGINX issue in regards with port 80 but on Windows 11 - only thing is the only PID that was using port 80 was "system".

Altering the port in the files located at %USERPROFILE%\.config\herd\config\nginx as referenced by the docs didn't really change anything at first, but I realised that there are NGINX configs inside pro, and for each project/domain inside valet that also needed to be altered which then resolved this.

These files were:

"%USERPROFILE%\.config\herd\config\nginx\herd.conf" - line 2
"%USERPROFILE%\.config\herd\config\pro\nginx\adminer.conf" - line 2
"%USERPROFILE%\.config\herd\config\valet\Nginx\{ your project }.conf" - line 2

If you have multiple domains, you may need to go into each { project }.conf file and tweak the port.

I'm not sure if this would be classed as a bug or not, or if its a side effect of using the free version of Herd - but hopefully that helps anyone else in the same boat.

HeytalePazguato commented 1 month ago

@GashyDev solution of changing those files works. It would be nice to have a way to change the port directly from the Dashboard

Ceepster14 commented 1 month ago

I concur. An easy way to change the default port would definitively be appreciated.

We work with a designer who mainly works on .NET projects and has his local dev environment uses port 80 for those projects. Currently he has to run various XAMPP installs (for various legacy projects using different PHP versions) on a different port to work on our projects.

I'd love to be able to move him to Herd Pro as it would make his work for us a lot easier and being able to globally control port numbers would be really helpful!

mpociot commented 1 month ago

See #848

markosole commented 3 weeks ago

I concur. An easy way to change the default port would definitively be appreciated.

We work with a designer who mainly works on .NET projects and has his local dev environment uses port 80 for those projects. Currently he has to run various XAMPP installs (for various legacy projects using different PHP versions) on a different port to work on our projects.

I'd love to be able to move him to Herd Pro as it would make his work for us a lot easier and being able to globally control port numbers would be really helpful!

Very the same here, I am using MAMP, similar thing. Interesting is that Windows is using port 80 on the machine and it's used by System. I did not manage to get Herd run on any different port.

sschlein commented 3 weeks ago

If you are using MAMP, MAMP is already using port 80 – Herd does not support being run on a different port at the moment.

markosole commented 3 weeks ago

Yes this is true, the thing is that I am forced to use MAMP or similar by setting other port (81, 82...). Anyways, windows is using port 80 and Process responsible for it is "System", which is essentially one of the core features on the system.

Now I have fould a way to drill this down and basically came up with list of services:

This will stop http service, (run it in CMD as Administrator): net stop http

C:\Windows\System32>net stop http
The following services are dependent on the HTTP Service service.
Stopping the HTTP Service service will also stop these services.

   World Wide Web Publishing Service
   UPnP Device Host
   SSDP Discovery
   Print Spooler

Do you want to continue this operation? (Y/N) [N]:

And the issue is "World Wide Web Publishing Service" which was the main reason. Now, other service like WinRM - remote management etc is using http service and I will assume you'll find out soon enough what does not work any more on your PC.

This is how I solved my problem (for now).

Not everybody will be able to do this and Laravel Herd (free and Pro) should really allow changing serving ports.