Live data from Hacker News

Nginx has replaced Apache as the most used web server among the top 10,000 sites

w3techs.com

61–70 of 76 posts

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#61
post #55
post #28

Did anyone else pause when they read the title line... "Usage of web servers broken down by ranking". I'm picturing a graph of the most commonly broken web servers for half a second.

I'll take the downvotes as a "no we didn't, and we think you are trying to be funny". But, I actually did read that for a half a second and think the phrase "broken down" can be done without. It doesn't add anything in my opinion, I know it is broken down (its a graph), the phrase is unnecessary, and it caused me at least to stumble mentally for half an instant.

Hypothetically, a company like Hyperspin could create a chart of webservers that were offline (most likely to break) in the past X days. I think the results would be interesting. Example: Out of 1,234 servers that were offline for > 1 hour in the last month, 40% Microsoft, 30% Apache, 20% NginX, etc.

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#62

I'm confused by this title and the article here. The graph in the linked shows that "Apache is used by 60.5% of all the websites." while nginx is at 20.7%... How could these numbers possibly mean that nginx has replaced Apache as the most used web server? When is 60.5% more than 20.7%? IS it opposite day?

You need to look at the legend. For the top 10,000 websites, Apache is used by 39.1%, and nginx is used by 39.2%.

I see now; I didn't notice the distinction in the subject header here.

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#64
post #56

Earlier quoted context omitted.

curl -I www.ycombinator.com This gives you the HTTP Header, example output: HTTP/1.1 301 Moved Permanently Server: nginx Date: Mon, 26 May 2014 16:11:30 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: http://ycombinator.com/

Oh wow, that's cool. I didn't know that. Thanks.

For a laugh do it on http://www.reddit.com/

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#65

We abandoned Apache as we found configuring Tomcat with Apache to be a major pain whereas configuring NGINX with Tomcat or other J2EE application servers is almost a no-brainer. Ditto with SSL termination. Since then we've moved all static file serving to NGINX as having both Apache and NGINX did not make sense. I know that a lot of other JVM shops did the same.

How do you do this? Are just using a proxy?

I use mod_jk with Apache. With mod_jk you use the AJP protocol to communicate with Tomcat. It's one line in your Apache config and a few lines in /etc/libapache2-mod-jk/workers.properties (Debian)

Are there any support for AJP for Nginx today?

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#67
post #30
post #24

Earlier quoted context omitted.

If you have anything to do with Drupal (and possibly Wordpress) as well, you might run into issues. At least concerning Drupal, a lot of plugins require changes to the .htaccess file(s), and at least when I tried, this was hard to translate to nginx. But there are some .htaccess to nginx converters, so I'm not sure if that is a big issue at this time. And as others have said, you might find the nginx approach to be m…

Drupal works flawlessly with Nginx[1], and there is little magic involved. You even have good handling of private files, permission and such. There's only a few modules that require changes to the default ".htaccess" (basically just overriding Apache default logic) of Drupal, like the module Boost. But since Nginx can serve as both a application server and reverse proxy, you can have the best of both worlds, without…

Thanks for the information! I've mostly moved away from Drupal, but I still maintain a number of sites for some clients. Good to know a move to nginx is an option.

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#68
post #65

We abandoned Apache as we found configuring Tomcat with Apache to be a major pain whereas configuring NGINX with Tomcat or other J2EE application servers is almost a no-brainer. Ditto with SSL termination. Since then we've moved all static file serving to NGINX as having both Apache and NGINX did not make sense. I know that a lot of other JVM shops did the same.

How do you do this? Are just using a proxy? I use mod_jk with Apache. With mod_jk you use the AJP protocol to communicate with Tomcat. It's one line in your Apache config and a few lines in /etc/libapache2-mod-jk/workers.properties (Debian) Are there any support for AJP for Nginx today?

Stuck on Mod_jk and AJP ? I feel your pain ; and I fled from it a long long time ago.

You don't need AJP with NGINX; this enables you to easily work with any J2EE app server or web server . I ran into issues with configuring glassfish with Apache and thus began using NGINX. Why bother with AJP ?

Yes setting up NGIX as a reverse proxy for Tomcat/ Glasshfish whatever is very simple. Setp a NGINX on your desktop and you will never have to connect to port 8080 ever again. Also it can serve static content while lettting your app server handle application urls.

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#69
post #22

Earlier quoted context omitted.

Just give it a go. Remember you can set it up to run on another port, e.g. 81, 8080 etc. so you can get it working whilst still having Apache up and running on your site. For popular CMS applications you can normally find some helpful .conf file to get you started. You will also need to setup php-fpm if you are running a PHP flavoured 'LAMP' stack.

Cool! I never thought of that! Will it be noticeably faster than my current (tuned) Apache setup?

Nginx is faster, however, it is possible to get Apache to be quick and it is possible to make nginx slow (I think 'if' statements are to be avoided in the config).

However, as well as speed there is also the amount of load that can be sustained. Nginx wins on this front as well as with speed.

As mentioned, run it on another port and see for yourself. When you are happy with it turn off apache on the chkconfig, set nginx to the other port, stop apache and run nginx -s reload to swap over the port. Yep, you can get the whole thing installed, tested and deployed without reboot or downtime!

Re: Nginx has replaced Apache as the most used web server among the top 10,000 sites

#70

Earlier quoted context omitted.

Oh wow, that's cool. I didn't know that. Thanks.

For a laugh do it on http://www.reddit.com/

I get this:

    $ curl -I www.reddit.com
    HTTP/1.1 200 OK
    Content-Type: text/html; charset=UTF-8
    x-frame-options: SAMEORIGIN
    x-content-type-options: nosniff
    x-xss-protection: 1; mode=block
    Server: '; DROP TABLE servertypes; --
    Date: Mon, 26 May 2014 18:37:12 GMT
    Connection: keep-alive
    Vary: accept-encoding
Post reply on HN