Nginx vs Apache in aaPanel: how to switch
Understand when to use Nginx, Apache, or OpenLiteSpeed in aaPanel. How to install and switch web servers,
On this page
aaPanel lets you install multiple web servers and choose which one handles each site. This flexibility is one of aaPanel's advantages over panels that lock you into a single stack. The right choice depends on your applications and priorities.
Nginx vs Apache vs OpenLiteSpeed
| Feature | Nginx | Apache | OpenLiteSpeed |
|---|---|---|---|
| Performance | Excellent (async, low memory) | Good (process/thread based) | Excellent (event-driven) |
| .htaccess support | ❌ Not supported | ✅ Full support | ✅ Compatible |
| WordPress caching | Needs caching plugin | Needs caching plugin | LiteSpeed Cache plugin (very fast) |
| Memory usage | Very low | Higher (per-process) | Low |
| Config syntax | Nginx blocks | Apache directives | Apache-compatible |
| PHP integration | FastCGI / PHP-FPM | mod_php or PHP-FPM | Built-in LSPHP |
Which should you use?
- Nginx: Best default choice for most VPS setups. Very efficient on low-memory VPS. Good for WordPress with a caching plugin. Does not support
.htaccess - Apache: Choose Apache if your application relies on
.htaccessfor routing or per-directory configuration. Slightly higher memory use. More compatible with legacy PHP apps - OpenLiteSpeed (OLS): Excellent for WordPress performance, especially with the LiteSpeed Cache plugin. Supports
.htaccess. A good middle ground between Nginx speed and Apache compatibility
For new WordPress deployments on a capable VPS, OpenLiteSpeed + LiteSpeed Cache is often the fastest combination. For a simple PHP site or tight memory budget, Nginx is the most efficient.
Install a web server
- Go to aaPanel → App Store
- Find the web server you want (Nginx, Apache, or OpenLiteSpeed)
- Click Install
- Wait for installation to complete
aaPanel can have both Nginx and Apache installed simultaneously, though only one should be the primary server on port 80/443. You can use Nginx as a reverse proxy in front of Apache if needed, but for most sites, run one or the other.
Switch web servers
Each web server uses its own configuration format. If you switch from Apache to Nginx after setting up sites, the existing Apache vHost configs are not compatible with Nginx-you must recreate each site's configuration. Always create a full backup before switching.
To switch the active web server on port 80/443:
- Stop the current web server: aaPanel → App Store → current server → Stop
- Install the new web server if not already installed
- Start the new web server
- Recreate site vHosts under the new server by visiting each site's configuration in aaPanel → Website
.htaccess on Nginx in aaPanel
If you run Nginx, .htaccess files in your document root are not read. Rules you would normally add to .htaccess must be added to the Nginx site configuration instead:
- WordPress permalinks: Apply the WordPress URL rewrite template in aaPanel → Website → your site → URL rewrite → select WordPress
- Custom redirects: Add to the site's Nginx config via Website → your site → Config
- PHP settings: Use a
user.inifile in the document root instead of.htaccessPHP directives
If .htaccess compatibility is essential, use Apache or OpenLiteSpeed instead.
Restart web services safely
Restart or reload the web server from aaPanel to apply config changes:
- aaPanel → App Store → your web server → Reload (graceful-no active connections dropped)
- aaPanel → App Store → your web server → Restart (full restart-use when Reload is not sufficient)
Via SSH:
# Nginx
systemctl reload nginx
# Apache
systemctl reload apache2
# OpenLiteSpeed
systemctl restart lsws
Related: What is aaPanel? Overview for UnderHost VPS customers | Create a website in aaPanel | How to create a WordPress site in aaPanel | aaPanel troubleshooting-common issues and fixes
Need aaPanel hosting?
Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.





















