The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php-fpm pool per virtual host?

Discussion in 'General Discussion' started by rstefanov, Oct 7, 2013.

  1. rstefanov

    rstefanov Registered

    Joined:
    Oct 7, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello,

    I am wondering if it is possible to configure cpanel and php-fpm with different pool per virtual host?

    Atm I am using configuration similar to this post https://forums.cpanel.net/f189/php-fpm-fastcgi-apc-293802.html#post1224672 It works pretty well. However, for security reasons I would like to configure each virtual host with different php-fpm pool. Is there anything you can suggest?

    Also, if there is no such tool/plugin or w/e, could you tell me how to apply a custom configuration for a specific virtualhost? For example:

    Code:
    LoadModule fastcgi_module modules/mod_fastcgi.so
    
    <IfModule mod_fastcgi.c>
            FastCGIExternalServer /usr/sbin/php-fpm -host 127.0.0.1:9000
            AddHandler php-fastcgi .php
    
            #<LocationMatch "/status">
            #  SetHandler php-fastcgi-virt
            #  Action php-fastcgi-virt /usr/sbin/php-fpm.fcgi virtual
            #</LocationMatch>
    
            Action php-fastcgi /usr/sbin/php-fpm.fcgi
            ScriptAlias /usr/sbin/php-fpm.fcgi /usr/sbin/php-fpm
    
            <Directory /usr/sbin>
            Options ExecCGI FollowSymLinks
            SetHandler fastcgi-script
            Order allow,deny
            Allow from all
            </Directory>
    </IfModule>
    I would like to change tcp ports per virtual host individually, or even use unix sockets:

    FastCGIExternalServer /usr/sbin/php-fpm -host 127.0.0.1:9000
    to
    FastCGIExternalServer /usr/sbin/php-fpm -host 127.0.0.1:9001

    So where can I set up custom tcp port for vh? Can I just reuse that snippet at /usr/local/apache/conf/userdata/std/2/$user/$domain/$includename.conf or?

    Thanks!
     
  2. gnusys

    gnusys Active Member

    Joined:
    Jan 18, 2013
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Hi,

    You can use /https://support.sysally.net/projects/cphstack to get seperate pool per user
     
Loading...

Share This Page