|
|
@ -1,8 +1,10 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
use esmith::AccountsDB; |
|
|
|
use esmith::AccountsDB; |
|
|
|
use esmith::ConfigDB; |
|
|
|
use esmith::ConfigDB; |
|
|
|
|
|
|
|
|
|
|
|
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database"; |
|
|
|
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database"; |
|
|
|
my $p = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); |
|
|
|
my $p = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php'); |
|
|
|
|
|
|
|
|
|
|
|
if ($fastcgi_mod eq 'mod_fastcgi'){ |
|
|
|
if ($fastcgi_mod eq 'mod_fastcgi'){ |
|
|
|
$OUT .=<<_EOF; |
|
|
|
$OUT .=<<_EOF; |
|
|
|
# mod_fastcgi global config |
|
|
|
# mod_fastcgi global config |
|
|
@ -13,28 +15,20 @@ FastCgiConfig -idle-timeout 40 -maxClassProcesses 1 |
|
|
|
Allow from all |
|
|
|
Allow from all |
|
|
|
</Location> |
|
|
|
</Location> |
|
|
|
|
|
|
|
|
|
|
|
# Stock PHP |
|
|
|
_EOF |
|
|
|
Action php-fastcgi /php-cgi-bin/php-wrapper |
|
|
|
|
|
|
|
Alias /php-cgi-bin/php-wrapper /var/www/php-cgi-bin/php-wrapper |
|
|
|
|
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php-wrapper -socket /var/run/php-fpm/php.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# PHP 5.6 |
|
|
|
|
|
|
|
Action php56-fastcgi /php-cgi-bin/php56-wrapper |
|
|
|
|
|
|
|
Alias /php-cgi-bin/php56-wrapper /var/www/php-cgi-bin/php56-wrapper |
|
|
|
|
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php56-wrapper -socket /var/run/php-fpm/php56.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# PHP 7.0 |
|
|
|
foreach my $ver ('', '56', '70', '71'){ |
|
|
|
Action php70-fastcgi /php-cgi-bin/php70-wrapper |
|
|
|
$OUT .=<<_EOF; |
|
|
|
Alias /php-cgi-bin/php70-wrapper /var/www/php-cgi-bin/php70-wrapper |
|
|
|
|
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php70-wrapper -socket /var/run/php-fpm/php70.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# PHP 7.1 |
|
|
|
Action php$ver-fastcgi /php-cgi-bin/php$ver-wrapper |
|
|
|
Action php71-fastcgi /php-cgi-bin/php71-wrapper |
|
|
|
Alias /php-cgi-bin/php$ver-wrapper /var/www/php-cgi-bin/php$ver-wrapper |
|
|
|
Alias /php-cgi-bin/php71-wrapper /var/www/php-cgi-bin/php71-wrapper |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php$ver-wrapper -socket /var/run/php-fpm/php$ver.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php71-wrapper -socket /var/run/php-fpm/php71.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Shared Folders |
|
|
|
|
|
|
|
_EOF |
|
|
|
_EOF |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$OUT .= "# Shared Folders\n"; |
|
|
|
|
|
|
|
|
|
|
|
foreach my $share ($a->get_all_by_prop(type => 'share')){ |
|
|
|
foreach my $share ($a->get_all_by_prop(type => 'share')){ |
|
|
|
next if ($share->prop('DynamicContent' || 'disabled') ne 'enabled'); |
|
|
|
next if ($share->prop('DynamicContent' || 'disabled') ne 'enabled'); |
|
|
|
my $key = $share->key; |
|
|
|
my $key = $share->key; |
|
|
@ -46,18 +40,22 @@ _EOF |
|
|
|
$socket = "php$ver-$custom.sock"; |
|
|
|
$socket = "php$ver-$custom.sock"; |
|
|
|
} |
|
|
|
} |
|
|
|
$OUT .=<<_EOF; |
|
|
|
$OUT .=<<_EOF; |
|
|
|
|
|
|
|
|
|
|
|
Action php$key-fastcgi /php-cgi-bin/php$key-wrapper |
|
|
|
Action php$key-fastcgi /php-cgi-bin/php$key-wrapper |
|
|
|
Alias /php-cgi-bin/php$key-wrapper /var/www/php-cgi-bin/php$key-wrapper |
|
|
|
Alias /php-cgi-bin/php$key-wrapper /var/www/php-cgi-bin/php$key-wrapper |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php$key-wrapper -socket /var/run/php-fpm/$socket -pass-header Authorization -idle-timeout 120 |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php$key-wrapper -socket /var/run/php-fpm/$socket -pass-header Authorization -idle-timeout 120 |
|
|
|
|
|
|
|
|
|
|
|
_EOF |
|
|
|
_EOF |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$OUT .= "# Custom PHP pools\n"; |
|
|
|
$OUT .= "# Custom PHP pools\n"; |
|
|
|
|
|
|
|
|
|
|
|
foreach my $pool ($p->get_all_by_prop(type => 'pool')){ |
|
|
|
foreach my $pool ($p->get_all_by_prop(type => 'pool')){ |
|
|
|
next if (($pool->prop('status') || 'enabled') ne 'enabled'); |
|
|
|
next if (($pool->prop('status') || 'enabled') ne 'enabled'); |
|
|
|
my $key = $pool->key; |
|
|
|
my $key = $pool->key; |
|
|
|
my $ver = $pool->prop('Version') || ''; |
|
|
|
my $ver = $pool->prop('Version') || ''; |
|
|
|
$OUT .=<<_EOF; |
|
|
|
$OUT .=<<_EOF; |
|
|
|
|
|
|
|
|
|
|
|
Action php$key-fastcgi /php-cgi-bin/php$key-wrapper |
|
|
|
Action php$key-fastcgi /php-cgi-bin/php$key-wrapper |
|
|
|
Alias /php-cgi-bin/php$key-wrapper /var/www/php-cgi-bin/php$key-wrapper |
|
|
|
Alias /php-cgi-bin/php$key-wrapper /var/www/php-cgi-bin/php$key-wrapper |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php$key-wrapper -socket /var/run/php-fpm/php$ver-$key.sock -pass-header Authorization -idle-timeout 120 |
|
|
|
FastCgiExternalServer /var/www/php-cgi-bin/php$key-wrapper -socket /var/run/php-fpm/php$ver-$key.sock -pass-header Authorization -idle-timeout 120 |
|
|
|