On this pageWhat actually differs
For WordPress, the web server is rarely the bottleneck. PHP, caching and the database decide most of the speed. What the server does decide is where rules live, who is allowed to change them, and which caching you get without extra work. WordPress recommends Apache or Nginx, and OpenLiteSpeed is the third common choice because of its cache plugin. Whichever you pick, the current baseline is the same: WordPress 7.1 recommends PHP 8.3 or newer, MariaDB 10.11 or MySQL 8.4 and up, and HTTPS.
What actually differs
| Apache | Nginx | OpenLiteSpeed | |
|---|---|---|---|
Per-directory .htaccess |
Yes, read on each request where allowed | No, all rules in server blocks | Reads mod_rewrite rules only; restart after changes |
| PHP handler | PHP-FPM through proxy_fcgi (or mod_php) |
PHP-FPM through FastCGI | Built-in LSAPI |
| Full-page cache | Plugin, or mod_cache |
fastcgi_cache, or plugin |
LiteSpeed Cache plugin drives the server cache |
| Plugins that write rules | Work as designed | Their rules are ignored | Rewrite rules work after a restart |
| Administration | Config files | Config files | WebAdmin console plus files |
| License | Apache-2.0 | BSD-2-Clause | GPL-3.0 |
Apache: the compatible default
WordPress writes its permalink rules into .htaccess, and many plugins for caching, security and redirects add their own there. Apache honors them as long as the directory allows overrides. That convenience costs a little: with AllowOverride All, Apache looks for .htaccess files in every directory along the path on each request.
Run Apache with the event MPM and PHP-FPM, not the old prefork and mod_php pairing. On Ubuntu 24.04 the apache2 package already uses the event MPM, so it comes down to:
sudo apt install -y apache2 php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd \
php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl
sudo a2enmod proxy_fcgi setenvif rewrite
sudo a2enconf php8.3-fpm
sudo systemctl reload apache2
Then allow overrides for the WordPress directory in its virtual host:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/wordpress
<Directory /var/www/wordpress>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Add HTTPS with Certbot or your own certificates, and Apache is ready for the classic WordPress experience, plugin rules included.
Nginx: explicit and frugal
Nginx has no .htaccess. Every rule lives in the server configuration, which only an administrator can change and which takes effect on reload. That is safer and faster, but plugins that write .htaccess rules silently do nothing, so their rules must be translated by hand. Most popular plugins document Nginx equivalents.
The core of a WordPress server block on Ubuntu 24.04:
server {
listen 80;
server_name example.com;
root /var/www/wordpress;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.(?!well-known) {
deny all;
}
location = /xmlrpc.php {
deny all;
}
}
try_files is what makes pretty permalinks work. The dotfile rule hides files such as .git and .env while keeping /.well-known/ reachable for certificate challenges. Blocking xmlrpc.php removes a common brute-force target; skip that block if a plugin or app you rely on still uses XML-RPC. For page caching, Nginx's own fastcgi_cache can store rendered pages, or a caching plugin can write static files for Nginx to serve.
OpenLiteSpeed: caching built in
OpenLiteSpeed runs PHP through its LSAPI handler and pairs with the free LiteSpeed Cache plugin, which controls the server's full-page cache from the WordPress dashboard and purges pages when content changes. For a content site with many anonymous visitors, that is the most capable caching setup of the three without writing any configuration.
Its .htaccess support needs to be understood before you rely on it. OpenLiteSpeed applies rewrite rules written in Apache's mod_rewrite format and ignores other directives. Auto Load from .htaccess must be enabled in the WebAdmin console, and rewrite changes only take effect after a restart, so a plugin that edits .htaccess needs you to restart the server afterward. Server settings such as PHP limits live in the WebAdmin console, which listens on port 7080 by default; allow only your own address to reach it.
On CloudSat, WordPress and WordPress on OpenLiteSpeed are both one-click apps, so you can compare the two stacks on the same plan in an afternoon.
And Caddy?
Caddy is worth a look when automatic HTTPS and short configuration matter most. Like Nginx it has no .htaccess, and a WordPress site fits in a few lines:
example.com {
root * /var/www/wordpress
encode zstd gzip
php_fastcgi unix//run/php/php8.3-fpm.sock
file_server
}
Caddy obtains and renews the certificate for example.com by itself, and php_fastcgi already includes the fallback to index.php that WordPress permalinks need.
How to choose
- Plugins and editors who expect
.htaccessto work, or a site moved from shared hosting: Apache with PHP-FPM. - You own the configuration and run other apps on the same server: Nginx.
- A content site where page caching from a WordPress plugin matters most: OpenLiteSpeed with LiteSpeed Cache.
- Automatic certificates with the least configuration: Caddy.
When in doubt, pick the server your team already knows. A misconfigured cache or a forgotten security rule costs far more than any difference between the servers themselves.
To see what an existing site runs, read its response headers. The server header is often hidden, but cache headers give it away:
curl -sI https://example.com | grep -iE '^(server|x-litespeed-cache|x-cache)'
Hardening that applies to any of them
A few settings belong on every WordPress server, whichever software answers the requests:
- No PHP in uploads. The uploads directory should only ever serve media. In Nginx, add
location ~* ^/wp-content/uploads/.*\.php$ { deny all; }before the general PHP block; in Apache, a<Directory>block forwp-content/uploadswith<FilesMatch "\.php$"> Require all denied </FilesMatch>does the same. - No directory listings:
Options -Indexesin Apache; Nginx lists nothing unlessautoindexis on. - Fewer version details:
ServerTokens Prodin Apache,server_tokens off;in Nginx. - Upload limits that match:
client_max_body_sizein Nginx, orLimitRequestBodyin Apache, set to the same size as PHP'supload_max_filesize, so large uploads fail with a clear error instead of a timeout.
Several sites on one server
All three servers host many sites from one machine: virtual hosts in Apache and OpenLiteSpeed, server blocks in Nginx. Give each site its own system user and its own PHP-FPM pool (or LSAPI user in OpenLiteSpeed), so a compromised plugin on one site cannot read another site's files or wp-config.php.
What matters more than the server
- OPcache keeps compiled PHP in memory; confirm it is on with
php-fpm8.3 -i | grep opcache.enable. - PHP-FPM pool size: set
pm.max_childrenfrom the memory each PHP process really uses, or the server swaps under load. - An object cache such as Redis or Valkey with a matching plugin speeds up logged-in and dynamic pages that page caches skip.
- The database: give InnoDB a buffer pool large enough to hold the hot tables.
FAQ
Is Nginx faster than Apache for WordPress?
Nginx serves static files and many idle connections with less memory, but PHP execution and caching dominate WordPress response times. With a page cache in front, all three servers deliver cached pages quickly.
Can I use my .htaccess rules on Nginx?
Not directly. Nginx never reads .htaccess, so each rule must be rewritten as a location, rewrite or return directive in the server block. Check the plugin's documentation first; many publish Nginx versions of their rules.
Is OpenLiteSpeed the same as LiteSpeed Web Server?
No. OpenLiteSpeed is the open-source edition under GPL-3.0. LiteSpeed Web Server Enterprise is the commercial product, sold as a drop-in Apache replacement with fuller .htaccess compatibility. Both work with the LiteSpeed Cache plugin.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




