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).

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s