Apache, LiteSpeed, and Nginx for WordPress

A web server is the first element of your infrastructure that responds to browser requests. Its configuration affects page load times, behavior under heavy load, security, and how it communicates with the PHP interpreter. For WordPress, the choice usually comes down to three technologies: Apache, LiteSpeed, and Nginx. Each has specific advantages, limitations, and scenarios where it performs best.

At WebOptimo, we configure and administer all three servers. We adapt the technology to project requirements rather than the other way around. Based on this approach, we have prepared a detailed overview of Apache, LiteSpeed, and Nginx, sharing practical insights from our deployments. We also compare LiteSpeed and Apache performance based on real production environments.

Apache: the foundation of WordPress hosting

Apache HTTP Server is the longest developed and most widely used web server in the WordPress ecosystem. Its key advantage is native support for .htaccess files, which WordPress relies on for permalinks, redirects, security rules, and access control. The vast majority of shared hosting environments run on Apache, and any WordPress plugin that modifies .htaccess (for security, caching, or redirects) assumes Apache is the underlying server.

.htaccess Apache reads .htaccess files dynamically without needing a server restart. A shared hosting user can modify rewrite rules, permalinks, and security settings without accessing the main server configuration. This is the foundation that the entire WordPress plugin ecosystem is built upon. Read more about Apache configuration in our article about Apache for WordPress hosting.
MPM and performance Apache offers three Multi-Processing Modules (MPM): prefork (process-based, compatible with mod_php), worker (hybrid), and event (event-driven, the most efficient). In production environments, we use MPM Event combined with PHP-FPM. This provides significantly better performance than the default prefork with mod_php found on many hosting providers.
Modules mod_rewrite for permalinks and redirects, mod_security for WAF, mod_headers for security headers, mod_expires for browser caching, and mod_deflate for compression. Apache boasts the richest module ecosystem among the three servers discussed, although Nginx and LiteSpeed cover the most important functions with their own implementations.
When we use Apache We use it on shared hosting setups where .htaccess is the only way to configure the server. It is also great for VPS and dedicated servers where the project requires full compatibility with the WordPress plugin ecosystem. Additionally, it works exceptionally well in a configuration with Nginx acting as a reverse proxy at the frontend and Apache at the backend, which blends the speed of Nginx with the versatility of Apache.

LiteSpeed: performance with Apache compatibility

LiteSpeed Web Server (LSWS) is a commercial web server designed as a drop-in replacement for Apache. It reads .htaccess and httpd.conf files, supports mod_rewrite and mod_security, and operates on an event-driven architecture. This allows it to handle thousands of concurrent connections with significantly lower memory usage. Its greatest advantage over Apache is the built-in LSCache, which caches full HTML pages at the server level, bypassing PHP entirely. We describe a detailed comparison of LiteSpeed and Apache in our article on LiteSpeed and OpenLiteSpeed for WordPress.

LSCache A server-level cache that bypasses the PHP interpreter. An anonymous user's request reaches LiteSpeed, the server checks the cache, and returns the response without launching WordPress. A dedicated LiteSpeed Cache plugin for WordPress manages invalidation, supports Edge Side Includes (ESI) for dynamic fragments like WooCommerce carts, and provides image optimization via QUIC.cloud.
LSAPI vs PHP-FPM LiteSpeed communicates with PHP through its proprietary LSAPI interface, utilizing shared memory instead of the Unix/TCP sockets used by PHP-FPM. With a large number of simultaneous dynamic requests, LSAPI exhibits higher throughput. This difference is especially noticeable under heavy traffic on WooCommerce stores and portals with many logged-in users.
License and cost LiteSpeed Enterprise requires a license that ranges from $10 per month for the Site Owner plan (5 domains) to $92 per month for Web Host Elite. There is a free version called OpenLiteSpeed, but it offers limited Apache compatibility as it requires a restart after .htaccess changes and lacks cPanel/Plesk integration. For a single site on a VPS, OpenLiteSpeed is a reasonable choice, while for hosting providers, Enterprise is the only viable option.
When we use LiteSpeed We choose LiteSpeed for projects expecting high traffic right from the planning stage, where quick server response time is a priority. This includes large WooCommerce stores with thousands of products, dynamic content portals, and platforms with numerous concurrent users. If the budget allows for the license fee, the benefits of LSCache and LSAPI translate directly into lower TTFB and reduced server load.

Nginx: HTTP server and reverse proxy

Nginx is an event-driven web server that manages an enormous number of concurrent connections with minimal resource consumption. In the WordPress ecosystem, it fulfills two roles: a standalone HTTP server where an administrator directly manages the configuration, and a reverse proxy in front of Apache or LiteSpeed. Nginx does not support .htaccess files, meaning all rules must be translated into server block configuration. This makes it less convenient on shared hosting setups, but provides total control on managed servers. Configuration details are covered in our article Nginx in WordPress hosting.

Reverse proxy This is the most common role for Nginx in a WordPress infrastructure. At the frontend, Nginx terminates SSL/TLS connections, serves static files such as CSS, JS, images, and fonts, and caches responses using FastCGI cache. Meanwhile, Apache or PHP-FPM at the backend generates dynamic content. This stack marries the performance of Nginx with the compatibility of Apache. We cover reverse proxy configurations in a separate guide.
Standalone HTTP server On VPS and dedicated servers, where the administrator manages configurations directly, Nginx can host WordPress on its own with PHP-FPM. Rules for permalinks, redirects, and security are configured inside server blocks instead of .htaccess. This requires administrative expertise but delivers maximum performance and absolute control. We detail the LEMP stack (Linux, Nginx, MariaDB, PHP-FPM) in our publication about LEMP architecture.
FastCGI cache Nginx features a built-in FastCGI cache that stores full PHP responses on the disk. This cache operates at the server level, skipping PHP execution when serving cached pages, much like LSCache does in LiteSpeed. The difference is that FastCGI cache requires manual configuration for caching rules and invalidation, whereas LSCache manages this automatically via a WordPress plugin.
When we use Nginx We utilize it as a reverse proxy on VPS and dedicated servers when we want to combine Nginx's speed with Apache's flexibility. We also deploy it as a standalone HTTP server for applications that do not need .htaccess, such as headless WordPress, APIs, Node.js, and Python apps. Additionally, it works exceptionally well in setups with multiple backend systems, where Nginx distributes incoming traffic as a load balancer.

LiteSpeed vs Apache vs Nginx: our deployment scenarios

Each of the three servers has scenarios where it truly shines as the optimal choice. Below, we describe how we match the technology to the specific requirements of our clients' projects.

Shared hosting

Apache or LiteSpeed Enterprise

On shared hosting platforms, the choice of web server belongs to the provider. Apache is the standard utilized by most hosts. An increasing number of hosting companies are offering LiteSpeed Enterprise, which is a massive advantage due to LSCache. Nginx on shared WordPress hosting is practically non-existent because it lacks .htaccess support. We always pay attention to the web server when selecting a provider. Read more in our WordPress hosting selection guide.

VPS and Dedicated Server

Apache + Nginx reverse proxy

This is the most common setup on servers we manage. Nginx at the frontend handles SSL, static files, and FastCGI cache, while Apache at the backend processes PHP with full .htaccess compatibility. The stack combines Nginx performance with the Apache ecosystem, is free, and requires no licenses. This is our default recommendation for server administration.

High traffic

LiteSpeed Enterprise

Ideal for projects anticipating thousands of concurrent users, large WooCommerce stores, or portals packed with dynamic content, provided the budget covers the license cost. Under heavy load, LSCache and LSAPI offer a noticeable advantage over the Apache + Nginx setup. We configure LiteSpeed with complete integration of the LSCache plugin, ESI for WooCommerce, and anti-DDoS protection.

Applications without .htaccess

Nginx as a standalone server

Perfect for Headless WordPress with REST API, Node.js applications, Python, and backend APIs. Wherever .htaccess is not needed, Nginx as a standalone server delivers outstanding performance at zero cost. When combined with PHP-FPM and FastCGI cache, it handles WordPress just as efficiently as LiteSpeed, it just requires manual rule configuration.

Scope of work in web server configuration

Every web server configuration is a customized effort tailored precisely to project needs. Below is the typical scope of activities we carry out during deployment and ongoing administration.

Installation and base configuration Installing the web server from a stable repository, setting up virtual hosts for Apache or server blocks for Nginx, adjusting directory permissions, and configuring access and error logging. We also fine-tune request limits and timeouts. For LiteSpeed Enterprise, we additionally configure the license and the WebAdmin console.
SSL/TLS and security Deploying SSL/TLS certificates such as Let's Encrypt or commercial ones, setting up HTTPS, HTTP to HTTPS redirects, HSTS headers, X-Frame-Options, and Content-Security-Policy. Configuring mod_security for Apache and LiteSpeed or equivalent protections in Nginx. Restricting access to the WordPress administration panel via server rules.
PHP-FPM and LSAPI Configuring PHP-FPM with dedicated pools per site, tuning pm.max_children based on available RAM, setting up OPcache, and adjusting PHP memory and execution time limits. For LiteSpeed, configuring LSAPI with lsphp processes and closely monitoring resource usage.
Server-level cache Configuring FastCGI cache in Nginx with rules to bypass caching for logged-in users, WooCommerce carts, and forms. Setting up LSCache in LiteSpeed alongside the WordPress plugin, fine-tuning TTL, ESI rules, and integrating with Redis as an object cache. For Apache, implementing a reverse proxy with Nginx or Varnish as a caching layer.
Performance tuning Optimizing system kernel configurations using sysctl parameters like net.core.somaxconn, tcp_tw_reuse, and tcp_fin_timeout. Tuning worker_connections in Nginx, MaxRequestWorkers in Apache, gzip and brotli compression, browser cache headers, and HTTP/2. Analyzing access logs to pinpoint bottlenecks. Monitoring the impact of changes on Core Web Vitals.
Monitoring and maintenance Performing regular updates to the web server and PHP, monitoring service availability, analyzing error logs, and promptly responding to security incidents. Conducting periodic reviews of the configuration to accommodate new versions, such as Apache 2.4.67, Nginx 1.30, LiteSpeed 6.x, and evolving WordPress requirements.

Apache, LiteSpeed, Nginx. Questions and answers

There is no single universal answer. Apache is the default option for most hosting providers and WordPress sites due to native .htaccess support. LiteSpeed provides better performance thanks to LSCache and LSAPI, but it requires a commercial license. Nginx performs brilliantly as an HTTP server for applications not relying on .htaccess, and as a reverse proxy in front of Apache or LiteSpeed. The right choice depends on traffic volume, budget, and the technical skills of your team.

LiteSpeed and Apache read the same configuration files like .htaccess and httpd.conf, but their architectures differ. Apache in prefork mode creates a distinct process for each connection, while LiteSpeed uses an event-driven model to handle thousands of connections with reduced RAM footprint. LiteSpeed has built-in server-level cache called LSCache, its own PHP interface named LSAPI which outpaces PHP-FPM under heavy load, and native anti-DDoS protection. Apache is completely free, while LiteSpeed needs a commercial license.

WordPress relies on .htaccess files to handle permalinks, redirects, and security rules. Nginx does not read .htaccess files because it uses its own configuration format via server blocks. The .htaccess rules must be manually translated into Nginx configuration, which requires server administration skills. Therefore, Nginx is most frequently used as a reverse proxy in front of Apache or as a standalone server in setups where an administrator manages the configuration directly.

Yes, this is an established and highly effective configuration. Nginx at the frontend terminates SSL, serves static content, and caches responses, while Apache at the backend handles PHP with complete .htaccess and mod_rewrite compatibility. This stack combines the efficiency of Nginx with the versatility of Apache. We deploy this architecture on VPS and dedicated servers where we have full control over the infrastructure. Discover more in our article about reverse proxy setups.

LSAPI interacts with PHP via shared memory, which reduces overhead compared to the Unix and TCP sockets used by PHP-FPM. During surges of concurrent dynamic requests, LSAPI shows higher throughput. Under moderate traffic with a properly tuned cache, the performance gap is less pronounced. PHP-FPM is universally applicable and compatible with any server, whereas LSAPI works only with LiteSpeed.

Apache and Nginx are completely free and open-source software. LiteSpeed Enterprise requires a license starting at $10 monthly for the Site Owner plan allowing 5 domains, up to $92 monthly for Web Host Elite. There is a free edition named OpenLiteSpeed, but it has limited compatibility with Apache, requiring restarts after updating .htaccess. A LiteSpeed license easily pays for itself under high traffic conditions, where LSCache and LSAPI significantly reduce server load.

Let's discuss your web server configuration

We will analyze your infrastructure and propose a web server configuration perfectly tailored to your project's requirements. Apache, LiteSpeed, Nginx, reverse proxy, or PHP tuning – you will receive a concrete proposal after a brief conversation.

Phone

+48 608 271 665

Mon–Fri, 8:00–16:00 CET

Email

contact@weboptimo.pl

We respond within 24h

Company

WebOptimo

VAT ID: PL6391758393