Virtual Host Configuration Files

Configuration settings of each virtual host are stored in its configuration files in the /var/www/vhosts/system/<domain_name>/conf/ directory. Particularly, these files are the following:

The final Apache configuration will include all httpd.conf and nginx.conf files from all virtual hosts.

Plesk lets administrators and domain owners see the history of changes in a virtual host configuration files by saving each version of these files. <version> here is a unique number assigned to a certain configuration state that is used now or was used previously. To let administrators and domain owners easily access the currently used configuration file, Plesk stores the links last_httpd.conf and last_nginx.conf that point to the corresponding files.

The system re-generates the configuration files after each change of virtual host configuration, for example, changing the hosting type of a domain. Therefore, if you edit httpd.conf and nginx.conf files manually, your changes will be lost after changing the virtual host settings in the Plesk UI. To avoid this, additional files are used to specify custom configuration for domains:

The files with custom per-domain configuration are stored in the /var/www/vhosts/system/<domain_name>/conf/ directory.

Most of the settings specified in these files override the server-wide configuration of a virtual host (httpd.conf and nginx.conf). For example, if you include directives that already exist in the site's current httpd.conf file, the system will use your values from the vhost.conf and vhost_ssl.conf files.

Editing Virtual Host Configuration Files

There are two ways to edit virtual host configuration files:

  1. Manually. You can add custom directives to the following files from /var/www/vhosts/system/<domain_name>/conf/ directory:
  2. In the Plesk GUI. On the Websites & Domains > select a website > Web Server Settings tab you can specify:

The changes you made in the web server configuration will be applied automatically.

Note: If you have upgraded from the older Plesk version and are configuring the vhost.conf and vhost_ssl.conf files for the first time after the upgrade, you will need to use the httpdmng utility to apply the changes from your configuration files. For example, to generate web server configuration files for a website, run the command: /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain_name>