MacOS Server Edition
https://getgrav.org/blog/macos-mojave-apache-ssl https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions https://getgrav.org/blog/macos-mojave-apache-upgrade-homebrew https://apple.stackexchange.com/questions/326979/how-can-i-switch-from-mac-server-app-to-apache https://tosbourn.com/turn-off-the-built-in-apache-on-osx/
Ensure Apache is stopped
sudo apachectl -k stop
Stop Apache being restarted after a reboot
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist
sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.server.httpd.plist
sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist
Check the port is unused
sudo lsof -i:80
Install Xcode Command Line Tools
xcode-select --install
Update or Install Homebrew
brew update
...or...
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Check Brew version
brew --version
Check all's good with Brew
brew doctor
Install missing libraries
brew install openldap libiconv
Upgrade or Install Apache (httpd)
brew upgrade httpd
brew link httpd
...or...
brew install httpd
Ensure Apache starts on reboot
brew services start httpd
Check install
http://localhost:8080
You can test your Apache config with /opt/homebrew/bin/httpd -t