diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index cbda9f67c3bbaf550fcd28bdb1875a3d2c0459fc..addcd138b814bbf4d0383d85f384f4c6773e40c6 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -461,6 +461,9 @@ class apache2_plugin { $app->system->rename($data['new']['document_root'], $data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s')); $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'), LOGLEVEL_DEBUG); } + + //* Unmount the old log directory bfore we move the log dir + exec('umount '.escapeshellcmd($old_dir.'/log')); //* Create new base directory, if it does not exist yet if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir); @@ -492,6 +495,8 @@ class apache2_plugin { $app->system->removeLine('/etc/fstab', $fstab_line); $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0'; $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1); + + exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder)); } diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 1947367c9a0c859d018e282b7d68f97be711f854..d83ecf442f9f156f34443b86815334741b5c0070 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -465,6 +465,9 @@ class nginx_plugin { $app->system->rename($data['new']['document_root'], $data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s')); $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'), LOGLEVEL_DEBUG); } + + //* Unmount the old log directory bfore we move the log dir + exec('umount '.escapeshellcmd($old_dir.'/log')); //* Create new base directory, if it does not exist yet if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir); @@ -496,6 +499,8 @@ class nginx_plugin { $app->system->removeLine('/etc/fstab', $fstab_line); $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0'; $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1); + + exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder)); }