You can use FREE cpXstack plugin for load balance between webservers and PHP. its provide an alternate web server and PHP stack with an option to switch the web server to nginX which process PHP scripts via FastCGI protocol using PHP-FPM and Apache.
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. Both Nginx and php-fpm will give better performance for your websites.
FREE cpanel cpXstack plugin Nginx and PHP-FPM to reduce server loads.
cpXstack cpanel plugin advantages
- cpXstack module limit the maximum number of PHP process per user.
- Nginx’s event-driven approach can provide more predictable performance under high loads, thereby enabling admins to reduce server load and scale server resources.
- Nginx consumes lesser RAM while comparing with Apache HTTPD thereby helping admins to efficiently utilize the servers primary memory.
- PHP-FPM has more features than other FastCGI implementations and is used by many highload installations.
- Provide multiple versions of PHP to the end users
- cpXstack a clean install and uninstall – the plugin does not make significant changes to your cpanel/other service configuration and once uninstalled brings back the system into the same system configuration as before.
- For an end user can change nginX+PHP-FPM instead of Apache/PHP and switch between PHP versions.
- Faster page loads for static files and dynamic PHP content due to the inherent design features of nginX and PHP-FPM.
Before proceed, please make sure the following requirements.
Cpanel version 11.31 or greater
Devel packages to compile PHP from source
CPXstack will install Nginx from yum repo and incron from the EPEL repo. PHP and cpXstack files will be installed to /opt/pifpm directory. Normall cpxstack installation will take some time depending on your previous accounts and performance.
It is strongly advised that you perform the install in a screen
wget http://sysally.net/pifpm/cpxstack.sh chmod a+x cpxstack.sh ./cpxstack.sh install
Once installation completed, check your WHM -> Plugins.
For cpanel users cPanel -> Softwares/ Services
You can regenerate a users config files by running the following command from the command line
cd /opt/pifpm/scripts ./looper.sh USERNAME