New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Which is the better web server stack: Nginx or Apache?
I have multiple static and dynamic websites including WordPress, which server is best suited for me ? Currently I am using apache but I heard that for high volume traffic Nginx Is best. Or should I use nginx as a reverse proxy server ? I mean front of Apache
Comments
I'm using Caddy HTTP server at the front because it offers the easiest TLS configuration including automatically obtaining certificates.
Some of my sites have nginx behind Caddy, so that I can have server-side FastCGI caching.
So caddy offer full functionality? Or need to configure it manually
This is just plain software, not a control panel which automated things for you.
I don't notice much difference in speed or resource consumption between apache and nginx when using php too. The webserver isn't really the bottleneck with php and apache's rewrite are much more comfortable with .htaccess than nginx vhost-config. I use nginx on the download server but I suppose this isn't your use case when you've WordPress installed.
A sample Caddyfile for a simple PHP site:
TLS is entirely automatic: just put
https://
in front of the domain name.HSTS and other security headers need manual configuration, as shown in
header
directive.The structure of this app is (1)
index.php
handles all dynamic requests (2)/static/
folder contains static assets.This is expressed in
root php_fastcgi file_server
directives.More complex rewrite rules are supported too.
Not sure if you are already aware of these options:
https://wordops.net/ (EasyEngine w/o Docker) (free)
https://centminmod.com/ (free)
https://runcloud.io/ (paid)
@yoursunny Automatic TLS is not really compelling to drop using Apache and NGINX especially when Certbot works great now. In Ubuntu you don't even need to setup a cron job for renewal anymore.
if you can do +nginx
You mean Ngnux Plus ?
For Wordpress go with Nginx + FastCGI + cache on tempfs or OpenLitespeed + LSCache plugin.
Or use Centminmod and everything will be optimised perfectly. Good security practices, working cache, auto ssl certs, brotli support etc.
I'm using Nginx. It is fast and has low memory footprint. There is also a plugin of certbot that automatically creates and renew letsencrypt (Certbot-Nginx)
I use virtualmin, so Nginx +FastCGI +Cache on tempfs is better? Or should I opt for Openlitespeed?
Theyre on top. You cant really say which is better. Try both
If you want self-renewing SSL, Apache ships with mod_md as well. From what I've squeezed out, NGINX is faster all things being equal (no per-request .htaccess parsing, all configuration existing solely at startup). It's a matter of microseconds, which unless you're pushing significant static file throughput won't make a difference.
If I were building a CDN, then I'd select NGINX (or maybe h2o). If I were building a server I concerned myself with total security, then I'd pick whatever stack I'm most comfortable with and makes the most sense to me and optimize downstream for bigger problems.
I am running PHP so apache is prefered. I don't like php_fcgi.
cpu usage
whether cpu saving in nginx ????
i know apache is ram wasteful, ... but ram is cheap
i am on varnish + apache + memcached and other cache
Wordops uses nginx (cmm also). Wordops is easy to setup and runs well. This said, it looks a bit like development stopped in 2020 and no updates for a while. I am no Centminmod user, but feels like they stay up-to-date, have php8 etc.
I would swop to cmm, but changing O/S (Debian > CentOS) makes me feel very uncomfortable. Or tell me I am wrong ;-)
My shot at the question: Seems nginx has a speed advantage over Apache.
Interesting... unless timeline on github is messed up.
https://github.com/WordOps/WordOps.
One can add slickstack and webinoly to the above list. I believe the developer of slickstack is/was a member on LET. Edit: @jessuppi
Define best. What does it mean for you?
-Ease of configuration?
-Community/support/documentation?
-Suitability for your desired use case?
-Security/updated?
-Resource usage?
-Multi-user?
Define high traffic:
e.g.
1000 concurrent users?
10000 users a day?
1000000 user a a month?
deleted.
I have no idea, but making PHP7.4 default isn't really a noticeable update IMHO. Their changelog ends in 10/20
https://github.com/WordOps/WordOps/blob/master/CHANGELOG.md
Just checked and indeed, Apache is still around. Wow...who knew?!? Anyone here still using it?
I personally dropped that dog at least a decade ago. I think the sole remaining use case is someone who gets aroused by .htaccess files and just can't let them go, or wants to use some ad-inserting module from 2001.
Use NGINX.
nginx vs openlitespeed, which is better?
nginx is the best
if you can do
and
if no error
but most easy is apache
Depend on your usage and configuration.. mostly nginx perform better..
Why not to use both Nginx and Apache, as you can use as reverse proxy, we do use a few projects Nginx as front web server and performance is great.
Apache FTW, a true free solution. Human readable, ton of modules, stable. Nginx can make a difference in busy site, but holy f with their module support. Nginx is built from the ground up to be monetized and converted into their Nginx Plus.
Lighttpd one love
Dealing with Nginx configs is nauseating, and Apache by now is something from 1995, who still uses that.
That said, I'm using Nginx at the moment, because of the better reverse proxy support (than in Lighttpd).
Apache is our first web server when we deployed our ajax heavy web-app and it is slow, we received complains from our client that our website is slow.
I removed the apache and install nginx (default config) is so awesome. Compared to apache, the nginx rocks and able to handle lots of request. It is is based on my experience so no biased comments here.
apache slows down when it got around 1-2k request/second on the other hand nginx is able to scale and able to handle 4k-5k request with ease.
We rarely use static content, so cache is not really suited for us. Almost 90% of request are dynamic and data changes so cache feature is out for us.
Our server that time is intel corei3 with 16GB ram and 256SSD + 2TB HDD at 1Gbps port speed.
Nginx wins for me.
Please do note, that both webserver at that time runs on a default config. I just add the vhost and some ssl settings. Nginx performs better so I did not bother going back with apache again.
BTW, I used apache on my dev environment (home)
Now, I tweaked Nginx a little and so far so good. It rocks.
I was using nginx from the LEB Script day.
Just switch to OpenLiteSpeed for about a month because it’s so easy to use. They got their own webadmin or you can use with cyberpanel…
Cyberpanel is stable now ? Need to refresh server if do some tweak ...
if only on one page at drupal or wordpress
working on cdn + other cache
then it feels very small traffic