MAMP unable to start on port 80 on an older Mac

I was helping Lyle Workman setup MAMP for local testing on Macs. He got everything working on new new M1 Mac. However, his older iMac (stuck running Monterey, I think) would not work. When we configured MAMP to run on port 80, it came up with an error saying that launchd already had a process that was using port 80.

And sure enough, if we visited http://localhost in the browser, it displayed a webpage saying "It Works!". This felt familiar to me. We looked for the "Web Sharing" setting in System Preferences->Sharing. However, it was not listed there at all.

So we started quitting every app that he had running to see what was causing the issue. Nothing. We had no app open but the web server was still running. You could see the httpd processes inside Activity monitor.

I was fairly confident that the old "Web Sharing" that was built into MacOS displayed the "It Works!" text by default. So after some digging, we ran the following command via terminal.

sudo apachectl stop

This stopped the web server!

Here is what I believe happened. Web Sharing had been enabled on the Mac many years ago, when it was supported by Apple. At some point, an OS update removed that option from the System Preferences. However, it only removed the preference. The server was actually still configured to run! And it was.

So now the final step is to actually fix the underlying preference in MacOS to ensure when we reboot the Mac, the web server does not start back up again. In order to do that, you need to run the following command via terminal.

sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool true

We restarted the Mac, and everything worked. The MacOS web server was no longer running and MAMP was able to start its servers on port 80.

I hope this might help someone else out.

8
2 replies