On 23/06/10 22:24, simon ransome wrote:
mick wrote:
So the problem is not confined to apache unfortunately.
Mick: Thanks for trying this - it's really appreciated. Shame it didn't show lighttpd to be better than Apache in this respect, though.
Short of actually starting the server up it's never going to know if it has, for instance, appropriate file-system permissions, config-specified directories in place [...]
There are two ways to (potentially) achieve this.
One is to find a way to load a second instance of the server with the new configuration; this could never be complete (ie it couldn't bind to the same IP/port) but it could catch some obscure errors, leaving unit testing to catch the rest.
However the simplest would be to have two configurations, a "known good" and a "current". On startup, you load the current config, and if that fails you restart loading the known good config. Minimal downtime, and (I would have thought) relatively simple to achieve. Indeed this could probably be achieved through scripting; start Apache, if it fails within a few seconds switch to a known-good config and restart. If it fails after a longer period just restart it (to guard against crashes unrelated to the config). Maybe something like this already exists, I'll have to go hunting!