Possibility to use a custom PHP pool per share

tags/0.0.1_0.fc26_el6
Daniel Berteaud 8 years ago
parent d7656b699c
commit 3f76ffa141
  1. 8
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/68FastCGIConfig
  2. 3
      root/etc/e-smith/templates/etc/php-fpm.d/shares.conf/10Shares

@ -39,10 +39,16 @@ _EOF
next if ($share->prop('DynamicContent' || 'disabled') ne 'enabled'); next if ($share->prop('DynamicContent' || 'disabled') ne 'enabled');
my $key = $share->key; my $key = $share->key;
my $ver = $share->prop('PHPVersion') || ''; my $ver = $share->prop('PHPVersion') || '';
my $socket = "php$ver-$key.sock";
my $custom = $share->prop('PHPCustomPool') || undef;
if ($custom){
$ver = $p->get($custom)->prop('Version') || '';
$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/php$ver-$key.sock -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
# Custom PHP pools # Custom PHP pools

@ -6,7 +6,8 @@ my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database"
foreach my $share ($a->get_all_by_prop(type => 'share')){ foreach my $share ($a->get_all_by_prop(type => 'share')){
my $version = $share->prop('PHPVersion') || ''; my $version = $share->prop('PHPVersion') || '';
my $dynamic = $share->prop('DynamicContent') || 'disabled'; my $dynamic = $share->prop('DynamicContent') || 'disabled';
next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION); my $custom = $share->prop('PHPCustomPool') || undef;
next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && !$custom);
my $key = $share->key; my $key = $share->key;
my $pool_name = 'php' . $version . '-' . $key; my $pool_name = 'php' . $version . '-' . $key;
my $memory_limit = $share->prop('PHPMemoryLimit') || '128M'; my $memory_limit = $share->prop('PHPMemoryLimit') || '128M';

Loading…
Cancel
Save