Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you know any reason to use Apache instead of Nginx? [closed]

Do you know any reason to use Apache instead of Nginx? I'm talking about a "new project" with no any legacy code or configuration.

updated:

Most popular reasons to use Apache are:

  • we have our rewrite config
  • we have our application, working on Apache

..it is OK for legacy app. But what about absolutely "new app 2013"?

What do you think?

BTW, I know about topics:

  • Nginx and Apache
  • Nginx vs Apache or using Apache with nginx
  • Nginx v Apache for high traffic sites
  • Use Nginx or Apache for serving dynamic content?

..and I can't find any pro for Apache there. Could you point me?

like image 368
Sergei O. Udalov Avatar asked Jan 22 '13 12:01

Sergei O. Udalov


People also ask

Why use Apache instead of Nginx?

Apache HTTP Server has a multi-threaded architecture which lacks scalability. Whereas Nginx follows an asynchronous event-driven approach to handle multiple client requests. Its event-driven architecture is designed to facilitate better performance even under heavy traffic.

Do I need Apache or Nginx?

At serving static content, Nginx is the king! It performs 2.5 times faster than Apache according to a benchmark test running up to 1,000 simultaneous connections. Nginx serves the static resources without PHP having to know about this. On the other hand, Apache handles all those requests with that costly overhead.

What is the difference between Apache and Nginx?

Apache is an open-source web server. Nginx is a web server. It is also used as a reverse proxy server which revices the request from client and send the request to proxy server.

Why should you use Apache?

Apache HTTP web servers are used by over 67% of all web servers in the world. Apache web servers are easy to customize environments, they're fast, reliable, and highly secure. This makes Apache web servers a common choice by best-in-class companies.


2 Answers

Apache is still the most popular web server on the Internet, estimated to serve about 55% of all websites in existence, compared to nginx's 12% (in Jan 2013).

UPDATE (Apr 2015): Apache still has the largest share at about 40%, and nginx has grown to 15%. Check the above mentioned link for the latest figures.

UPDATE (Jul 2020): nginx has comfortably surpassed Apache in popularity at 37% vs 25%. Apache still has more hits on searches.

It is the oldest web server around, which means that you won't have any trouble finding people skilled in configuring it.

You're also slightly more likely to find help when searching the web. SO has ~80,000 tags for Apache, and ~40,000 for nginx.

Installation documents sometimes assume you're using Apache, often including .htaccess documentation, but not the equivalent nginx configuration:

  • Yii 1.0 was only tested with Apache
  • Yii 1.1 only has clean URL instructions for Apache
  • CodeIgniter 2.0 only has .htaccess instructions for Apache
  • CodeIgniter 3.0 still only has .htaccess instructions for Apache in the clean URL section
  • The Drupal setup page has notes for Apache and IIS, but nginx is only mentioned in the comments, and at least one person is having trouble getting the nginx settings working

My recommendation? Either are perfectly good choices, flip a coin if you can't find any compelling reasons either way.

like image 148
Gustav Bertram Avatar answered Sep 16 '22 18:09

Gustav Bertram


Feb 2018 response here.

Apache is 47.4% (-3.3% 1 year), Nginx is 36.8% (+4.4% 1 year)

The trend is linear, by 2020 if nothing happens, Nginx will be the most used.

Nginx was made for supporting lots of concurrent requests, which modern apps usually do, like small Ajax requests, and less full page loads.

I've seen Benchmarks ( for a static resource), and Nginx MURDERS Apache, both in requests per seconds and RAM usage.

I've realized all this an hour ago, I’ve been using apache for lots of years, and I’m migrating just after writing this post.

Conclusion for 2018: Go for Nginx.

Bench:dreamhost Web-server-performance-comparison

Share:w3techs.com web_server

Share 2: netcraft.com web-server-survey

like image 35
Vixxs Avatar answered Sep 17 '22 18:09

Vixxs