Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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

share|improve this answer

I just tend to echo $? to get the exit status. Or do a quick ps aux | grep apache or ps aux | grep httpd (depending on the OS) to check for the service after restarting.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.