Is it possible to make apache not dependant on log existance?
If there is a log file that cannot be opened, apache quits after restart or even reload. Quite an unplesant behaviour because one needs to be super careful when manipulating vhosts on production server. Does it need to be this way? Interesting is that if there is just a syntax error in a vhost reloading apache does not quit it.
Example:
$ sudo /etc/init.d/httpd reload
From logs:
[Thu Jan 10 19:25:02 2013] [notice] SIGHUP received. Attempting to restart
(2)No such file or directory: httpd: could not open error log file /var/www/patron/logs/error_log.
Unable to open logs
And apache is not running anymore :(.
You are barking up the wrong tree here. You've instructed apache to keep logs, it's not able to do that, so it bails out, as it should.
The real problem here is lack of control/testing. Before touching your production configs, test those changes in a staging environment. Doing so will catch this type of issue in addition to countless others.
If you absolutely must modify your configs directly on the production server, make sure you perform a configuration test before reloading the configuration. Use of
apachectl configtest
andapachectl graceful
will eliminate most (but not all) accidents of this type.