LiteSpeed Web Server serves as a perfect fit for hosting environments, providing superior performance and security. It is a robust web hosting ecosystem when used with CloudLinux and cPanel. Learn the installation and configuration of LiteSpeed Web Server with a trial license on a CloudLinux server managed by cPanel/WHM.
To install LiteSpeed on a Linux server, make sure that your server meets these requirements:
LiteSpeed Web Server is fully compatible with various Linux distributions, including AlmaLinux 8, AlmaLinux 9, CloudLinux 7, and CloudLinux 8. These operating systems ensure your web hosting operating environments will be stable and secure and contribute to giving your LiteSpeed operating environment maximum performance. To start, make sure the server you’re planning to use is running one of the supported distributions so you don’t have compatibility issues and confirm simple integration.
Verify your cPanel/WHM license with the following command:
/usr/local/cpanel/cpkeyclt
Update and verify your cPanel license on the licensing server with this command. It is very important to be sure that you have a valid license so that you can access cPanel features and updates.

Request a 15-day trial license for LiteSpeed Web Server:
Navigate to the LiteSpeed Trial License Page using your browser. This page allows you to request a 15-day trial license for the LiteSpeed Web Server. It allows you to fill out the details as a user, start working with LiteSpeed’s features, and see its benefits without much work.

Please fill in the requested details on the form. Include your first name, last name, company name, and a valid email address. These details provide proper registration for the trial license and allow LiteSpeed to send your activation details. Please ensure accuracy to avoid delays in receiving the license.

Once submitted, you’ll receive a confirmation on the website stating the trial license has been sent to your email address. Check your inbox for detailed instructions on activating the license. If needed, contact LiteSpeed support for further assistance with installation or setup.

Before installation, update your server and install the necessary tools.
For CloudLinux 7,8 and AlmaLinux 8, 9:
sudo yum update -y
to download and apply the latest updates from the CloudLinux repository. Keeping your system updated provides stability, resolves security vulnerabilities, and prepares the server for LiteSpeed installation by minimizing compatibility issues during setup.

sudo yum install wget tar curl -y
To install essential tools like wget, tar and curl. Not only does it download the necessary files, but It also extracts and interacts with files; these utilities are critical to the process of LiteSpeed installation. If these dependencies are not available, then the installation can get interrupted.

Download and execute the LiteSpeed installation script:
Use the command
bash <( curl https://get.litespeed.sh ) your_serial_no
Toegin the LiteSpeed Web Server installation. To activate the full version, replace your_serial_no with your provided license key. This script automatically fetches and installs LiteSpeed, streamlining the setup process.
Install with a Trial License:
To start with a trial of LiteSpeed, replace it with
bash <( curl https://get.litespeed.sh ) TRIAL
This command will request and activate a 15-day trial license while installing LiteSpeed on your server. It’s an excellent option for evaluation without committing to a full license.

Access the WHM (Web Host Manager) dashboards. WHM is the control panel for managing server configurations, making it the gateway to enabling LiteSpeed for your cPanel hosting.
In the WHM menu, locate the “Plugins” section within the left-hand interface. Select “LiteSpeed Web Server” from the list of installed plugins. Here it is all LiteSpeed-specific configurations and controls are available.

In the LiteSpeed Web Server plugin dashboard, click on the “Switch to LiteSpeed” button. It will replace Apache with LiteSpeed as the default web server, optimizing performance and introducing advanced caching capabilities for your hosted websites.

Switch to LiteSpeed:
After clicking “Switch to LiteSpeed,” Apache is replaced with LiteSpeed as the active web server seamlessly, and all in one shot without any further intervention required — no migrations, no downtime, no troubleshooting needed for your site, and no actions required by you. It is an action with the aim of improving server efficiency and reducing the consumption of resources so that website hosting runs faster and more efficiently.
Once the switch is complete, a confirmation message appears, highlighting that LiteSpeed is now active, Apache has stopped, and the configuration has been updated. This process ensures that the server is not running with conflicts and it is running LiteSpeed.

LiteSpeed will automatically import the Apache virtual host config. It can be verified and fine-tuned:
Navigate to WHM and access the LiteSpeed WebAdmin Console to manage virtual host configurations. This console provides an intuitive interface for overseeing server settings and optimizing hosting performance. Check if all Apache virtual host configurations are accurately imported and fine-tuned for seamless integration with LiteSpeed Web Server.

Go to the LiteSpeed WebAdmin Console “Configuration” tab and select Virtual hosts. In this section, you can review and manage domains that were imported from Apache configurations. Make sure the settings of your domain match your server’s performance and security requirements.

The Virtual Host List in LiteSpeed Web Server is where imported or manually configured virtual hosts appear. Each entry displays the Virtual Host Name, the root directory for hosting files, and actions like managing or editing configurations. Use this interface to monitor or adjust domain-specific hosting settings.

Enable CageFS for user isolation:
Log into the Web Host Manager (WHM) using your administrator credentials. Server configurations are under the central control of WHM. With this step, we will have access to the required settings for enabling and configuring CageFS with LiteSpeed. This process allows us to isolate the user and customize the system as needed.
Navigate to the “CloudLinux” section within WHM and select “CageFS” from the available options. Tools like CageFS, which is required for managing the user environment, are included in this section. By accessing this feature, you can also configure and fine-tune user isolation.

Check if CageFS is enabled for every user on the server. This step amplifies security, as each user is ‘secured’ in its environment: Each user cannot access or affect the others. Like LiteSpeed, this feature is supported in full on LiteSpeed, making it a more seamless integration for better performance and protection.

You can access the Web Host Manager (WHM) by entering your server’s IP address followed by port 2087 (e.g., https://your-server-ip:2087). Use your root credentials while at the same time gaining administrative control over server configurations.
Once inside WHM, locate the “Plugins” section in the menu. Click on “LiteSpeed Web Server” to view the LiteSpeed configuration page and verify that LiteSpeed is running as the default web server.

In WHM, find the LiteSpeed Web Server area, then check whether LiteSpeed is running. A clear status shows that the web server is running to ensure successful installation and efficient functioning as the default web server.

Verify LiteSpeed logs for errors:
Use the command
cat /usr/local/lsws/logs/error.log
To inspect LiteSpeed’s error logs. This step provides detailed server error messages to help diagnose potential issues or configuration errors.
Restart LiteSpeed:
Run
/usr/local/lsws/bin/lswsctrl restart
to restart LiteSpeed.

This command refreshes the server, applying configuration changes or resolving minor issues without requiring a complete system reboot.
Take advantage of cloudlinux’s unique features:


Access your WordPress admin dashboard, navigate to the plugin section, and search for “LiteSpeed Cache.” Install and activate the plugin to enable seamless website optimization.

Log in to WHM, and go to LiteSpeed Web Server > Cache Management. This section allows you to configure cache-related settings for all domains on your server.
Locate the specific domain in the LiteSpeed Cache Management section and enable caching. This step ensures efficient content delivery and reduces server load.
Open the LiteSpeed Cache plugin settings in WordPress. Adjust settings like page optimization, image compression, and CDN integration to suit your performance and user experience needs.
One common issue is websites failing to load after switching to LiteSpeed.
Solution:
/usr/local/lsws/bin/lswsctrl status
This command will print the current status of LiteSpeed. It won’t work, unless the server is not running, then restart the server to enable it. The root cause of websites not loading is often not because websites ‘are not’ loading, but rather that there is no server for the websites even to load on. Test if the server is working smoothly.

If your websites are not functioning correctly after switching to LiteSpeed, checking the error logs can help identify misconfigurations. Use the command:
cat /usr/local/lsws/logs/error.log
This command will show Lite-Speed error logs that detail common problems. But also find errors like incorrect file paths, wrong permissions, or conflicts in configurations. Solutions to these issues will make the website work normally. Making sure your server is running fine regarding issues is by regularly reviewing error logs.

LiteSpeed Web Server’s integration with CloudLinux and cPanel creates a powerful, high-performance hosting solution. Following this guide, you’ve installed LiteSpeed with a trial license, integrated it with cPanel, and optimized it with CloudLinux features such as CageFS and LVE.
For additional resources, consult LiteSpeed Documentation and CloudLinux Documentation.

Vinayak Baranwal wrote this article. Use the provided link to connect with Vinayak on LinkedIn for more insightful content or collaboration opportunities.