{"id":337816,"date":"2021-09-10T19:00:00","date_gmt":"2021-09-10T16:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/which-web-server-is-the-better-choice-cloudsavvy-it\/"},"modified":"2021-09-10T19:00:00","modified_gmt":"2021-09-10T16:00:00","slug":"which-web-server-is-the-better-choice-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/which-web-server-is-the-better-choice-cloudsavvy-it\/","title":{"rendered":"#Which Web Server Is the Better Choice? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a26ea2aadd73\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a26ea2aadd73\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/which-web-server-is-the-better-choice-cloudsavvy-it\/#Nginx_Is_Newer_and_Faster\" >Nginx Is Newer and Faster<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/which-web-server-is-the-better-choice-cloudsavvy-it\/#Apache_Is_More_Configurable\" >Apache Is More Configurable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/which-web-server-is-the-better-choice-cloudsavvy-it\/#Which_Server_Should_You_Choose\" >Which Server Should You Choose?<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#Which Web Server Is the Better Choice? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage imgchk9 alignnone wp-image-1044 size-full\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/19a6a908.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/19a6a908.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/19a6a908.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Apache vs. Nginx\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Nginx and Apache combined serve over 50% of the web. But Apache has seen a decline in recent years, in favor of Nginx. Is Nginx really better, and are there any benefits to using Apache?<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Nginx_Is_Newer_and_Faster\"><\/span>Nginx Is Newer and Faster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1039 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/8eec83d3.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Nginx can process multiple connections within a single process thread\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Nginx is much more lightweight than Apache. This is a problem rooted in design\u2014under the hood, Apache must create a new process thread for every connection. And while it may process 10 threads at a comparable speed to Nginx, when it\u2019s scaled up to hundreds of concurrent connections Nginx takes a deciding lead.<\/p>\n<p>Nginx works differently, and can process multiple connections within a single process thread. It\u2019s designed to also function as a simple reverse proxy, so rather than bring the overhead of a full web server it\u2019s simply designed to move bytes of data from one place to another. Nginx can be over twice as fast as Apache when serving static content, and much less CPU intensive when doing so, which makes it excellent for running on low powered systems.<\/p>\n<p>However, this speed only really matters when serving static content to a lot of users at once. When you start serving dynamic content, the bottleneck lies elsewhere, such as in your PHP engine, your web <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>, or your database.<\/p>\n<p>Because Nginx is also a reverse proxy, you can use it in front of another server (even Apache) specifically to host static content. A useful example is server-side rendering Node applications, where HTTP requests to dynamic pages need to be forwarded to a server running Express, but static resources (images, stylesheets, etc.) can be served from Nginx. The overhead when doing this is minimal, and can speed up static content significantly.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Apache_Is_More_Configurable\"><\/span>Apache Is More Configurable<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1040 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/89340871.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Apache logo\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Apache is more focused on being a web server, and has some useful features like directory-based configuration files and virtual hosts. This makes running multiple sites on the same server very easy. For example, you can add a VirtualHost block like this to <code>\/etc\/httpd\/conf\/httpd.conf<\/code>:<\/p>\n<pre>&lt;VirtualHost 127.0.0.1:80&gt;&#13;\n  DocumentRoot \/var\/www\/html&#13;\n  ServerName www.firstsite.com&#13;\n&lt;\/VirtualHost&gt;<\/pre>\n<p>This will make Apache route all requests to <code>www.firstsite.com<\/code>\u00a0to a specific folder, which can have its own settings independent of other sites running on the server. This can be further augmented with <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/httpd.apache.org\/docs\/2.4\/howto\/htaccess.html\"><code>.htaccess<\/code>\u00a0files<\/a>, which can overwrite the server config for a specific folder. However, running sites with\u00a0<code>.htaccess<\/code>\u00a0files is slower than using global config, and is only recommended in cases where you want to allow other users to modify the server settings for a directory without touching the global config (shared hosting is the main example of this).<\/p>\n<p>Nginx can also serve multiple domains from a single server, and route them to their own folders, but it\u2019s just not as configurable, especially with a lack of functionality similar to <code>.htaccess<\/code>. But, if you\u00a0<em>really<\/em> need that kind of functionality, you could use Nginx as a reverse proxy to access content served elsewhere, even running on another instance of Nginx or multiple Docker containers.<\/p>\n<p>Apache also has much better plugin support, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/maven.apache.org\/plugins\/index.html\">in the form of modules<\/a> that can be dynamically loaded without restarting the server. Nginx also supports modules, but only recently added module loading, so many modules still require you to patch the binary.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Which_Server_Should_You_Choose\"><\/span>Which Server Should You Choose?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Despite the shortcomings, they\u2019re both decent web servers. They\u2019re both free and open source, though Nginx does have a paid version called <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.nginx.com\/products\/nginx\/\">Nginx Plus<\/a>\u00a0that adds a software load balancer on top of open-source Nginx. Both servers are secure, have good support communities, and are easy to configure. While Nginx wins in speed, both are comparable at serving dynamic content.<\/p>\n<p>If you\u2019re unsure which to use, go with Nginx. In <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a>, if you\u2019re running a Unix system, Nginx is a good choice simply due to its speed and ease of use. If you need more configuration, especially if you\u2019re running many websites off the same server, Apache may work better.<\/p>\n<p>One thing to note is that if you\u2019re making use of PHP, the setup for Nginx is a bit different. Apache natively runs PHP natively in the same process, communicating directly with the PHP engine. Nginx runs it in a separate process (<code>PHP-FPM<\/code>) and communicates with it like a reverse proxy. Both methods are just as fast, but your configuration will vary.<\/p>\n<p>Nginx and Apache both fully support any Unix system, including FreeBSD. While Nginx <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/nginx.org\/en\/docs\/windows.html\">technically has a version<\/a> that runs on Windows, it\u2019s not the best. Apache is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/httpd.apache.org\/docs\/2.4\/platform\/windows.html\">fully supported on Windows<\/a>, and as such is the go-to web server on that platform.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/1037\/apache-vs-nginx-which-web-server-is-the-better-choice\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#Which Web Server Is the Better Choice? \u2013 CloudSavvy IT&#8221; Nginx and Apache combined serve over 50% of the web. But Apache has seen a decline in recent years, in favor of Nginx. Is Nginx really better, and are there any benefits to using Apache? Nginx Is Newer and Faster Nginx is much more lightweight&#8230;<\/p>\n","protected":false},"author":1,"featured_media":337817,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/07\/19a6a908.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-337816","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/337816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=337816"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/337816\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/337817"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=337816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=337816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=337816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}