Apache and nginx Web Servers (Linux)
Plesk for Linux uses the Apache HTTP Server (http://httpd.apache.org/) for hosting websites. Apache itself does not operate with websites; it manages virtual hosts, that is web resources identified either by an IP address or a host name. When you create a site, Plesk adds a new virtual host to Apache so that the site becomes available through the web server.
By default, to achieve better performance when delivering web content, Apache is supplemented with another web server - nginx. For details about how Apache is integrated with nginx in Plesk and how to make Apache a standalone server, see Apache with nginx.
On the other hand, you can exclude Apache from the process of handling requests for web content of certain websites. You can do it by changing nginx mode. For details, see Adjusting Apache Web Server Settings.
Default Web Server Configuration
The Apache configuration for all virtual hosts in the system is defined
via the file /etc/httpd/conf/httpd.conf
(on Red Hat Enterprise
Linux, CentOS, and CloudLinux) or /etc/apache2/apache2.conf
(on
Debian and Ubuntu). The configuration files for virtual hosts are on the
lowest level of the configuration files hierarchy. They are included
into the Apache configuration file (last_``httpd.conf``) through
several levels of inclusion using the include directive. The nginx web
server is configured similarly: the /etc/nginx/nginx.conf
file
includes the configuration files of all virtual hosts through several
levels of inclusion. You can learn about the hierarchy of Apache and
nginx configuration files.
Each virtual host in the system has two files - last_httpd.conf
and
last_nginx.conf
- that define default Apache and nginx configuration
for this virtual host correspondingly. These files (located in
/var/www/vhosts/system/<domain_name>/conf/
) are generated
automatically based on so-called configuration templates. Therefore, if
you want to change the default web server configuration, you should
adjust these template files. Learn how to do this in the Changing
Virtual Hosts Settings Using Configuration
Templates
in the Advanced Administration Guide.
Custom Web Server Configuration
Website owners may need custom web server capabilities that are not provided by the default configuration. For example, unusual types of index files or the restricted access to the site by IP address. This can be done by overriding the default configuration for specific customers.
The default web server configuration can be overridden on the following levels:
-
Service plan
The configuration defined on the service plan level overrides the default configuration. You can set any Apache and nginx directives for a particular service plan. These settings are stored in Plesk database 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 the configuration defined in its service plan. When you set Apache and nginx directives for a particular website, your directives are saved in the
vhost.conf
,vhost_ssl.conf
andvhost_nginx.conf
files (located in/var/www/vhosts/system/<domain_name>/conf/
).You can configure web server settings for a website (virtual host) in two ways:
-
By specifying your settings in the Customer Panel. When you save your changes, Plesk creates corresponding directives in the virtual host configuration files. For details, see Adjusting Apache Settings for Virtual Hosts and Adjusting nginx Settings for Virtual Hosts.
-
By editing configuration files manually. For details, refer to the Advanced Administration Guide, Virtual Host Configuration Files.
Note: Only the Linux user
root
can add or modify custom Apache and nginx configuration files manually.
Note that website settings work only for the selected website and are used instead of the default settings and the service plan level settings.
-
See the hierarchy of web server settings on the diagram below.