vi /var/cpanel/easy/apache/rawopts/Apache2_4 Add : --enable-proxy-fcgi=static vi /var/cpanel/easy/apache/rawopts/all_php5 Add : --enable-fpm --with-mysqli=mysqlnd --with-mysql=mysqlnd /scripts/easyapache Must use Apache 2.4.9 or higher, PHP 5.4 or higher "Proxy" Must be enabled cp /var/cpanel/templates/apache2_4/vhost.default /var/cpanel/templates/apache2_4/vhost.local vi /var/cpanel/templates/apache2_4/vhost.local Add : ProxyPassMatch ^/(.*\.php?)$ unix:/tmp/[% vhost.user %].sock|fcgi://localhost[% vhost.documentroot %]/ Above [% IF supported.mod_suphp -%] ln -s /usr/local/sbin/php-fpm /bin/php-fpm mkdir -p /var/log/php-fpm/ vi /scripts/postwwwacct ----------------- #!/usr/bin/perl -w use strict; use warnings; use Getopt::Long; sub shell_exec { my $exec = shift; my $ret = ""; local *PH; open(PH,"$exec |") || die "Can't exec $exec: $!"; while() { $ret .= $_; } close(PH); return($ret); } my %OPTS = @ARGV; my $username = $OPTS{'user'}; my $domain = $OPTS{'domain'}; my $file_id = '/opt/php-fpm-pools/id_list'; open FILE, $file_id or die "Couldn't open file: $!"; binmode FILE; my $id = ; close FILE; chomp($username); chomp($domain); chomp($id); my $file = $username . ".conf"; my $userid = $username . $id; shell_exec("/bin/cp /opt/php-fpm-pools/default.conf /etc/php-fpm.d/$file"); shell_exec("/usr/bin/replace {~userid~} $userid -- /etc/php-fpm.d/$file"); shell_exec("/usr/bin/replace {~id~} $id -- /etc/php-fpm.d/$file"); shell_exec("/usr/bin/replace {~user~} $username -- /etc/php-fpm.d/$file"); my $idnew = $id + 1; open (MYFILE,">", '/opt/php-fpm-pools/id_list'); print MYFILE "$idnew"; close (MYFILE); shell_exec("/etc/init.d/php-fpm restart"); shell_exec("/etc/init.d/httpd restart"); exit; ----------------- chmod 755 /scripts/postwwwacct mkdir /opt/php-fpm-pools/ cd /opt/php-fpm-pools/ wget http://projects.darksideofperfection.com/WHM_confs/default.conf wget http://projects.darksideofperfection.com/WHM_confs/id_list cd /etc/init.d/ wget http://projects.darksideofperfection.com/WHM_confs/php-fpm (replace the file if it already exists) cd /etc/ wget http://projects.darksideofperfection.com/WHM_confs/php-fpm.conf ln -s /etc/php-fpm.conf /usr/local/etc/php-fpm.conf mkdir -p /etc/php-fpm.d vi /scripts/postkillacct -------------------------- #!/usr/bin/perl -w use strict; use warnings; use Getopt::Long; sub shell_exec { my $exec = shift; my $ret = ""; local *PH; open(PH,"$exec |") || die "Can't exec $exec: $!"; while() { $ret .= $_; } close(PH); return($ret); } my %OPTS = @ARGV; my $username = $OPTS{'user'}; chomp($username); my $file = $username . ".conf"; shell_exec("/bin/rm -f /etc/php-fpm.d/$file"); shell_exec("/etc/init.d/php-fpm restart"); exit; chmod 755 /scripts/postkillacct