On 10/13/2009 12:17 PM, Scott Gifford wrote:
I have had mixed experiences in the past with automatically restarting Apache after a configuration change. It is very easy to end up with something unexpected in the configuration, which causes the configuration to fail, which causes apache to stop. And with a cluster, that would happen on all hosts.
If you run apache with a -t option it will check that the configuration is sane. I'm assuming that your configuration is auto-generated by this monitor somehow, then you can create a new config file and test it with
httpd -t -f /path/to/new/file Then if it's ok, you can move it to the real location and do the restart.
When I have done this in the past, I have done it with generating configuration files, so of course one misplaced newline or angle-bracket will kill the server.
I generally prefer generated config files, especially if you have multiple sites with basically the same config. I also use templated config files so that the template I'm working on looks a lot like the finished product. It's easier to prevent typos this way, IMO.
-- Michael Peters Plus Three, LP