homebrew – How to disable the default Apache installation

Spread the love

I am trying to disable the default Apache installation on my M1 MBP, however I am hitting problems.

Checking Apache configuration suggests the default is still configured.

apachectl -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using crmpicco.local. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "/usr"
Main DocumentRoot: "/Library/WebServer/Documents"
Main ErrorLog: "/private/var/log/apache2/error_log"
Mutex default: dir="/private/var/run/" mechanism=default 
Mutex mpm-accept: using_defaults
PidFile: "/private/var/run/httpd.pid"
User: name="_www" id=70 not_used
Group: name="_www" id=70 not_used

When I try to unload the service I get the following error (the org.apache.httpd.plist file is definitely there):

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
Unload failed: 113: Could not find specified service

I tried without sudo:

launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Warning: Expecting a LaunchAgents path since the command was ran as user. Got LaunchDaemons instead.
`launchctl bootout` is a recommended alternative.
Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.

Homebrew’s (arm64) apache answers on port 8080, however the doc root is /usr/local/var/www yet the apache config is showing as /var/www (where all my application code is).

grep DocumentRoot /usr/local/etc/httpd/httpd.conf                         
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/var/www"

How can I clear my machine of the default Apache entirely?

Author: Dhanraj7978

Leave a Reply

Your email address will not be published. Required fields are marked *