nginxportmamp-pro

MAMP Pro nginx won't start


Last week I was able to use MAMP Pro on MacOS Big Sur 11.6 (Mackbook Pro M1) to run the nginx web server for multiple virtual hosts. Today, after using certbot locally in renewing my local LetsEncrypt SSL certificate that supports local dev https development, I cannot start nginx on any of the virtual hosts.

I get a warning in MAMP Pro that says "You configured nginx to use ports 80 and 443, but at least one of these seems to be in use." So I checked that MAMP is still configured to use port 80 for nginx. Then I used Activity Monitor to try to kill all httpd processes using port 80. Two of them, owned by root and _www, refused to die. So I used kill -9 with their respective PIDs. That killed them for a moment but they came back. After that, I tried to restart nginx again on port 80. It fails to start with message "Nginx couldn't be started. Please check the log file for more information."

The log file from that shows

2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: still could not bind()

How do I fully kill the root and _www user processes? More importantly, why is this happening? Was it something to do with the renewed LetsEncrypt SSL?


Solution

  • Support told me that this is a problem with MAMP Pro 5 on MacOS and that MAMP Pro 5 is no longer supported. Upgrading to MAMP 6+ solves the problem.