From e942cfab4d189d1dd58e9f16ecb7f01e2adbc8c3 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Mon, 2 Jan 2012 12:51:32 +0000 Subject: [PATCH] Fixed website permission settings, --- server/plugins-available/apache2_plugin.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index bd93b51e7e..ffc9feb341 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -587,6 +587,7 @@ class apache2_plugin { $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['user'])); //* Chown all default directories + $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'])); $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/cgi-bin')); $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/log')); $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/ssl')); @@ -610,11 +611,20 @@ class apache2_plugin { } else { $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'])); - $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'].'/*')); - $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root'])); - + $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'].'/cgi-bin')); + $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'].'/log')); + $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'].'/ssl')); + $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'].'/web')); + // make temp directory writable for Apache and the website users $this->_exec('chmod 777 '.escapeshellcmd($data['new']['document_root'].'/tmp')); + + $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root'])); + $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/cgi-bin')); + $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root'].'/log')); + $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/tmp')); + $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/ssl')); + $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/web')); } } -- GitLab