Skip to content

Commit 6417818

Browse files
committed
Added a few debug messages to the apache2 plugin.
1 parent 6724a4e commit 6417818

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,12 +219,15 @@ 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["old"]["document_root"]."/log")) exec("rm -f ".$data["old"]["document_root"]."/log");
222+
if(is_link($data["old"]["document_root"]."/log")) unlink($data["old"]["document_root"]."/log");
223223
}
224224

225225
// Create the symlink for the logfiles
226226
if(!is_dir('/var/log/ispconfig/httpd/'.$data["new"]["domain"])) exec('mkdir -p /var/log/ispconfig/httpd/'.$data["new"]["domain"]);
227-
if(!is_link($data["new"]["document_root"]."/log")) exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log");
227+
if(!is_link($data["new"]["document_root"]."/log")) {
228+
exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log");
229+
$app->log("Creating Symlink: ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log",LOGLEVEL_DEBUG);
230+
}
228231

229232

230233
// Get the client ID

0 commit comments

Comments
 (0)