You see “LiteSpeed” pop up in three customer support tickets in one week — performance comparisons, WordPress benchmarks, LSCache recommendations. You consider moving your DirectAdmin server’s webserver from Apache (or Nginx + Apache) to OpenLiteSpeed. The CustomBuild option exists. The performance win is real for WordPress + LSCache. The decision points are: which LiteSpeed flavor (open-source OpenLiteSpeed or commercial LiteSpeed Enterprise with native .htaccess parity), how customer-facing the migration looks, and what changes in your operating posture once OLS is running.
What’s happening
CustomBuild on DirectAdmin supports OpenLiteSpeed as a webserver option, replacing Apache. The architecture changes from “Apache fronts everything” or “Nginx fronts Apache” to “OpenLiteSpeed fronts everything” — a single webserver handling static, dynamic (PHP via lsapi), TLS, and (in OLS) per-virtual-host cache. The PHP integration changes too: instead of mod_php or mod_lsapi inside Apache, PHP runs as lsphp external applications launched by OLS, with their own pool model.
The two LiteSpeed flavors matter:
- OpenLiteSpeed (OLS) is open-source, free, and good. It does not natively parse
.htaccess— you have to enable a compatibility mode, and there are still subtleties. Cache configuration is per-site via the OLS admin UI or via thecache.cnffile in each vhost. WordPress LSCache plugin works. - LiteSpeed Enterprise (LSWS) is commercial. Native
.htaccessparity with Apache (so customer rewrites work as-is), more polished admin tooling, integration withcagefsfor CloudLinux, and faster vhost reload. License cost scales by core count or by domain count, depending on the SKU. Operators with many customer sites and a strong existing.htaccess/CloudLinux story usually pick LSWS. Operators starting from scratch or running fewer high-traffic sites often pick OLS.
For DirectAdmin, both are supported by CustomBuild. The recipe below is for OpenLiteSpeed; for LSWS the steps are similar but you also have to feed in your license serial number during install.
The operational changes once OLS is in place:
- No more
httpdservice; insteadlsws(OpenLiteSpeed’s main process) .htaccessrewrites work but requireenableRewrite 1in each vhost config (CustomBuild + DirectAdmin set this by default, but if you customize, don’t lose it)- Cache lives on disk under
/usr/local/lsws/cachedata— needs space, needs purging policy - WordPress LSCache plugin auto-detects OLS and provisions itself correctly; non-WordPress sites need manual cache config or no cache at all
- PHP via lsphp —
lsphp83,lsphp82packages — different binary names from CustomBuild’s standardphp83,php82, so customer cron jobs with hardcodedphppaths may need updating
How to verify
After the rebuild, OpenLiteSpeed should be running and Apache should not be:
systemctl status lsws
# Active: active (running)
systemctl status httpd
# Active: inactive (or unit not found)
ss -lntp | grep -E ':(80|443|7080)\b'
# 80, 443 -> lsws
# 7080 -> lsws admin (loopback only)
The OLS admin should be reachable on loopback:
curl -sk https://127.0.0.1:7080/ | head
# OLS admin login HTML
LSCache should be present for WordPress installs and cache-control headers should fire:
# Hit a WordPress site twice — second hit should be cached
curl -sI "https://wordpress-customer.example.com/" | head -5
# First hit:
# x-litespeed-cache: miss
# Second hit:
# x-litespeed-cache: hit
Any customer site whose homepage returns a 500 after the rebuild has an .htaccess directive OLS doesn’t parse. Check the error log:
tail -100 /usr/local/lsws/logs/error.log | grep -iE 'rewrite|htaccess|forbidden'
.htaccess directives like <IfModule mod_php.c> will not match (no mod_php anymore). Customers need to rewrite those blocks or remove them.
The fix
1. Decide OLS vs LSWS
If you’re running CloudLinux or have many customers with complex .htaccess, LiteSpeed Enterprise is the safer choice — it parses .htaccess natively with high Apache fidelity. If you’re greenfield or your customer profile is mostly WordPress sites that already use LSCache plugin, OpenLiteSpeed is fine and free.
The rest of this article assumes OpenLiteSpeed. For LSWS, the install command is different (you feed in the license serial), but the post-install steps are largely the same.
2. Stage the swap
As with any CustomBuild stack change, stage it first on a clone. Restore three to five representative customer accounts onto a staging DirectAdmin server, run the OLS swap there, and validate. The most common breakage is .htaccess-driven — customers with PHP version selectors via .htaccess, custom rewrite blocks, or mod_security rules in their own .htaccess may break.
Run the swap on staging:
cd /usr/local/directadmin/custombuild
./build set webserver openlitespeed
./build set php1_release 8.3
./build set php1_mode lsapi
./build set php2_release 8.2
./build set php2_mode lsapi
./build save
./build update
./build php n # rebuild PHP as lsphp
./build openlitespeed
./build rewrite_confs
systemctl stop httpd
systemctl disable httpd
systemctl enable --now lsws
./build rewrite_confs regenerates DirectAdmin’s per-customer vhost configs for OpenLiteSpeed format. Without it, OLS comes up but customer vhosts don’t exist on it.
Test each staging customer site. Anything that returns 500 needs an .htaccess fix or a vhost-level override.
3. Plan the production swap
For 200 customer sites, the swap is a maintenance window — typically 30-45 minutes. Communicate ahead. Pick a low-traffic time.
Capture the rollback state:
cd /usr/local/directadmin/custombuild
tar -czf /root/pre-ols-swap-$(date +%Y%m%d).tar.gz options.conf versions.txt
cp -r /etc/httpd /root/httpd-pre-ols.$(date +%Y%m%d) 2>/dev/null || true
If the swap goes wrong, the rollback is:
cd /usr/local/directadmin/custombuild
./build set webserver apache
./build save
./build update
./build apache
./build rewrite_confs
systemctl disable lsws
systemctl enable --now httpd
4. Run the production swap
cd /usr/local/directadmin/custombuild
./build set webserver openlitespeed
./build save
./build update
./build php n
./build openlitespeed
./build rewrite_confs
systemctl stop httpd
systemctl disable httpd
systemctl enable --now lsws
After OLS comes up, run the verification:
ss -lntp | grep -E ':80|:443'
systemctl status lsws
tail -50 /usr/local/lsws/logs/error.log
5. Configure caching
Per-site LSCache config lives in /usr/local/lsws/conf/vhosts/<domain>/cache.cnf. CustomBuild generates a reasonable default per customer vhost. For WordPress sites specifically:
- Customer installs the official LiteSpeed Cache WordPress plugin
- The plugin auto-detects OLS and configures itself
- Cache rules go in
/usr/local/lsws/conf/vhosts/<domain>/cache.cnfand the plugin writes its own.htaccessentries that OLS honors
For non-WordPress sites with no caching, the default empty cache.cnf is fine. For non-WordPress sites you want to cache (Laravel, custom PHP apps), write a cache policy by URL pattern in cache.cnf:
checkPublicCache 1
checkPrivateCache 1
maxCacheObjSize 10000000
cacheExpireInSeconds 3600
context /static/ {
cache 1
cacheable 1
cacheExpireInSeconds 86400
}
context /api/ {
cache 0
cacheable 0
}
6. Update customer documentation
Customers who were running Apache + LSCache plugin already understand the model. Customers who weren’t using LSCache need to install the plugin to benefit from caching. Customers with mod_php-specific .htaccess blocks (<IfModule mod_php.c>) need to rewrite those blocks for OLS — usually you change the condition to <IfModule lsapi_module>.
Send a short note to the customer list pointing at:
- How to install the LSCache plugin (one-click via DirectAdmin’s WordPress installer, or from the WP admin)
- Which
.htaccessblocks may need updating - Performance expectations — LSCache hits are ~10x faster than uncached PHP on most WordPress workloads
7. Monitor cache hit ratio
Add a cron that audits the cache hit ratio per site:
# Cron — daily, scan OLS access log for x-litespeed-cache header
awk '/x-litespeed-cache: hit/ {hit++}
/x-litespeed-cache: miss/ {miss++}
END {
total = hit + miss
if (total > 0) {
printf "hit_ratio: %.2f%% (hits=%d, misses=%d, total=%d)\n",
(hit/total)*100, hit, miss, total
}
}' /usr/local/lsws/logs/access.log
A WordPress site with a hit ratio under 60% is misconfigured — usually a plugin that injects nonces into the page (logged-in user actions) or a missing exclusion rule. The customer’s LSCache plugin settings need adjustment.
For OpenLiteSpeed vs LSWS-Enterprise sizing, LSCache tuning per customer tier, and the regular cache-hit audits we run on a managed DirectAdmin server, Managed Cloud Ops is where this lives — with the underlying box covered by cloud compute. Scope your LiteSpeed migration and we’ll plan the swap window with you.