OpenLiteSpeed (OLS) is the open-source version of LiteSpeed Web Server — one of the highest-performance HTTP servers available, purpose-built for serving PHP applications. OpenLiteSpeed uses an event-driven architecture similar to Nginx but includes a built-in PHP engine (LSAPI) that processes PHP requests 3–5x faster than PHP-FPM behind Nginx, eliminating the socket overhead of the FastCGI protocol. OLS also includes a web-based administration GUI, built-in cache (LSCache), built-in HTTP/3 QUIC support, and HTTP/2 server push. For WordPress and other PHP applications, OpenLiteSpeed delivers significantly higher requests-per-second than the LEMP stack at equivalent server specifications. This guide covers installing OpenLiteSpeed on RHEL 9, configuring a virtual host, connecting the LSPHP engine, and enabling LSCache.
Prerequisites
- RHEL 9 with sudo/root access
- Port 80 and 8088 available
Step 1 — Add the OpenLiteSpeed Repository
# Add the LiteSpeed repository for RHEL/CentOS
rpm -ivh https://rpms.litespeedtech.com/centos/litespeed-repo-1.2-1.el9.noarch.rpm
dnf install -y epel-release
dnf install -y openlitespeed
Step 2 — Install LSPHP
# Install LSPHP 8.3 (LiteSpeed's optimised PHP engine)
dnf install -y lsphp83 lsphp83-common lsphp83-mysqlnd lsphp83-opcache lsphp83-xml lsphp83-gd lsphp83-mbstring
# Verify installation
/usr/local/lsws/lsphp83/bin/php -v
Step 3 — Start OpenLiteSpeed
systemctl enable --now lsws
systemctl status lsws
# OLS listens on port 8088 by default (change to 80 via admin panel)
firewall-cmd --permanent --add-port=8088/tcp --add-port=7080/tcp
firewall-cmd --reload
# Admin panel: http://your-server:7080
# Default credentials: admin / 123456 (CHANGE IMMEDIATELY)
Step 4 — Change Admin Password and Web Port
# Change admin password via CLI
/usr/local/lsws/admin/misc/admpass.sh
Then in the Admin GUI at http://your-server:7080:
- Go to Listeners → Edit the default listener → Change port to 80
- Click Graceful Restart (top right)
Step 5 — Create a Virtual Host via Config File
# Create the document root
mkdir -p /var/www/example.com/public_html
chown -R nobody:nobody /var/www/example.com
# /usr/local/lsws/conf/vhosts/example.com/vhconf.conf
docRoot /var/www/example.com/public_html
vhDomain example.com
vhAliases www.example.com
index {
useServer 0
indexFiles index.php, index.html
}
scripthandler {
add lsapi:lsphp83 php
}
extprocessor lsphp83 {
type lsapi
address uds://tmp/lshttpd/lsphp83.sock
maxConns 35
env PHP_LSAPI_CHILDREN=35
initTimeout 60
retryTimeout 0
persistConn 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp83/bin/lsphp
backlog 100
instances 1
priority 0
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
procHardLimit 500
}
rewrite {
enable 1
rules <<<END_RULES
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
END_RULES
}
Step 6 — Enable LSCache (LiteSpeed Cache)
# LSCache is a built-in server-level cache — works with the WordPress LiteSpeed Cache plugin
# Enable cache in the Admin GUI: Configuration > Server > Cache > Enable Cache
# Or install the WordPress LiteSpeed Cache plugin for automated cache management
# For WordPress: install via WP-CLI
wp plugin install litespeed-cache --activate --path=/var/www/example.com/public_html
Conclusion
OpenLiteSpeed on RHEL 9 provides a high-performance PHP serving platform with built-in LSAPI that outperforms traditional Nginx+PHP-FPM deployments for PHP-heavy workloads. The web-based admin panel simplifies virtual host management and performance tuning, while LSCache provides an integrated full-page cache for WordPress and other CMS platforms without additional software.
Next steps: How to Set Up a LEMP Stack on RHEL 9, How to Set Up a LAMP Stack on RHEL 9, and How to Configure HAProxy for Load Balancing on RHEL 9.