LiteSpeed
This guide provides comprehensive information on LiteSpeed Web Server (LSWS), including its benefits, how to order and manage licenses, installation procedures, configuration, troubleshooting, and more.
What is LiteSpeed Web Server?
LiteSpeed Web Server is a high-performance, Apache-interchangeable HTTP server. It’s a popular alternative to Apache, often used to accelerate websites and improve server efficiency. On cPanel servers, LiteSpeed integrates with EasyApache, making it a seamless upgrade.
Key Benefits of LiteSpeed:
- Performance: LiteSpeed is renowned for its speed, typically performing significantly faster than Apache, even Apache with configurations like Event MPM and PHP-FPM. It can handle more traffic with fewer resources.
- Ease of Use: Once installed, LiteSpeed generally requires minimal ongoing management to maintain excellent performance. If you want your site to load quickly without extensive manual tuning, LiteSpeed is an excellent choice.
- Compatibility: It’s compatible with most major Content Management Systems (CMS) like WordPress, Joomla, and Drupal. It fully supports Apache’s .htaccess files and mod_rewrite rules.
- Integrated Caching: LiteSpeed comes with powerful caching solutions, including LSCache plugins for popular CMS platforms, which can dramatically improve site load times.
- Control Panel Integration: LiteSpeed is fully integrated into WHM/cPanel and Plesk, simplifying management tasks.
Liquid Web support for LiteSpeed
- Fully Supported Licenses: If you purchase your LiteSpeed license directly from Liquid Web, it is fully supported by our team. We will assist you with installation, configuration, troubleshooting, and any other needs related to LiteSpeed. If an issue requires direct intervention from LiteSpeed Technologies, we will contact them on your behalf.
Key features of LiteSpeed Web Server
LiteSpeed offers a rich set of features designed for performance, security, and scalability:
- HTTP/2 and HTTP/3 (QUIC) Support: Delivers faster content loading and improved security (LiteSpeed Version 5.0 and newer for HTTP/2).
- .htaccess Caching: Optimizes the processing of .htaccess rules.
- Apache Compatibility: Full support for Apache’s mod_rewrite and mod_include.
- Security:
- Support for ModSecurity (Enterprise Edition).
- WordPress Brute-Force Protection.
- Built-in Anti-DDoS capabilities.
- Caching Solutions:
- LSMCD (LiteSpeed Memcached) for object caching.
- CSS/JS Minification and Optimization.
- LiteSpeed Cache plugins for WordPress, Magento, Joomla, Drupal, and more.
- PHP Performance: Advanced PHP processing with LSAPI for optimal speed.
- Real-time Monitoring: Provides statistics and insights into server performance.
For a complete list of features, please visit the LiteSpeed Technologies features page.
LiteSpeed licensing options with Liquid Web
Liquid Web offers several monthly leased LiteSpeed license tiers. We do not offer free, lite, or owned licenses. If you require these, you would need to obtain them directly from LiteSpeed.
When choosing a license, LiteSpeed generally recommends selecting a license with enough worker processes to utilize roughly 25% of your server’s available CPU cores. All licenses we offer support unlimited domains and RAM.
Note: The number of CPU cores specified in the LiteSpeed license does not need to match the total number of cores on your server. If your needs change, you can contact us to upgrade or downgrade your license.
For detailed guidance on choosing the right license, refer to LiteSpeed’s official documentation: How to Choose a License.
LiteMage for Magento 2
LiteMage is a Magento 2 caching extension that works with your LiteSpeed Web Server license to significantly accelerate your Magento store. LiteMage requires an active LiteSpeed license leased through Liquid Web.
| Cache Add-on | Supported Applications | LSCache Objects | Magento Objects | Availability | Price (Per Month) |
|---|---|---|---|---|---|
| LSCache | WordPress, Joomla, Drupal | Unlimited | 0 | Included with all LW LiteSpeed licenses | Included with License |
| LiteMage Starter | Everything LSCache supports + Magento | Included | 1,500 | All LW LiteSpeed licenses | $20 + LS License |
| LiteMage Standard | Everything LSCache supports + Magento | Included | 25,000 | All LW LiteSpeed licenses | $40 + LS License |
| LiteMage Unlimited | Everything LSCache supports + Magento | Included | Unlimited | All LW LiteSpeed licenses | $100 + LS License |
Ordering LiteSpeed
You can order a LiteSpeed license for your Liquid Web server. Log into your my.liquidweb.com account and then use this link: My Liquid Web Marketplace.
- New Dedicated Servers: When configuring a new traditional dedicated server, you can select LiteSpeed from the Web Server dropdown menu instead of Apache.
- Existing Servers / Cloud Servers / LiteMage: For existing servers, Cloud VPS, Cloud Dedicated servers, or if you need LiteMage, please use the My Liquid Web Marketplace link above.
Once your order is placed through the Marketplace, our support team will provision the license and can assist with the installation. You will receive a serial number required for the installation.
Moving a LiteSpeed license
If you need to move your Liquid Web-leased LiteSpeed license from one of your servers to another, please contact our support team. We will assist you in releasing the license from the old IP address and preparing it for the new server.
Cancelling a LiteSpeed license
To cancel a LiteSpeed license leased through Liquid Web, please contact our support or billing team. We will process the cancellation with LiteSpeed Technologies and update your account accordingly.
Installation
Before you begin:
- Order Your License: Ensure you have ordered your LiteSpeed license through Liquid Web and have received your serial number.
- Note Current Server Configuration (Important for Rollback if Needed):
Before installing LiteSpeed and if this on a cPanel server, it’s a good practice to log your server’s current configuration. You can do this by running the following command as root and saving the output:bash printf "`cat /etc/redhat-release`n `uname -a`n `date`n `/usr/local/cpanel/bin/rebuild_phpconf --current`n" > /root/pre-lsws-check.log - Firewall Configuration (CentOS 7 / AlmaLinux with firewalld):
If your server usesfirewalld, open the necessary ports:bash firewall-cmd --permanent --zone=public --add-port=7080/tcp # LiteSpeed WebAdmin Console firewall-cmd --permanent --zone=public --add-port=8088/tcp # LiteSpeed Test Port (if using offset) firewall-cmd --reload
WHM/cPanel installation
This is the recommended method for servers with WHM/cPanel. The script installs LiteSpeed and the WHM plugin.
- SSH into your server as the root user.
- Run the installation script, replacing
$LSWS_SERIALwith your actual LiteSpeed serial number:LSWS_SERIAL="YOUR_SERIAL_NUMBER_HERE" bash <( curl [https://get.litespeed.sh](https://get.litespeed.sh) ) $LSWS_SERIAL- During the installation, you’ll be prompted for:
- LiteSpeed target installation directory: The default (
/usr/local/lsws) is usually fine. - Port Offset:
- Set to
0to replace Apache immediately. LiteSpeed will use ports 80 and 443. - Set to a non-zero value (e.g.,
2000) to run LiteSpeed on alternate ports (e.g.,2080for HTTP,2443for HTTPS) for testing before switching.
- Set to
- Enable PHP SuEXEC: It’s generally recommended to enable this unless you have a specific reason not to.
- Administrator’s email address: Use your primary contact email.
- Username and password for LWSW WebAdmin Console: Choose a strong password and store it securely.
- LiteSpeed target installation directory: The default (
- During the installation, you’ll be prompted for:
- Verify Installation:
- Log in to WHM.
- Navigate to Plugins » LiteSpeed Web Server.
- From here, you can manage LiteSpeed, switch between LiteSpeed and Apache, and access the LiteSpeed WebAdmin Console.
- Activate License with Billing: After installation, please contact our support team to confirm that your license has been fully activated in our billing system.
For more details, refer to the official LiteSpeed cPanel installation guide.
InterWorx installation
LiteSpeed can be installed on InterWorx servers, but it requires more manual configuration steps compared to cPanel.
- Initial Software Installation:
SSH into your server as root and run (replace$LSWS_SERIALwith your serial number):LSWS_SERIAL="YOUR_SERIAL_NUMBER_HERE" bash <( curl [https://get.litespeed.sh](https://get.litespeed.sh) ) $LSWS_SERIAL- When prompted, select InterWorx as the control panel.
- It’s recommended to set a port offset other than
0(conflicts with Apache) or2000(conflicts with InterWorx panel) for initial testing. For example, use3000. This means LiteSpeed will initially run on ports3080(HTTP) and3443(HTTPS). You can test sites usinghttp://yourdomain.com:3080.
- Enable and Start LiteSpeed (if not started during install):
systemctl enable --now lswsThis makes the LiteSpeed WebAdmin console accessible athttp://YOUR_SERVER_IP:7080. - InterWorx Additional PHP Steps:
- Add LiteSpeed PHP Repository:
- For CentOS 7:
bash rpm -ivh [http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm](http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm) - For AlmaLinux 8/Rocky Linux 8/RHEL 8:
bash rpm -ivh [http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm](http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm)
- For CentOS 7:
- Install LiteSpeed PHP (lsphp) versions:
Install the desiredlsphpversions and common extensions. The following command generates a list of availablelsphppackages; you can then copy and run theyum installcommand with the packages you need:yum -q list lsphp* | awk '{print $1}' | grep -Ev '(pecl|debuginfo|src|Available|Installed)' | xargs echo yum installExample:yum install lsphp74 lsphp74-common lsphp74-mysqlnd lsphp74-gd lsphp74-xml lsphp74-mbstring lsphp74-json(Install all desired versions like lsphp80, lsphp81 etc.) - Configure PHP Handlers in LiteSpeed WebAdmin:
- Log into the LiteSpeed WebAdmin console (
http://YOUR_SERVER_IP:7080). - Go to Configuration » Server » PHP.
- In the PHP Handlers section, click Add.
- Fill in the details:
- Handler ID: A descriptive name (e.g.,
lsphp80for PHP 8.0). - Handler Type: LiteSpeed SAPI
- Command: Path to the
lsphpexecutable (e.g.,/usr/local/lsws/lsphp80/bin/lsphp). - Handled Suffixes:
php(or others likephp80if you want to specify versions via suffix).
- Handler ID: A descriptive name (e.g.,
- Save the handler. Repeat for each PHP version you installed.
- Gracefully restart LiteSpeed from the WebAdmin console (usually a “Graceful Restart” link at the top).
- Log into the LiteSpeed WebAdmin console (
- Add LiteSpeed PHP Repository:
- Set PHP Version per Site:
By default, sites will use the highest configured version of LSPHP. To specify a PHP version for a particular site, create or modify the.htaccessfile in the site’s document root:AddHandler application/x-httpd-{Handler ID} .{Handled Suffixes}Example forlsphp80handler for.phpfiles:AddHandler application/x-httpd-lsphp80 .phpWrap LiteSpeed-specific settings in an<IfModule LiteSpeed>block to avoid issues if you switch back to Apache:<IfModule LiteSpeed> AddHandler application/x-httpd-lsphp80 .php </IfModule> - Testing:
Thoroughly test your websites using the offset port (e.g.,http://yourdomain.com:3080). Ensure all PHP versions and site functionalities work as expected. Open any custom test ports in your firewall if necessary. - Enable LiteSpeed Plugin in NodeWorx:
Go to NodeWorx » Plugins and enable the LiteSpeed plugin (click the pencil/edit icon). - Go Live:
When you are satisfied with testing:- Stop and disable Apache:
bash systemctl stop httpd systemctl disable httpd - In the LiteSpeed WebAdmin console, change the Port Offset to
0. - Perform a graceful restart of LiteSpeed. LiteSpeed will now serve sites on the standard ports 80 and 443.
- Stop and disable Apache:
Note for InterWorx: Setting up LiteSpeed on InterWorx involves more manual steps than on cPanel. If extensive, automatic configuration is crucial, consider migrating to a cPanel environment.
Configuring PHP
- For EasyApache 4 (EA4) on cPanel: The LiteSpeed WHM plugin generally handles PHP configuration automatically. It will detect your existing PHP versions and set up corresponding LSPHP handlers.
- For EasyApache 3 (EA3) on cPanel (Legacy):
- In the LiteSpeed WHM Plugin, click “Build Matching LSPHP.” This process can take some time.
- Once complete, click “Restart LiteSpeed.”
Using Local php.ini files
To allow individual accounts or virtual hosts to use their own php.ini files with LiteSpeed:
- Log in to LiteSpeed’s WebAdmin Console (
http://YOUR_SERVER_IP:7080). - Go to Configuration » Server » External App.
- Click Edit for the relevant LSPHP handler (e.g.,
lsphp). - In the Environment section, add the following line:
PHP_INI_SCAN_DIR=:$VH_ROOT/public_html$VH_ROOTtypically refers to the user’s document root or a similar path. This allows aphp.inifile in thepublic_html(or specified) directory to be loaded.- The leading colon
:ensures that global PHP INI files are still scanned, and the localphp.inidirectives are appended or override global settings.
- Save the changes and perform a graceful restart of LiteSpeed.
Post-Installation recommendations
Use mod_remoteip instead of mod_cloudflare
If you are using Cloudflare or another reverse proxy, ensure that your websites log the correct visitor IP addresses instead of the proxy’s IP. LiteSpeed has a built-in way to handle this:
- Log in to the LiteSpeed WebAdmin Console (
http://YOUR_SERVER_IP:7080). - Go to Configuration » Server » General Settings.
- Find the option Use Client IP in Header.
- Set it to Trusted IP Only or Yes.
- Trusted IP Only is generally recommended. You will then need to add Cloudflare’s (or your proxy’s) IP addresses to Configuration » Server » Security » Allowed List. You can find Cloudflare’s current IP ranges here.
- Save the settings and perform a graceful restart of LiteSpeed.
Updating LiteSpeed
To update LiteSpeed to the latest stable version via the command line:/usr/local/lsws/admin/misc/lsup.sh