Categories: Apache

Mod_lsapi for Apache

For many years, Apache has been enjoying the numero uno position in the web server market with IIS at second place According to Netcraft, Apache’s market share is over 37% and IIS’ market share is over 33%. There are other web servers slowly gaining hold in the market.

While Apache has been the most obvious choice for hosters and system administrators, it is very slow compared to many other web servers while serving PHP pages. I have listed a few options to run PHP under Apache with their limitations.
RUID2 + mod_php – is a giant security hole that lets any user get a root account
MPM ITK – is very slow, as it kills processes after each request
suPHP & CGI – are both slow, as they start PHP on each request. They are also incompatible with opcode caching.
FastCGI – creates a lot of stability issues, hard to configure due to the way it handles processes, and doesn’t use opcode caching optimally.
PHP FPM – needs a socket/startup per customer, not that stable with Apache and creates a mess when tried to integrate it with PHP Selector – as now PHP selector would have to restart PHP FPM processes.

In the web hosting market, another web server is slowly gaining foothold and it is Litespeed. Litespeed is one of the fastest web servers and it supports all the directives of Apache and thus proves to be the ideal replacement to Apache. Litespeed has its own module called lsphp to serve PHP Pages and also the Litespeed API is much faster than Apache and uses very less resources. The only downside of Litespeed is its price against the free Apache which prevents hosters to switch to Litespeed. Litespeed also has its open source version but it is not compatible with cPanel, DirectAdmin and Plesk and hence cannot be used in shared hosting servers.

Luckily, CloudLinux has used a few parts of PHP process management and communication protocol open sourced by Litespeed Tech and developed mod_lsapi, an Apache Module to serve PHP. While Apache is still slower than Litespeed API, mod_lsapi makes serving PHP faster.

Some of the benefits of mod_lsapi comparing to other ways to serve PHP are listed down in CloudLinux’s blog:

  • Speed – it is faster than any other way to serve PHP with Apache
  • Stability – it doesn’t suffer from stability issues in process management like PHP FPM
  • Utilizes full benefits of opcode caching
  • MPM Worker & Event compatible
  • Support for PHP directives in .htaccess files
  • Drop in replacement for existing ways to serve PHP
  • Fully compatible with PHP Selector

The software is currently in beta stage, and you can find more info on how to deploy it here:
http://docs.cloudlinux.com/index.html?apache_mod_lsapi.html

Nitesh Shah

Share
Published by
Nitesh Shah

Recent Posts

How to setup first Azure Virtual Machine?

Setting up your first Azure Virtual Machine can be done by following these steps: Create…

1 year ago

How to setup Amazon Cloudfront and S3 to serve static resources

Amazon CloudFront is a content delivery network (CDN) that helps you serve static content such…

1 year ago

Step-By-Step Guide To Setting Up An AWS Application Load Balancer

Step-By-Step Guide To Setting Up An AWS Application Load Balancer Are you looking for a…

1 year ago

How to restore MySQL database from .frm and .ibd files?

MySQL databases often get corrupted due to issues like hardware failure, file system failure etc.…

4 years ago

SQL Server Replication

SQL Server Replication is the process of copying databases from one node to another to…

5 years ago

101 System Admin Tools to make life easy

Here are 101 System Admin tools which make System Admins' life easy.

7 years ago

This website uses cookies.