Introduction

LiteSpeed Web Server is a high-performance, lightweight alternative to Apache, offering improved performance and scalability. This guide will walk you through installing LiteSpeed on a cPanel/WHM server. Choose from various core configurations (2-core, 4-core, 8-core, or x-core) based on your server requirements.

Steps to Install LiteSpeed on cPanel/WHM

Step 1: Install LiteSpeed WHM Plugin

To begin, install the LiteSpeed WHM plugin. Execute the following commands via SSH as the root user:

cd /usr/src
wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh
sh ./lsws_whm_plugin_install.sh
rm -f lsws_whm_plugin_install.sh
        

Note: To uninstall the WHM LiteSpeed plugin, run the following command:

/usr/local/cpanel/whostmgr/docroot/cgi/lsws/lsws_whm_plugin_uninstall.sh

Step 2: Install LiteSpeed Web Server from WHM

  1. Log in to WHM and navigate to the “Plugins” section.
  2. Click on “LiteSpeed Web Server Plugin for WHM.”
  3. Select “Install LiteSpeed Web Server” and complete the form by providing the following details:
  • Trial license key or serial number
  • Target installation directory
  • Port Offset (set to 0 to replace Apache or a value like 2000 to test LiteSpeed on a different port, e.g., 2080)
  • Enable PHP SuEXEC (optional)
  • Admin console username and password
  • Administrator email address

Click “Next” to start the installation. If you set the Port Offset to 0, LiteSpeed will stop Apache and start as the primary web server upon successful installation.

Step 3: Build Matching PHP Binary

LiteSpeed comes with a pre-built PHP 4 binary, but it is recommended to build a PHP binary that matches the configuration used by Apache’s mod_php.

If LiteSpeed is running, switch back to Apache by clicking the “Switch to Apache” link in WHM. Then, click “Build Matching PHP Binary” to begin the process. This step may take some time to complete.

Step 4: Start LiteSpeed

After building the PHP binary, restart LiteSpeed by clicking “Restart LiteSpeed” in the WHM plugin. Verify that LiteSpeed is functioning as expected.

If the Port Offset was set to a non-zero value, you can replace Apache by selecting the “Switch to LiteSpeed” option in WHM.

Conclusion

LiteSpeed offers improved performance and reliability for cPanel/WHM servers, making it an excellent choice for web hosting environments. Follow these steps to integrate LiteSpeed seamlessly with your server, ensuring optimized operations for your websites.