How to Fix Your Local Apache Web Server When an OS X Update Kills It

I recently upgraded OS X on my MacBook to the latest version — 10.11.4 — and found that, as with most OS X upgrades, it broke my local instance of the Apache web-server.

During an OS X upgrade, Apple replaces an existing httpd.conf file with a new version, presumably for security reasons. This is all well and good, but I use my MacBook for web-development and my customised httpd.conf file is important to me. I’d prefer if Apple just left it alone.

Fortunately, Apple does make a backup of the existing file before it replaces it, so recovery is simply a case of replacing the new file with its predecessor:

cd /etc/apache2/
sudo mv httpd.conf httpd.conf.OLD
sudo mv httpd.conf~previous httpd.conf
sudo apachectl restart

Via: Stack Overflow.