Plesk

Changing Virtual Hosts Settings Using Configuration Templates

You can change the settings of virtual hosts running on the Plesk
server, for example, set custom error pages (similar for all virtual
hosts), or change the port on which the hosted site is available.

To reduce the risk of errors during modification of configuration files,
Plesk provides a mechanism for changing virtual host configuration
-configuration templates. Before 11.0, Plesk had templates only for
Apache configuration files, but with adding support for nginx
administrators can modify nginx templates as well. Read more about the
how Apache and nginx work together in the Administrator’s Guide,
section Improving Web Server Performance with nginx
(Linux)
.

Configuration templates are files based on which Plesk re-generates
certain web server configuration files. Other configuration files are
generated automatically and cannot be changed. The hierarchy of
configuration files generated by Plesk automatically and from templates
is shown in the Appendix A.

Web server configuration files support versioning. This allows you to
roll back to a previous configuration if the new one contains errors.
Plesk adds a file version number to the name of each configuration file.
For example, virtual host configuration files located in the
/var/www/vhosts/ <vhost_name> directories have the names like
<version> _httpd.include. To quickly access the currently used
configuration file of a virtual host, use the symbolic link
last_httpd.include located in the same directory.

The default templates are located in
/usr/local/psa/admin/conf/templates/default/.

Note: Do not change the default templates. To introduce your changes to the
configuration, copy the templates you need to the
/usr/local/psa/admin/conf/templates/custom/ directory and modify
them, preserving the directory structure, and then modify these
copies. You can create templates from scratch and place them in the
custom/ directory according to the default structure.

To remove your changes and restore the default configuration, just
delete the custom template files.

To change virtual hosts configuration using configuration templates:

  1. Create the /usr/local/psa/admin/conf/templates/custom/ folder (if
    there is no such folder yet).

  2. Copy and paste the required templates from <span class="…

Exit mobile version