From 990a55dcc4bddfec2b10525830acdc3b112cc956 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 03 Jan 2012 11:08:05 -0500
Subject: [PATCH] Fixed: FS#1885 - Wrong DNS server selected in multiserver when client creates dns zone when no limits are set
---
server/plugins-available/apache2_plugin.inc.php | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index e721a08..3cba835 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/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');
- copy($vhost_file.'~',$vhost_file);
+ 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 {
--
Gitblit v1.9.1