Web Server Apache Nginx



NGINX is an incredibly fast web server. Apache is an incredibly powerful web server. Both have pros and cons, so sometimes it can be a challenge to decide which one to choose. Apache HTTP Server - The most popular web server on the Internet since April 1996. Microsoft IIS - A web server for Microsoft Windows. NGINX - A high performance free open source web server powering busiest sites on the Internet.

Nginx

Nginx and Apache both fully support any Unix system, including FreeBSD. While Nginx technically has a version that runs on Windows, it’s not the best. Apache is fully supported on Windows, and as such is the go-to web server on that platform. NGINX and Apache are two of the biggest open source web services worldwide, handling more than half of the internet’s total traffic. They’re both designed to handle different workloads and to complement various types of software, creating a comprehensive web stack. But which is best for you? This web server was specifically designed for delivering large amounts of static content (such as images, video, css, xml, and so on). As opposed to Apache, nginx is much more efficient when it comes to handling a large number of concurrent connections. Another advantage of this web server compared with Apache is that nginx has a significantly.

Plesk for Linux uses the Apache HTTP Server (http://httpd.apache.org/)for hosting websites. Apache itself does not operate with websites; itmanages virtual hosts, that is web resources identified either by an IPaddress or a host name. When you create a site, Plesk adds a new virtualhost to Apache so that the site becomes available through the webserver.

By default, to achieve better performance when delivering web content,Apache is supplemented with another web server - nginx. For detailsabout how Apache is integrated with nginx in Plesk and how to makeApache a standalone server, see Apache with nginx.

On the other hand, you can exclude Apache from the process of handlingrequests for web content of certain websites. You can do it by changingnginx mode. For details, see Adjusting Apache Web Server Settings.

Default Web Server Configuration

Web Server Apache Nginx

The Apache configuration for all virtual hosts in the system is definedvia the file /etc/httpd/conf/httpd.conf (on Red Hat EnterpriseLinux, CentOS, and CloudLinux) or /etc/apache2/apache2.conf (onDebian and Ubuntu). The configuration files for virtual hosts are on thelowest level of the configuration files hierarchy. They are includedinto the Apache configuration file (last_``httpd.conf``) throughseveral levels of inclusion using the include directive. The nginx webserver is configured similarly: the /etc/nginx/nginx.conf fileincludes the configuration files of all virtual hosts through severallevels of inclusion. You can learn about the hierarchy of Apache andnginx configuration files.

Each virtual host in the system has two files - last_httpd.conf andlast_nginx.conf - that define default Apache and nginx configurationfor this virtual host correspondingly. These files (located in/var/www/vhosts/system/<domain_name>/conf/) are generatedautomatically based on so-called configuration templates. Therefore, ifyou want to change the default web server configuration, you shouldadjust these template files. Learn how to do this in the ChangingVirtual Hosts Settings Using ConfigurationTemplatesin the Advanced Administration Guide.

Custom Web Server Configuration

Website owners may need custom web server capabilities that are notprovided by the default configuration. For example, unusual types ofindex files or the restricted access to the site by IP address. This canbe done by overriding the default configuration for specific customers.

The default web server configuration can be overridden on the followinglevels:

  • Service plan

    The configuration defined on the service plan level overrides thedefault configuration. You can set any Apache and nginx directivesfor a particular service plan. These settings are stored in Pleskdatabase and will be applied to all customers’ (plan subscribers’)websites by default. See Web Server (Apache).

  • Website (virtual host)

    The custom virtual host (website) configuration overrides theconfiguration defined in its service plan. When you set Apache andnginx directives for a particular website, your directives are savedin the vhost.conf, vhost_ssl.conf and vhost_nginx.conffiles (located in /var/www/vhosts/system/<domain_name>/conf/).

    You can configure web server settings for a website (virtual host) intwo ways:

    • By specifying your settings in the Customer Panel. When you saveyour changes, Plesk creates corresponding directives in thevirtual host configuration files. For details, see AdjustingApache Settings for Virtual Hosts and Adjustingnginx Settings for Virtual Hosts.

    • By editing configuration files manually. For details, refer to theAdvanced Administration Guide, Virtual Host ConfigurationFiles.

      Only the Linux user root can add or modify custom Apacheand nginx configuration files manually.

    Note that website settings work only for the selected website and areused instead of the default settings and the service plan levelsettings.

Apache Nginx Web Server

See the hierarchy of web server settings on the diagram below.