Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make Apache2 skip configuration files or segments if they lead to errors?

For example, if I have specified a <VirtualHost></> but the defined path doesn't exist anymore. Is there something that makes Apache skip the web on restart/reload?

share|improve this question

No, you can't make apache ignore syntax errors, but you can check for errors in advance (httpd -t) or use "graceful restart" (httpd -k graceful) during which the check is done, and if there are some, the config doesn't get reloaded.

share|improve this answer

Usually I'm not very fond of very short answers, but in this case I'll make an exception: No, you cannot. If the config is not valid, Apache will tell you.

If a DocumentRoot does not exist that will not lead to an error, just a warning.

share|improve this answer

Your Answer


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.