How to fix HTTPD (Apache) Error 256 on OSX Monterey 12.5

Viewed 497

I have a Apache2 installed with Homebrew on a Mac running OSX Monterey. I haven't done LAMP development for a while, so I'm not sure when the error started, but I've recently updated OSX to 12.5. When I returned to working on a LAMP project, my Apache installation stopped working. Running brew services produced the following output: Name Status User File httpd error 256 root ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist mysql started Nizz0k ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist.

Running the stop, start, and restart commands produces "success" output in the terminal, but Apache doesn't work. I can't navigate to my local vhosts, and of course, running brew services still shows an error.

In running apachectl -e error Apache complains about permissions to the error logs

I have tried:

  1. uninstalling and reinstalling HTTPD
  2. The apr-utilities fix.
  3. confirming Mac installed Apache is stopped.

At this point, I think my problem is that there was conflicting information about how to run Apache on Homebrew. Earlier versions apparently required sudo, but running it this was now produces warnings like this:

Warning: Taking root:admin ownership of some httpd paths:
  /usr/local/Cellar/httpd/2.4.54/bin
  /usr/local/Cellar/httpd/2.4.54/bin/httpd
  /usr/local/opt/httpd
  /usr/local/opt/httpd/bin
  /usr/local/var/homebrew/linked/httpd
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: httpd must be run as non-root to start at user login!
/Library/LaunchDaemons/homebrew.mxcl.httpd.plist: service already bootstrapped
Bootstrap failed: 37: Operation already in progress
Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.httpd.plist` exited with 37.

The issue is even after removing the paths as suggested in the error, a reinstallation brings Root back as the owner.

1 Answers

I do have the same problem with nginx. Manually unloaded it and then restarting it worked fine.

Try:

sudo launchctl bootout system /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
sudo brew services start httpd
Related