Skip to content

LiteHttpd Engine

LiteHttpd is an enhanced distribution of OpenLiteSpeed that combines four key improvements into a single, production-ready web server:

OpenLiteSpeed Core

High-performance event-driven web server with HTTP/3 and QUIC support as the foundation.

.htaccess Module

Full .htaccess parsing engine supporting 80+ directives, enabling drop-in Apache compatibility.

Kernel Patches

Optimized kernel-level tuning for connection handling, file I/O, and memory management on EL9/EL10.

Config Converter

Built-in litehttpd-confconv tool that translates Apache httpd.conf to native LiteHttpd configuration.

LiteHttpd delivers significant performance gains over Apache while maintaining full compatibility. The following benchmarks were conducted on a 4-core / 8GB EL9 server with default configurations:

File SizeApache 2.4Stock OLS 1.8LiteHttpdLiteHttpd vs Apache
1 KB18,20042,50045,8002.5x
10 KB15,60038,20041,3002.6x
100 KB8,40019,80021,5002.6x
1 MB2,1004,9005,2002.5x
ScenarioApache + php-fpmStock OLS + LSAPILiteHttpd + LSAPILiteHttpd vs Apache
Homepage2854104201.5x
WP Admin1452052151.5x
WooCommerce Cart951401481.6x
REST API3805305501.4x
ScenarioApache + php-fpmLiteHttpd + LSAPI
Static 1 KB12 ms4 ms
WordPress Homepage85 ms58 ms
WooCommerce Cart210 ms135 ms

LiteHttpd uses the LSAPI protocol to communicate with PHP, which provides significant advantages over the traditional php-fpm approach:

  • 30% fewer context switches — LSAPI uses persistent connections with shared memory, eliminating the per-request fork/connect overhead of php-fpm
  • Built-in opcode cache awareness — LSAPI processes share the OPcache segment directly
  • Automatic process management — LiteHttpd manages PHP child processes natively, no separate php-fpm pool configuration needed
  • Graceful restarts — PHP workers are recycled without dropping in-flight requests

LiteHttpd supports 80+ Apache .htaccess directives, covering the vast majority of real-world usage:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

Full support for RewriteEngine, RewriteBase, RewriteCond, RewriteRule with all common flags.

This means WordPress plugins like Yoast SEO, W3 Total Cache, WP Super Cache, and virtually all security plugins work without any modifications.

LiteHttpd includes two tools for migrating from Apache:

Analyzes an existing Apache configuration and generates a compatibility report:

Terminal window
litehttpd-readapacheconf /etc/httpd/conf/httpd.conf

Output includes:

  • List of all directives found and their compatibility status
  • Unsupported directives with suggested alternatives
  • Virtual host mapping summary

Converts Apache configuration files to LiteHttpd native format:

Terminal window
litehttpd-confconv --input /etc/httpd/conf/httpd.conf --output /usr/local/lsws/conf/

LiteHttpd includes several security enhancements beyond stock OpenLiteSpeed:

  • Anti-DDoS connection throttling — automatic per-IP rate limiting at the connection level
  • Request body scanning — built-in request filtering for common attack patterns
  • Strict HTTP parsing — rejects malformed requests before they reach the application
  • chroot support — optional process isolation per virtual host
  • Automatic security headers — default CSP, X-Frame-Options, and HSTS headers
  • Hotlink protection — configurable referrer-based access control
  • IP-level geo-blocking — block or allow by country code via MaxMind GeoIP2

LiteHttpd packages are available from the official RPM repository for EL9 and EL10:

Terminal window
# Add the repository
rpm -ivh https://rpms.litehttpd.com/litehttpd-release-latest.el9.noarch.rpm
# Install LiteHttpd
dnf install litehttpd
# Start the service
systemctl enable --now litehttpd
FilePurpose
/usr/local/lsws/conf/httpd_config.confMain server configuration
/usr/local/lsws/conf/vhosts/Per-site virtual host configs
/home/<user>/<domain>/.htaccessPer-directory overrides
/usr/local/lsws/logs/error.logServer error log
/usr/local/lsws/logs/access.logAccess log