Changes

Jump to navigation Jump to search
897 bytes added ,  06:25, 5 February 2023
Line 420: Line 420:  
You can write your own fragment in /etc/e-smith/templates-custom/etc/php-fpm.d/custom.conf/ e.g. /etc/e-smith/templates-custom/etc/php-fpm.d/custom.conf/15mypool
 
You can write your own fragment in /etc/e-smith/templates-custom/etc/php-fpm.d/custom.conf/ e.g. /etc/e-smith/templates-custom/etc/php-fpm.d/custom.conf/15mypool
   −
You will also need to write a httpd fragment similarly to what shown just above, or if this is a dedicated pool you need to your custom needs for your ibay, you can force the ibay to use it by doing :<syntaxhighlight lang="bash">
+
You will also need to write a httpd fragment similarly to what shown just above.
 +
 
 +
Here is an example if you want a custom pool for your ibay, in /etc/e-smith/templates-custom/etc/php-fpm.d/ibays.conf/15MYIBAY<syntaxhighlight lang="perl">
 +
{
 +
 
 +
use esmith::AccountsDB;
 +
use esmith::php;
 +
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database";
 +
my $ibay = $a->get("MYIBAY");
 +
  my $version            = PhpFpmVersionToUse($ibay);
 +
  my $dynamic            = $ibay->prop('CgiBin') || 'disabled';
 +
  my $custom              = $ibay->prop('CustomPool') || undef;
 +
  next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && $custom);
 +
  my $key                = $ibay->key;
 +
  my $name                = lc $key;
 +
  my $pool_name          = 'php' . $version . '-' . $name;
 +
  $OUT .=<<"_EOF" if ($version eq $PHP_VERSION);
 +
 
 +
[$pool_name]
 +
user = www
 +
group = www
 +
listen.owner = root
 +
listen.group = www
 +
listen.mode = 0660
 +
listen = /var/run/php-fpm/$pool_name.sock
 +
;
 +
;
 +
;put whatever you need there
 +
;
 +
;
 +
_EOF
 +
}
 +
 
 +
</syntaxhighlight>
 +
 
 +
You have then to force the ibay to use it by doing :<syntaxhighlight lang="bash">
 
db accounts MYIBAY setprop CustomPool enabled
 
db accounts MYIBAY setprop CustomPool enabled
 
</syntaxhighlight>This will prevent the generation of the default ibay pool in  ibays.conf , and let you use /var/run/php-fpm/php$version-$name.sock socket from your template-custom... or from the db php using the same key as the name of the ibay.
 
</syntaxhighlight>This will prevent the generation of the default ibay pool in  ibays.conf , and let you use /var/run/php-fpm/php$version-$name.sock socket from your template-custom... or from the db php using the same key as the name of the ibay.
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,250

edits

Navigation menu