Skip to content

Commit 6724a4e

Browse files
committed
1 parent 318ace2 commit 6724a4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function update($event_name,$data) {
219219
// Remove the symlink for the site, if site is renamed
220220
if($this->action == 'update' && $data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"]) {
221221
if(is_dir('/var/log/ispconfig/httpd/'.$data["old"]["domain"])) exec('rm -rf /var/log/ispconfig/httpd/'.$data["old"]["domain"]);
222-
if(is_link($data["new"]["document_root"]."/log")) exec("rm -f ".$data["new"]["document_root"]."/log");
222+
if(is_link($data["old"]["document_root"]."/log")) exec("rm -f ".$data["old"]["document_root"]."/log");
223223
}
224224

225225
// Create the symlink for the logfiles
@@ -389,11 +389,14 @@ function update($event_name,$data) {
389389
$app->log("Removing symlink: $vhost_symlink => $vhost_file",LOGLEVEL_DEBUG);
390390
}
391391

392-
// remove old symlink, if domain name of the site has changed
392+
// remove old symlink and vhost file, if domain name of the site has changed
393393
if($this->action == 'update' && $data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"]) {
394394
$vhost_symlink = escapeshellcmd($web_config["vhost_conf_enabled_dir"].'/'.$data["old"]["domain"].'.vhost');
395395
unlink($vhost_symlink);
396396
$app->log("Removing symlink: $vhost_symlink => $vhost_file",LOGLEVEL_DEBUG);
397+
$vhost_file = escapeshellcmd($web_config["vhost_conf_dir"].'/'.$data["old"]["domain"].'.vhost');
398+
unlink($vhost_file);
399+
$app->log("Removing File $vhost_file",LOGLEVEL_DEBUG);
397400
}
398401

399402
// request a httpd reload when all records have been processed

0 commit comments

Comments
 (0)