How to Install and Configure OpenLiteSpeed Web Server on RHEL 7
OpenLiteSpeed is the open-source edition of LiteSpeed Web Server, one of the fastest web servers available for Linux. It is event-driven, capable of handling tens of thousands of concurrent connections with minimal memory, and includes native support for PHP via LSAPI — an interface that is significantly more efficient than FastCGI or mod_php for PHP workloads. Unlike Apache or Nginx, OpenLiteSpeed ships with a graphical WebAdmin console on port 7080, making configuration approachable even for administrators who prefer a GUI over editing configuration files by hand. This guide covers installing OpenLiteSpeed on RHEL 7 using the official repository, managing the service with systemctl, navigating the WebAdmin console, setting up a virtual host, wiring in PHP via LSAPI, configuring your document root, and opening the necessary firewall ports.
Prerequisites
- RHEL 7 with root or sudo access
- A valid RHEL subscription or EPEL repository configured
- Ports 80, 443, and 7080 available (not in use by Apache or Nginx)
- At least 512 MB of free RAM
- A registered domain name or local hosts file entry for testing
- SELinux in enforcing mode (we will set the correct contexts)
Step 1: Add the OpenLiteSpeed Repository
LiteSpeed Technologies maintains an official RPM repository for RHEL/CentOS 7:
sudo rpm --import https://rpms.litespeedtech.com/centos/RPM-GPG-KEY-litespeed
sudo tee /etc/yum.repos.d/litespeed.repo <<'EOF'
[litespeed]
name=LiteSpeed Technologies Repository
baseurl=https://rpms.litespeedtech.com/centos/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://rpms.litespeedtech.com/centos/RPM-GPG-KEY-litespeed
EOF
Verify the repository is reachable:
sudo yum repolist | grep litespeed
Step 2: Install OpenLiteSpeed
sudo yum install -y openlitespeed
OpenLiteSpeed installs to /usr/local/lsws/ by default. Key paths:
/usr/local/lsws/bin/lshttpd— the server binary/usr/local/lsws/conf/httpd_config.xml— server-level configuration (XML; managed via WebAdmin)/usr/local/lsws/conf/vhosts/— per-virtual-host configuration directories/usr/local/lsws/logs/— error and access logs/usr/local/lsws/admin/— WebAdmin console files
Step 3: Set the WebAdmin Password
Before starting the service, set a WebAdmin administrator password:
sudo /usr/local/lsws/admin/misc/admpass.sh
You will be prompted for a username (default admin) and a password. Choose a strong password — the WebAdmin console can modify any aspect of the server configuration.
Step 4: Start and Enable the lshttpd Service
OpenLiteSpeed registers itself as the lshttpd service:
sudo systemctl enable lshttpd
sudo systemctl start lshttpd
sudo systemctl status lshttpd
Confirm the server is listening:
ss -tlnp | grep -E '80|7080'
# You should see lshttpd on port 8088 (default HTTP) and 7080 (WebAdmin)
Note: OpenLiteSpeed defaults to port 8088, not 80, to avoid conflicts. We will change this to port 80 via the WebAdmin console.
Step 5: Configure Firewall Rules
# Allow WebAdmin console
sudo firewall-cmd --permanent --add-port=7080/tcp
# Allow HTTP and HTTPS
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
# Allow the temporary test port 8088 (optional, for initial testing)
sudo firewall-cmd --permanent --add-port=8088/tcp
sudo firewall-cmd --reload
Allow SELinux to permit lshttpd to bind to HTTP ports and connect to network resources:
sudo setsebool -P httpd_can_network_connect 1
sudo semanage port -a -t http_port_t -p tcp 7080 2>/dev/null || true
sudo semanage port -m -t http_port_t -p tcp 8088 2>/dev/null || true
Step 6: Access the WebAdmin Console
Browse to https://<your-server-ip>:7080 in a web browser. Accept the self-signed certificate warning. Log in with the credentials set in Step 3.
The WebAdmin console is divided into several sections:
- Server Configuration — listeners, general settings, PHP, tuning
- Virtual Hosts — per-domain configuration
- Listeners — TCP listeners bound to specific ports and IPs
- Tools — restart/reload controls, real-time dashboard
Step 7: Change the Default Listener to Port 80
In the WebAdmin console:
- Navigate to Listeners in the left sidebar
- Click the default listener (named
Default, port 8088) - Click the Edit button (pencil icon)
- Change Port from
8088to80 - Click Save
- Click the Graceful Restart button at the top of the page
Alternatively, use the CLI if you prefer not to use the GUI:
sudo sed -i 's/<port>8088</port>/<port>80</port>/'
/usr/local/lsws/conf/httpd_config.xml
sudo systemctl restart lshttpd
Step 8: Create a Virtual Host
Create the virtual host directory structure manually, then register it in WebAdmin:
sudo mkdir -p /var/www/example.com/{html,logs,conf}
sudo chown -R nobody:nobody /var/www/example.com
echo "<?php phpinfo(); ?>" | sudo tee /var/www/example.com/html/index.php
# Set correct SELinux context for the document root
sudo semanage fcontext -a -t httpd_sys_content_t "/var/www/example.com/html(/.*)?"
sudo restorecon -Rv /var/www/example.com/html
In the WebAdmin console, navigate to Virtual Hosts and click Add:
- Virtual Host Name:
example.com - Virtual Host Root:
/var/www/example.com/ - Config File:
$SERVER_ROOT/conf/vhosts/example.com/vhconf.xml - Enable Scripts/ExtApps: Yes
- Restrained: Yes (security isolation)
Save and then map the virtual host to the default listener:
- Go to Listeners → click the Default listener → Virtual Host Mappings
- Add a mapping: Virtual Host =
example.com, Domains =example.com www.example.com - Save and perform a graceful restart
Step 9: Install PHP via LSAPI
OpenLiteSpeed works best with lsphp — LiteSpeed’s own PHP build with the LSAPI module baked in. Install it from the LiteSpeed repository:
# List available LSPHP versions
sudo yum search lsphp
# Install PHP 8.1 with common extensions
sudo yum install -y lsphp81 lsphp81-common lsphp81-mysqlnd
lsphp81-pdo lsphp81-json lsphp81-opcache
lsphp81-mbstring lsphp81-xml lsphp81-gd
# Verify installation
/usr/local/lsws/lsphp81/bin/php -v
In the WebAdmin console, navigate to Server Configuration → External App. You should see a pre-configured LSAPI app pointing to the installed lsphp binary. If not, add one:
- Type: LiteSpeed SAPI App
- Name:
lsphp81 - Address:
uds://tmp/lshttpd/lsphp81.sock - Max Connections:
35 - Command:
$SERVER_ROOT/lsphp81/bin/lsphp
Then in your virtual host, add a Script Handler:
- Suffixes:
php - Handler Type: LiteSpeed SAPI
- Handler Name:
lsphp81
Step 10: Test the Configuration
# Check the server is responding on port 80
curl -sI http://localhost/ | head -5
# Fetch the phpinfo page (if you added index.php in Step 8)
curl -s http://example.com/ | grep -i "php version"
# Watch the access log
tail -f /usr/local/lsws/logs/access.log
tail -f /var/www/example.com/logs/error.log
The WebAdmin dashboard (Tools → Real-Time) shows live requests per second, throughput, and connection counts — useful for confirming PHP is being handled via LSAPI rather than falling back to CGI.
Conclusion
OpenLiteSpeed on RHEL 7 provides a compelling alternative to Nginx and Apache for PHP-heavy workloads, thanks to the LSAPI protocol eliminating the overhead of FastCGI process spawning. The WebAdmin console makes ongoing configuration changes accessible to administrators of all experience levels, while the XML-based configuration files remain fully manageable via command line for automated deployments. With SELinux enforcing and firewalld restricting WebAdmin to trusted networks, this installation maintains the security posture expected of a RHEL 7 production server. For sites that grow beyond a single server, OpenLiteSpeed also supports built-in caching via the LiteSpeed Cache plugin ecosystem, making it a natural scaling path.