tbrehm
2012-01-02 84710d22010a71c53ec7a2537b6899d29a31e13a
- Improved check for vhosts created with the remote API FS#1950
1 files modified
6 ■■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -1115,7 +1115,13 @@
            if($apache_online_status_before_restart && !$apache_online_status_after_restart) {
                $app->log('Apache did not restart after the configuration change for website '.$data['new']['domain'].' Reverting the configuration. Saved non-working config as '.$vhost_file.'.err',LOGLEVEL_WARN);
                copy($vhost_file,$vhost_file.'.err');
                if(is_file($vhost_file.'~')) {
                    //* Copy back the last backup file
                copy($vhost_file.'~',$vhost_file);
                } else {
                    //* There is no backup file, so we create a empty vhost file with a warning message inside
                    file_put_contents($vhost_file,"# Apache did not start after modifying this vhost file.\n# Please check file $vhost_file.err for syntax errors.");
                }
                $app->services->restartService('httpd','restart');
            }
        } else {