Pro Tip: Quickly locate apache config errors on Mac OSX

If Apache is refusing connections entirely on Mac OSX (i.e. “Unable to connect” message shows in the browser when trying to load websites hosted on your machine), there’s a good chance there are errors in the Apache config files. This will prevent Apache from starting normally and as a result there will be nothing in the Apache error log itself, as Apache can’t start up.

So to locate where the errors lie, from a terminal window,  run this:

sudo apachectl configtest

That will reveal whether there are syntax errors in the config files (e.g. in httpd.conf or perhaps in the virtual host config file if you are using virtual hosts).