How to install mod_lsapi for apache without running CloudLinux

mod_lsapi was specially developed by CloudLinux to run as an apache module. The module is based on LiteSpeed Technologies API for PHP, Python and Ruby. Compared to the traditional mod_php module it offers excelent PHP performance, great security and support for opcode caching. More, the memory consumption is really low.

You can find a complete list of specs and details on CloudLinux Documentation:

According to CloudLinux the requirements to run mod_lsapi are as follows:

linux CentOS + CloudLinux
– Alt-PHP
– Apache compiled with SuExec support
– mod_ruid2 has to be disabled
– apache itk has to be disabled

Since I was curios to test it and I didn’t want to use on our production servers which have CloudLinux installed, I tried to install it on a regular CentOS 6.7 machine (no CloudLinux installed or running).

And I did it!

mod_lsapi: Step by step installation instructions:

Step 1) download the source code:

Step 2) download the .rpm files needed for dependencies in order to be able to compile mod_lsapi from source

Step 3) check if you have installed cmake (needed to compile); if not please install cmake using:

Step 4) extract files from archive, compile, install plugin

Step 5) Install and configure PHP Support for LiteSpeed

Step 6) Create a temporary directory for lsphp

Step 7) Be sure that your apache server is running as apache/apache (user/group). You can check that by looking in /etc/httpd/conf/httpd.conf.

Step 8) If your website files are in /var/www/html let’s say and they have different owner/group than apache:apache set them accordingly

Step 9) Disable mod_php or other settings for php (I was using mod_php so I had to disable the module loading into apache)

Step 10) Modify some settings for the lsapi module (/etc/httpd/conf.d/mod_lsapi.conf)

Save the file when you’re done.

Step 11) Restart apache
# /etc/init.d/httpd restart

In order to check if you have a running php config, check your php information in a web browser.

Point your web browser to http://your_server_ip_or_hostname/info.php

You should see something like this: Server API LiteSpeed V6.8

Have fun!

  • User Ratings (5 Votes)

About Author

I am a linux passionate and currently working as a Linux Senior System Administrator. I also am a freelancer and help people to complete different jobs. You can hire me on


  1. Hello!
    Thanks for the manual, it’s really helpful.
    But, trying to restart apache after I’ve done the instructions gives me the following:
    /etc/init.d/httpd restart

    httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/ into server: /etc/httpd/modules/ undefined symbol: lscapi_set_recoverable_error

    Could you please tell me in what way to solve this issue?
    PHP and Apache both was compiled manualy. If there is will be need in compile options I’ll provide it in next message.
    Thanks again!

  2. Honestly I really don’t know. The module was developed by the guys from Cloudlinux. As far as I know Cloudlinux is developed on the CentOS system. Debian is a little bit different.

    What is the error that you get after the .rpm to .deb conversion? Did you manage to compile the module and the module is not working or you can’t compile it?

  3. Hello,
    This is a very interesting article. The problem here is you are helping people steal commercial technology. This software is part of CloudLinux which is commercial. So companies using your technique to steal the IP are potentially putting themselves into Legal Jeopardy.

    • It’s an interesting point of view. Even so, it was merely a guide and was not intended to steal anything from anyone. At that time Cloudlinux could have been used even after the trial as long as it was installed on a server (with no updates of course). The guide was strictly working, at that time on CentOS 6 which is not possible anymore since they use different licensing system. It never worked on CentOS as far as I know. I could have probably added some disclaimer at the end of the article but taking into consideration how many youtube videos and million of articles are there teaching people how to crack software, how to brute force passwords, how to scan severs and so on, I thought that my article is pretty innocent. I’ll update the article and add a disclaimer anyway…

Leave A Reply

Get new posts by email: