Skip to content

Commit 63b3694

Browse files
committed
- Make sure the installer adds the nginx user to the ispconfig group (if nginx is installed).
1 parent d083f22 commit 63b3694

File tree

5 files changed

+34
-10
lines changed

5 files changed

+34
-10
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public function configure_nginx(){
581581
exec('mkdir -p '.$conf['nginx']['vhost_conf_enabled_dir']);
582582
exec('mkdir -p '.$conf['nginx']['vhost_conf_dir']);
583583

584-
wf('/etc/nginx/conf.d/ispconfig_vhosts.conf',"include /etc/nginx/sites-enabled/*.conf;");
584+
wf('/etc/nginx/conf.d/ispconfig_vhosts.conf',"include /etc/nginx/sites-enabled/*;");
585585

586586
//* make sure that webalizer finds its config file when it is directly in /etc
587587
if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) {
@@ -854,8 +854,14 @@ public function install_ispconfig()
854854
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing
855855
// and must be fixed as this will allow the apache user to read the ispconfig files.
856856
// Later this must run as own apache server or via suexec!
857-
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
858-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
857+
if($conf['apache']['installed'] == true){
858+
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
859+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
860+
}
861+
if($conf['nginx']['installed'] == true){
862+
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
863+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
864+
}
859865

860866
//* Make the shell scripts executable
861867
$command = "chmod +x $install_dir/server/scripts/*.sh";

install/dist/lib/gentoo.lib.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,14 @@ public function install_ispconfig()
854854
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing
855855
// and must be fixed as this will allow the apache user to read the ispconfig files.
856856
// Later this must run as own apache server or via suexec!
857-
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
858-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
857+
if($conf['apache']['installed'] == true){
858+
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
859+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
860+
}
861+
if($conf['nginx']['installed'] == true){
862+
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
863+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
864+
}
859865

860866
//* Make the shell scripts executable
861867
$command = "chmod +x $install_dir/server/scripts/*.sh";

install/dist/lib/opensuse.lib.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,14 @@ public function install_ispconfig()
831831
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing
832832
// and must be fixed as this will allow the apache user to read the ispconfig files.
833833
// Later this must run as own apache server or via suexec!
834-
$command = 'groupmod --add-user wwwrun ispconfig';
835-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
834+
if($conf['apache']['installed'] == true){
835+
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig';
836+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
837+
}
838+
if($conf['nginx']['installed'] == true){
839+
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig';
840+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
841+
}
836842

837843
//* Make the shell scripts executable
838844
$command = "chmod +x $install_dir/server/scripts/*.sh";

install/lib/installer_base.lib.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,8 +1732,14 @@ public function install_ispconfig() {
17321732
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing
17331733
// and must be fixed as this will allow the apache user to read the ispconfig files.
17341734
// Later this must run as own apache server or via suexec!
1735-
$command = 'adduser www-data ispconfig';
1736-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1735+
if($conf['apache']['installed'] == true){
1736+
$command = 'adduser '.$conf['apache']['user'].' ispconfig';
1737+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1738+
}
1739+
if($conf['nginx']['installed'] == true){
1740+
$command = 'adduser '.$conf['nginx']['user'].' ispconfig';
1741+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1742+
}
17371743

17381744
//* Make the shell scripts executable
17391745
$command = "chmod +x $install_dir/server/scripts/*.sh";

install/tpl/nginx_ispconfig.vhost.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ server {
5555
location ~ ^/squirrelmail/(.+\.php)$ {
5656
try_files $uri =404;
5757
root /usr/share/;
58-
fastcgi_pass 127.0.0.1:9000;
58+
fastcgi_pass 127.0.0.1:{fpm_port};
5959
{ssl_comment}fastcgi_param HTTPS {fastcgi_ssl};
6060
fastcgi_index index.php;
6161
fastcgi_param SCRIPT_FILENAME $request_filename;

0 commit comments

Comments
 (0)