Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

LiteSpeed and OpenLiteSpeed

What the Exponential sources say about LiteSpeed and OpenLiteSpeed hosting: the shipped Apache rules, the LSAPI SAPI, open_basedir, what to test before selling a plan, and where Velocity fits.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/hosting/servers/litespeed.md

On this page

LiteSpeed and OpenLiteSpeed

This page is for hosting companies whose shared or managed hosting runs on LiteSpeed or OpenLiteSpeed. It answers: whether Exponential runs there, which rules to use, what the code knows about LiteSpeed, and what to test before a plan goes on sale. LiteSpeed's own menus and settings are not described here; check your LiteSpeed documentation for them.

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

Contents

  1. What the sources say
  2. Setting a site up
  3. PHP under LiteSpeed
  4. What to test before selling a plan
  5. Velocity on a LiteSpeed host
  6. The page cache of LiteSpeed
  7. Checklist

What the sources say

SourceStatement
README.md, "The traditional options"LiteSpeed and OpenLiteSpeed have an ".htaccess-compatible rewrite engine" that "reads Apache rules directly in most cases"
README.md, "When a traditional server is still the right answer"where the hosting does not allow a long-lived process, "Apache or LiteSpeed with .htaccess is the answer"
Operating system support, Web serversLiteSpeed and OpenLiteSpeed: tier 3, expected to work; "reads Apache's rewrite rules in most cases"
Operating system support, PHP SAPIsLiteSpeed (litespeed, LSAPI): "LiteSpeed's own SAPI"
lib/ezutils/classes/ezexecution.phpunder LiteSpeed (lsapi) the shutdown function runs in the PHP binary's directory, which open_basedir does not allow; the kernel copes with that

Tier 3 means "a reasoned expectation, not a test result" (The four tiers): the project has not watched Exponential run on LiteSpeed in its own tests. "In most cases" is the honest wording; test your own LiteSpeed version.

Setting a site up

  1. Document root is the installation root, the directory with index.php.

  2. Rewrite rules: copy the shipped rules, as for Apache:

    cp .htaccess_root .htaccess

    or, as the site's user, ./console exp:setup:htaccess --apply (Setting up .htaccess and config.php from the console). LiteSpeed Enterprise reads it on the next request. OpenLiteSpeed reads only the rewrite rules, only with autoLoadHtaccess on and only after a restart; put the rules in its virtual host instead (LiteSpeed example). Use .htaccess_root_static instead (--static) only when the site serves a generated static cache (Static cache).

  3. PHP: 8.0 or later with the required extensions (Chapter 2), memory_limit at least 64M (the setup wizard's floor; give production more), date.timezone set, file_uploads on (Chapter 2, php.ini settings).

  4. Writable directories: var/ and the settings/ directories, written by one user (Writable directories and permissions).

  5. Install with the setup wizard in the browser when the customer has no shell, or with exp:install or the kickstarter where a shell is available (One-click installers).

PHP under LiteSpeed

  • The SAPI is litespeed (LSAPI). The web PHP and the command-line PHP are configured separately and are often different builds: give both the same version and extensions (Chapter 2, Command line and web PHP).
  • The setup wizard's optional test wants open_basedir empty. Shared hosting often sets it; the kernel already handles the LSAPI shutdown directory under open_basedir, but other features (for example the background preload run, which needs proc_open, setsid and the PHP binary) may be refused by it (Preloading caches, section 7).
  • Exponential identifies the server it runs under: the system report (expSystemReport::serverKind()) classifies a LiteSpeed SAPI as other, and the debug bar says "Served by" the server, the SAPI and the port, "not by Velocity", so support staff can see at a glance what answered.

What to test before selling a plan

Run the four routing checks of Web servers and engines first. Then:

TestWhy
The front page, a content page and /user/login answerthe rewrite to index.php works
/api/ reaches index_rest.php and /content/treemenu reaches index_treemenu.phpthe two other front controllers of .htaccess_root
An uploaded image is shown, an uploaded file downloadsstorage paths and content/download
.php below the root answers 404"No PHP file runs because its path was asked for" (Chapter 8)
A cronjob runs from the customer's crontabruncronjobs.php under the CLI PHP (Cron jobs)
A cache clear in Setup > Caches worksvar/ is writable by the web PHP

Velocity on a LiteSpeed host

Velocity is a long-running process; on shared LiteSpeed hosting it is usually not allowed. On a LiteSpeed server that you control, Velocity can run beside it on its own ports and the LiteSpeed server can act as a reverse proxy, the same shape as with Apache or nginx (Velocity beside Apache or nginx). The proxy must be trusted and must set X-Forwarded-Proto (Chapter 8, Behind a reverse proxy).

The page cache of LiteSpeed

LiteSpeed Enterprise and OpenLiteSpeed have a page cache built in. For an Exponential site it is switched on without any plugin and without code: .htaccess_root carries a commented block (## >>> LiteSpeed page cache) that marks anonymous GET and HEAD requests without a query string, session cookie or is_logged_in cookie, outside the administration, user, shop and editing views, for max-age (120) seconds. Removing the first # of each line of the block switches it on; Apache and nginx ignore it (<IfModule LiteSpeed>). For a virtual host, Plesk's "Additional directives for HTTPS", cPanel's include files or DirectAdmin's custom configuration there is litespeed-page-cache.conf; OpenLiteSpeed's cache module is in the OpenLiteSpeed example.

What a host should know before offering it:

QuestionAnswer
What has to be on the servera cache directory: CacheRoot at server level (Enterprise) or the cache module's storagePath (OpenLiteSpeed)
Who gets stored pagesanonymous visitors and crawlers only; editors and signed-in members carry a session cookie and always reach PHP
What editors see after publishingthe live page; anonymous visitors see the change after at most max-age seconds, because Exponential does not purge LiteSpeed
How to checkcurl -sI https://example.com/ | grep -i x-litespeed-cache twice: miss, then hit
What it savesa hit takes no PHP process and no database query; crawler bursts become cheap

Step by step for every panel, purging, troubleshooting and security: Page caching with LiteSpeed and OpenLiteSpeed.

Checklist

  • To do: .htaccess copied from .htaccess_root; document root is the installation root.
  • To do: Web and CLI PHP are the same version with the same extensions.
  • To do: The routing checks and the tests above pass on a staging account.
  • To do: open_basedir effects on preload and other background runs are known and documented for support.
  • To do: After each upgrade, .htaccess is refreshed from the new .htaccess_root (./console exp:setup:htaccess shows the diff; --force --apply copies after a backup).
  • To do: With the page cache on: a second anonymous request says X-LiteSpeed-Cache: hit, a signed-in request never does, and customers know the max-age delay after publishing (Page caching with LiteSpeed and OpenLiteSpeed).

Demo mode on LiteSpeed. LiteSpeed reads SetEnv in .htaccess like Apache and passes it to lsphp: SetEnv EXP_DEMO_MODE 1 in a public demo's .htaccess switches demo mode on for its web requests, and security.log then shows demo/mode on ... sapi=litespeed. Recipe: run a public demo on LiteSpeed and Plesk.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x