ftimme
2011-09-19 4ffb51e51f89a45256836fb55ad1c29f5e06beb2
server/mods-available/web_module.inc.php
@@ -129,11 +129,28 @@
   function restartHttpd($action = 'restart') {
      global $app,$conf;
      
      // load the server configuration options
      $app->uses('getconf');
      $web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
      $daemon = '';
      if(is_file($conf['init_scripts'] . '/' . 'httpd')) {
         $daemon = 'httpd';
      } else {
         $daemon = 'apache2';
      switch ($web_config['server_type']) {
         case 'nginx':
            $daemon = $web_config['server_type'];
            // Reload PHP-FPM as well
            $restart_second_service['daemon'] = $web_config['php_fpm_init_script'];
            $restart_second_service['action'] = 'reload';
            break;
         default:
            if(is_file($conf['init_scripts'] . '/' . 'httpd')) {
               $daemon = 'httpd';
            } else {
               $daemon = 'apache2';
            }
      }
      if($restart_second_service['daemon'] != '' && $restart_second_service['action'] != ''){
         exec($conf['init_scripts'] . '/' . $restart_second_service['daemon'] . ' ' . $restart_second_service['action']);
      }
      
      if($action == 'restart') {