Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 550
    • Issues 550
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #4504

Closed
Open
Created Feb 07, 2017 by Timo Boldt@timo.boldt

Apache2 - reload instead restart (idea)

Hi guys,

I looked inside the source code today, because our webserver with many websites got some seconds of offtime after changing website configurations. So I debugged a little and saw, that the apache2-plugin do a restart and tcp check to test out, if configs are faulty. In my opinion this is unnecessary, because it could be tested by apache2ctl -t before, OR doing a reload which results in a fail, which will result in an error too, but needs less time.

             if($web_config['check_apache_config'] == 'y') {
                    //* Test if apache starts with the new configuration file
                    $apache_online_status_before_restart = $this->_checkTcp('localhost', 80);
                    $app->log('Apache status is: '.($apache_online_status_before_restart === true? 'running' : 'down'), LOGLEVEL_DEBUG);

===>                $retval = $app->services->restartService('httpd', 'restart'); // $retval['retval'] is 0 on success and > 0 on failure
                    $app->log('Apache restart return value is: '.$retval['retval'], LOGLEVEL_DEBUG);

Why to do something like that? Wouldn't it be better to reload, and check for errors then? So existing websites would not get an offtime while ispconfig will fix the faulty config files. I tested with reload and it worked so far. The correct workflow should be a testing via "apache2ctl -t" before, then reload, shouldn't it?

I think this is not a bug, but should be rethought in newer versions. So far we will patch that files atm.

Assignee
Assign to
Time tracking