Can't stop Apache using homebrew commands

Viewed 3166

I'm building a new web server on a new M1 Mac Mini running the latest version of Big Sur, fresh install. Only thing I have done to the machine is install Chrome.

I'm installing Apache with the following:

  • Install xcode command line tools: xcode-select --install
  • Install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Install missing libraries: brew install openssl
  • Check to see if apache is running, remove any scripts:
    • sudo apachectl stop
    • sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
  • Install httpd: brew install httpd
  • Configure autostart: brew services start httpd

At this point, httpd is running fine, and I can see the pages at http://localhost:8080

And I can confirm httpd starts up fine after reboot.

Issue is, I can't shut it down. if i issue the command brew services stop httpd, I get the following:

Mac-mini / % brew services stop httpd
Stopping httpd... (might take a while)
==> Successfully stopped httpd (label: homebrew.mxcl.httpd)
Mac-mini / %

Activity monitor still shows multiple instances of httpd running, though. The only way to shut it down is either quit it in actvity monitor or issue the command

sudo apachectl -k stop

Any suggestions of why niether of the following commands work or how to track down the issue?

brew services stop httpd
brew services restart httpd

0 Answers
Related