Skip to content

Commit fda4801

Browse files
committed
Fixed: FS#732 - Fcgi 503 trouble if changing sites group
1 parent 3dbcc33 commit fda4801

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,19 @@ function update($event_name,$data) {
270270
exec('mv '.$data["old"]["document_root"].' '.$new_dir);
271271
$app->log("Moving site to new document root: ".'mv '.$data["old"]["document_root"].' '.$new_dir,LOGLEVEL_DEBUG);
272272

273+
//* Change the owner of the website files to the new website owner
274+
exec('chown --recursive --from='.escapeshellcmd($data["old"]["system_user"]).':'.escapeshellcmd($data['old']['system_group']).' '.escapeshellcmd($data["new"]["system_user"]).':'.escapeshellcmd($data['new']['system_group']).' '.$new_dir);
275+
273276
//* Change the home directory and group of the website user
274277
$command = 'usermod';
275278
$command .= ' --home '.escapeshellcmd($data["new"]["document_root"]);
276279
$command .= ' --gid '.escapeshellcmd($data['new']['system_group']);
277280
$command .= ' '.escapeshellcmd($data["new"]["system_user"]);
278281
exec($command);
279282

283+
284+
285+
280286
}
281287

282288
//print_r($data);
@@ -577,12 +583,14 @@ function update($event_name,$data) {
577583
if (!is_dir($fastcgi_starter_path))
578584
{
579585
exec("mkdir -p ".escapeshellcmd($fastcgi_starter_path));
580-
exec("chown ".$data["new"]["system_user"].":".$data["new"]["system_group"]." ".escapeshellcmd($fastcgi_starter_path));
586+
//exec("chown ".$data["new"]["system_user"].":".$data["new"]["system_group"]." ".escapeshellcmd($fastcgi_starter_path));
581587

582588

583589
$app->log("Creating fastcgi starter script directory: $fastcgi_starter_path",LOGLEVEL_DEBUG);
584590
}
585591

592+
exec("chown -R ".$data["new"]["system_user"].":".$data["new"]["system_group"]." ".escapeshellcmd($fastcgi_starter_path));
593+
586594
$fcgi_tpl = new tpl();
587595
$fcgi_tpl->newTemplate("php-fcgi-starter.master");
588596

0 commit comments

Comments
 (0)