Nginx is reaching unexpected results and improves from version to version. That is why we should consider its adoption over typical Apache. Previously we discussed the theoretical part on Apache HTTP Server Basics, nginx HTTP Server Basics and practical guides like Installing nginx on Rackspace Cloud Server with Centmin Mod Nginx Auto Installer, Reverse Proxying with Nginx, Installing nginx on Rackspace Cloud Server (Video), Shifting WordPress From Apache to nginx Web Server – to cite few.
With CMS like WordPress, for optimum performance; we need to use Cache Plugins even on PVHVM Cloud Servers. Reducing Cache to Reduce Operational Cost on Cloud Server. Nginx itself can turn dynamic content in static content plus we can add Varnish Cache HTTP Accelerator as fronted server. In this article, we will discuss the Reasons to Switch to Nginx From Apache on Cloud Server fully logically.
Cloud platforms such as Rackspace Cloud, Amazon AWS are reasons for its success and would be found in the incredible leaps forward made ??since its inception in 2004. Various updates, as well as the new release took place less than a month ago, they deliver a web server to the hands of IT administrators with a breeze and equipped with the latest technologies such as IPv6 and SPDY. In the face of this success and growth of this ability, it becomes important to analyze the reasons why it would be interesting to move from Apache to nginx webserver.
---
Reasons Can Vary to Switch to Nginx From Apache on Cloud Server But Ngnix is Easy to Install and Configure
When the web server were was not present in the distributions, it was necessary to compile from the sources, but the actual installation of Nginx is very simple and can be done from any bash with a single command line. Specifically deb distributions like Ubuntu and Debian :
1 | apt-get install nginx |
While for CentOS, Red Hat Enterprise Linux and Fedora data we will run :
1 | yum install nginx |
Similarly, the configuration file is also available to any Linux system administrator who has sufficient familiarity with this type of procedure. In CentOS the file is located at /etc/nginx/nginx.conf
which is the main configuration file of your web server and it is here that we can include our virtual host in this way:
1 | include œetc/nginx/conf.d/*.conf; |
as long as you create the file, then the corrispodentig virtual hosts that want to configure should exist like this:
1 2 | /etc/nginx/conf.d/firs-site.com.conf /etc/nginx/conf.d/second-site.com.conf |
The rest of the configuration file is just to fine tune, unless you want to specify some custom proxy directive at the end of http section, leave them as it is :
1 2 3 4 5 | http { ...default config skipped . . . # args } |
The other file of interest is -> /etc/nginx/sites-available/default
where there is a configuration similar to that of Apache. The information in the file will remind that Nginx can also act as a proxy, for which it receives all incoming requests and dispatches to other systems like Apache. If Nginx and Apache coexist,it is necessary that you put the web server listening on port 8080 and not on 80 and this change can be changed directly from the file /etc/apache/ports.conf
Fast Serving of Static Files Can Be a Reason to Switch to Nginx From Apache on Cloud Server
Most of the CDN use Nginx and it is no coincidence. Nginx provides the best performance when serving the static files such as ZIP, images of any format, PDF documents, static files in HTML format and many more. In addition, Nginx also allows you to configure a cache for all or part of these files, so getting an extra boost of speed in serving concurrent requests:
1 2 3 | location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { expires 365d; } |
Nginx Can Turn Dynamic Content in Static Content
Nginx can be configured to store dynamic content in the cache for which acts as a proxy, using the HttpProxyModule, allowing us to store cached content in an efficient manner without affecting application.
Nginx is Able to Handle Four Times the Number of Concurrent Connections Than Apache
Nginx not only a lighter web server lighter and less memory hungry among those available, but preserves the excellent response times even in the presence of a high number of concurrent connections, with a low resource usage. Nginx is in fact capable of handling a number equal to four times the amount of concurrent connections handled by Apache. This is important to reduce the charge of loadbalancers.
Secondly “Number of Concurrent Connections” never means “Number of Visitors”, actually it is important.
Nginx is Compatible with All the Most Popular Web Apps
Nginx works correctly for WordPress, Drupal, Joomla or any other CMS or web app, even in the presence of another platform like Python or Ruby.
Tagged With paperuri:(f77e689a293f180ad142681fcaed6735)