HostCart
All articles
Web Panel

Mastering LiteSpeed: Step‑by‑Step Configuration for a Multi‑cPanel Master‑Slave Environment

Running multiple cPanel servers in a master‑slave setup dramatically boosts scalability and uptime, and adding LiteSpeed Web Server injects event‑driven speed, built‑in caching, and seamless cPanel integration. This guide walks you through installing and syncing LSWS across all nodes, ensuring a synchronized, high‑performance environment that delivers lightning‑fast page loads and robust redundancy.

5 min read
Mastering LiteSpeed: Step‑by‑Step Configuration for a Multi‑cPanel Master‑Slave Environment

Running multiple cPanel servers in a master‑slave configuration dramatically improves scalability, redundancy, and performance for hosting providers. Adding LiteSpeed Web Server (LSWS) brings the speed of an event‑driven architecture, built‑in caching, and seamless compatibility with cPanel’s management tools. This guide walks you through installing and configuring LiteSpeed on both the master and its slave nodes, creating a synchronized environment that maximizes uptime and delivers lightning‑fast page loads.

1. Prepare Your cPanel Master‑Slave Cluster

1.1 Verify cPanel Versions and Licensing

  • Both master and slave must run the same major cPanel & WHM version (e.g., 115 or newer).
  • Each server needs a valid cPanel license; the slave can use a reseller or dedicated license as your agreement permits.
  • Enable the cPanel Cluster/Sync feature (WHM → Cluster/Sync Settings).

1.2 Network and DNS Considerations

  1. Assign static IP addresses to every node and update /etc/hosts so the master can resolve each slave by hostname.
  2. Configure reverse DNS (PTR) for every IP to avoid mail‑delivery problems.
  3. If you use an external DNS provider, create A records for the master and each slave, then add them to the ns1/ns2 entries in the cPanel DNS cluster.

1.3 Synchronize System Packages

Before installing LiteSpeed, ensure the underlying OS packages are identical on all nodes. Run the appropriate command on both servers:

# CentOS / RHEL
yum update -y

# Ubuntu / Debian
apt-get update && apt-get upgrade -y

Consistent packages prevent mismatched libraries that could break LSWS modules later.

2. Install LiteSpeed Web Server on the Master Node

2.1 Obtain a LiteSpeed License

Purchase a LiteSpeed Enterprise license (or use the free OpenLiteSpeed for testing). After purchase you’ll receive a license key and a license.key file. Place this file in /usr/local/lsws/conf/ on the master.

2.2 Run the Official Installation Script

Log in as root and execute:

wget https://www.litespeedtech.com/packages/lsws/install.sh
chmod +x install.sh
./install.sh

The script prompts for:

  • Installation directory – keep the default /usr/local/lsws.
  • Admin password – choose a strong password for the LSWS admin console.
  • Port selection – the defaults (HTTP 80, HTTPS 443) are fine unless you need custom ports.

2.3 Integrate LiteSpeed with cPanel

cPanel provides an official LiteSpeed plugin that handles Apache‑to‑LiteSpeed conversion, virtual‑host syncing, and service restarts.

  1. Download the plugin:
wget -O /usr/local/cpanel/whostmgr/docroot/cgi/litespeed_plugin.pl \
     https://repo.litespeed.sh/cpanel/litespeed_plugin.pl
  1. Set proper permissions:
chmod 755 /usr/local/cpanel/whostmgr/docroot/cgi/litespeed_plugin.pl
  1. Run the installer that ships with the plugin:
/usr/local/cpanel/scripts/install_litespeed

When the installer finishes, log into WHM → LiteSpeed Web Server to verify that LSWS is running. The plugin automatically replaces Apache while preserving all existing virtual‑host configurations.

3. Propagate LiteSpeed to Slave Servers

3.1 Export the License and Configuration

The license file can be shared across the cluster. Copy it from the master to each slave:

scp /usr/local/lsws/conf/license.key root@slave1:/usr/local/lsws/conf/
scp /usr/local/lsws/conf/license.key root@slave2:/usr/local/lsws/conf/

3.2 Install LiteSpeed on Each Slave

Repeat the steps from 2.2 on every slave node. Because the plugin already exists on the master, you can push it to the slaves via the cPanel cluster sync:

whmapi1 sync_cpanel_plugin plugin=LiteSpeed

If the command fails, run the installer script on the slave manually (see 2.3).

3.3 Enable Clustered Configuration Sync

cPanel’s Cluster/Sync Settings let you synchronize web‑server configurations, PHP handlers, and custom directives.

  1. In WHM on the master, navigate to Cluster/Sync Settings → Sync Settings.
  2. Check “Web Server Configurations” and “PHP Handlers”.
  3. Save the changes. The master will now push any configuration changes to the slaves automatically.

3.4 Verify Synchronization

Make a small change on the master—e.g., enable LiteSpeed’s Cache for a test domain—then log into the slave’s WHM → LiteSpeed Web Server to confirm the same setting appears. To compare configuration files directly, run:

diff -u /usr/local/lsws/conf/httpd_config.conf \
        /usr/local/lsws/conf/httpd_config.conf

If differences are found, re‑run the sync command:

/usr/local/cpanel/scripts/cluster_sync

4. Optimize LiteSpeed for a Multi‑Server Environment

4.1 Enable LSCache for WordPress & Joomla

Most cPanel users host CMS platforms. Install the LSCache plugins via the CMS dashboards, then enable “Cache for All Users” in the LiteSpeed admin console (WHM → LiteSpeed → Cache Settings). This reduces origin load on both master and slaves.

4.2 Configure Global Rate Limiting

Protect the entire cluster from traffic spikes by setting a global request‑per‑second limit:

listener Default {
    address                *:80
    secure                 0
    limit                  1000   # requests per second
}

Apply the same listener configuration on each node; the cluster sync will propagate it automatically.

4.3 Use a Shared Cache Backend (Optional)

For high‑traffic sites spanning multiple servers, consider a shared Redis or Memcached backend for LSCache. In the LiteSpeed admin UI, go to Cache → Cache Storage, set the storage type to “Redis”, and enter the shared server’s IP and port.

4.4 Monitoring and Alerting

  • Enable LiteSpeed’s built‑in real‑time statistics (/usr/local/lsws/admin/misc/lswsstats) and integrate them with cPanel’s Service Status page.
  • Configure email alerts for service failures via WHM → Service Configuration → Service Manager → “Notify on failure”.
  • Consider third‑party monitoring tools (New Relic, Datadog) to track response times across the cluster.

Conclusion

Deploying LiteSpeed Web Server in a multi‑cPanel master‑slave environment combines the best of both worlds: cPanel’s intuitive management interface and LiteSpeed’s high‑performance, low‑resource web serving. By preparing the cluster, installing LSWS on the master, propagating the license and configuration to slaves, and fine‑tuning caching and security, you’ll achieve faster page loads, higher concurrency, and a more resilient hosting platform.

Keep both cPanel and LiteSpeed up to date, regularly test the synchronization process, and monitor key performance metrics. A well‑maintained cluster positions you to handle growth, deliver superior service to clients, and stay ahead of the competition.

cpanellitespeedmaster-slaveclusterwebservercachinglinuxhosting

More in Web Panel

Domain Name Theft & Hijacking: 5 Essential Steps to Protect Your Registrar Account

Domain Name Theft & Hijacking: 5 Essential Steps to Protect Your Registrar Account

In today's hyper‑connected world, a domain name is a vital asset that cybercriminals constantly target, making robust protection essential. By choosing a reputable registrar, hardening credentials, enabling domain‑level safeguards, monitoring activity, and training staff, you can keep your digital real‑estate secure and maintain full control over your online presence.

“Seamless Integration: How to Embed JetBackup 5 Client Portals Directly into Your WHMCS Client Area”

“Seamless Integration: How to Embed JetBackup 5 Client Portals Directly into Your WHMCS Client Area”

Embedding JetBackup 5’s self‑service portal directly into the WHMCS client area gives hosting providers a friction‑free, branded backup experience that cuts support tickets and opens upsell opportunities. This guide walks you through installing the official JetBackup addon, crafting a custom WHMCS template with an iframe, and using a secure WHMCS hook to generate time‑limited portal URLs—all while keeping security tight and the integration future‑proof.

Mastering CloudLinux Node Rebalancing: A Step‑by‑Step Guide for Multi‑WHM Bare Metal Environments

Mastering CloudLinux Node Rebalancing: A Step‑by‑Step Guide for Multi‑WHM Bare Metal Environments

Managing a fleet of WHM/cPanel servers with CloudLinux can feel like juggling flaming torches, but automated node rebalancing turns that chaos into a well‑orchestrated performance symphony. By evenly redistributing LVE cages across bare‑metal nodes, you maximize hardware ROI, maintain consistent CPU and memory allocation, and free your team from tedious manual migrations.