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

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
add comment

2 Answers

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
add comment

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
add comment

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.