Make apachectl restart more verbose on Mac 10.8

apache-2.2

I'm using the standard Apache server in my Mac OS X 10.8 (Mountain Lion) installation, and find that when running

sudo apachectl restart

The command simply shows the prompt when finished, whether Apache failed to start or not. There is no feedback, until you refresh your browser to see if localhost still works or not.

Is there a way to configure Apache to be a bit more verbose?

Best Answer

You could try:

sudo apachectl -e info -k restart

The -e option is equivalent to the LogLevel directive, but it logs to your terminal. Replace info with debug for more details.

The apachectl script and the httpd binary have slightly conflicting arguments, so you need to use -k with stop, start, restart and graceful (the command keywords alone will not work as expected when other arguments are present). To get configcheck use

sudo apachectl -e info -t

This applies to Apache on any platform using the standard apachectl script.

This answer has another option, but I consider strace (and dtrace, ktrace, truss) to be more of a last resort...