PDA

View Full Version : Apache: configtest before restart?


mike_p
3rd June 2010, 14:11
Just chucking an idea into the pot....

If apache is restarted using apachectl script it first runs configtest before attempting a restart.

If apache is restarted using /etc/init.d/httpd script it doesn't run configtest before attempting a restart.

I think ISPConfig should run a configuration check before a restart (to prevent IPSConfig becoming unuseable.)

The restart is triggered in server/mods-available/web_module.inc.php.

If we included a config test before restarting, where would the sensible place be to report an error if it fails the config test?

mike_p
3rd June 2010, 14:31
I've just had a quick read of the apache documentation and it seems it would be possible to run a configtest as a non-root user: although it won't be a perfect test it will check syntax happily.

With regards to ISPconfig, any action that would require a restart can be checked before being sent to the queue? Or could items in the job queue be marked with a 'pending' tag until configuration errors have been fixed?

till
3rd June 2010, 17:18
With regards to ISPconfig, any action that would require a restart can be checked before being sent to the queue?

This wont work as ISPConfig is a multiserver controlpanel and you can not assume that the interface runs on the same server then the apache webserver.

But what we can do is to add a configtest in the apache server plugin. One problem with the configtest is that is is not able to find problems related to ssl certificates do not throw an error when running the config test but apache will not restart.