Getting started with CloudLinux OS

Apache mod_lsapi is a module based on LiteSpeed Technologies API for PHP. It offers excellent PHP performance, low memory footprint coupled with great security and support for opcode caching.

Using LSAPI, we have seen higher performance than Apache with mod_php, easier installation than php-fpm and easier integration with any control panel. LSAPI means faster and more stable dynamic web pages.

It requires:

  • CageFS
  • Alt-PHP packages
  • Apache with SuExecuUserGroup directive for each user's VirtualHost
  • Disabled mod_ruid2 and apache_itk

Installation is different for servers with EasyApache 3 and EasyApache 4. The easiest way to check EA version is to run:

/scripts/easyapache --version

If EA3 used the “Easy Apache v3.34.4” will be reported.
If EA4 used the “EasyApache3 is not available when EasyApache4 is in effect” will be reported.

 

Mod_lsapi installation with EasyApache 3:

Install packages, make initial setup and update cagefs:

yum install liblsapi liblsapi-devel 
yum install mod_lsapi
/usr/bin/switch_mod_lsapi --setup
cagefsctl --force-update

Enable liblsapi for single domain:

/usr/bin/switch_mod_lsapi --enable-domain yourdomain.tld

Or for all domains at once:

/usr/bin/switch_mod_lsapi --enable-global

Then restart apache:

service httpd restart

Used configuration file:
/usr/local/apache/conf/conf.d/lsapi.conf

 

Mod_lsapi installation with EasyApache 4:

Choose ready profile with mod_lsapi named with “+mod_lsapi” from WHM > Software > EasyApache 4.

Or in console, Install packages, make initial setup and update cagefs:

yum install liblsapi liblsapi-devel 
yum install ea-apache24-mod_lsapi
/usr/bin/switch_mod_lsapi --setup
cagefsctl --force-update

Enable liblsapi for single domain:

/usr/bin/switch_mod_lsapi --enable-domain yourdomain.tld

Or for all domains at once:

/usr/bin/switch_mod_lsapi --enable-global

Then restart apache:

service httpd restart

Used configuration file: /etc/apache2/conf.d/lsapi.conf

 

Additional configuration

The default settings are suitable for most web servers. Useful directives that you may want to change to tune up liblsapi:

lsapi_backend_children - maximum number of simultaneously running children backend processes. Default value is 80. Increase to speed up response time.

lsapi_backend_pgrp_max_idle - how long a control backend process will wait for a new request before it exits, in seconds. Default value is 30. Increase to make faster response; decrease to minimize memory usage.

lsapi_backend_max_process_time - the maximum processing time allowed when processing a request, in seconds. Should match max_execution_time in php.ini settings.

lsapi_backend_max_idle - how long a backend child process will wait for a new request before it exits, in seconds. Increase for better websites performance. Default is 300.

lsapi_backend_max_reqs - how many requests each child process will handle before it exits automatically. Default is 10000.

 


  • cPanel

  

Please share your suggestions & tips that could be useful for other readers – we will review all posts and publish selected.

0
 

Comments

  • No comments found