Apache is installed by default on macOS, but it's not configured to start during system boot automatically. For this, you'll have to manually start the httpd process every time you want to use it.
user@host $ sudo apachectl -k start Password: AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
It's a good default setting as most macOS users will not need a web server running all the time in the background. However, if you're a web developer, you might want Apache to start automatically whenever macOS boots up.
Related: How to check Apache configuration
$ sudo apachectl -k start
ps -aef | grep httpd 0 161 1 0 Sun04AM ?? 0:04.05 /usr/sbin/httpd -D FOREGROUND 501 800 161 0 Sun04AM ?? 0:02.54 /usr/sbin/httpd -D FOREGROUND 501 1007 161 0 Sun04AM ?? 0:02.62 /usr/sbin/httpd -D FOREGROUND 501 1381 161 0 Sun07AM ?? 0:01.71 /usr/sbin/httpd -D FOREGROUND 501 4472 161 0 Tue07AM ?? 0:01.74 /usr/sbin/httpd -D FOREGROUND 501 4473 161 0 Tue07AM ?? 0:01.17 /usr/sbin/httpd -D FOREGROUND 501 4474 161 0 Tue07AM ?? 0:01.06 /usr/sbin/httpd -D FOREGROUND
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist Password:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Comment anonymously. Login not required.