you Whenever you open your favorite browser, be it Chrome, Firefox or Edge, you need a web server to communicate to. Apache and Nginx are those of the most common web server software that renders html pages to your browser. This article is a showdown: Apache vs Nginx. It is a simple comparison of both of their features, pros and cons. So lets start with what Apache server as to offer and then follow with nginx server features.
Apache
Apache was released first in 1995 and it is still dominating the market usage till today. Some say it is because Apache is the by default web server installed in most linux distribution. Others will say that for legacy reason and by not “upgrading” to Nginx, Apache still dominates. Nevertheless, it is a software currently on version 2.4.
But for what reasons could this software came as the dominant player in the web server market ? Mostly because of its ease of configuration with files, the .htaccess file and the dynamic module system. The official modules list for Apache is listed here. These modules are allowing to extend the functionnality of Apache. These modules can be added and removed, enabled and disable after the software has been install, which makes it very easy to add or remove functionnality for Apache.
Nginx
The nginx configuration capabilities is less developped then Apache, thus making it less popular in Shared Hosting situation. For example, Nginx does not allow a per directory configuration. However, The speed and the ease of use makes it for this shortcoming.
Apache vs Nginx
The market share of both HTTP server software is respectively 1st and 2nd on the market according to W3Techs.com usage survey. But other web browser do exists. Notably Cloudflare-Server, Microsoft IIS and LiteSpeed.
The main difference between Apache and Nginx is the way they handle requests. Apache will use a process for every connection it received while Nginx will have one process that can handle tens of thousand of connections. The load on the server is eventually not the same in high traffic situation. The overhead of spawning a process each times comes with a performance cost.
Conclusion
As both software are open source and free, they both have an edge on competition. But if I had to choose one i would choose NGINX as my server of choice because of the less ressource intensive setup, and I wouldnt need a complex configurations for a website. Serving fast content is important. What would be your choice for a web server software ?