You can change the settings of virtual hosts running on the Panel server, for example, set custom error pages (similar for all virtual hosts), or change the port on which the hosted site is available.
These settings are stored in a set of Apache and virtual hosts configuration files. To reduce the risk of errors during modification of Apache configuration files, Parallels Plesk Panel provides a mechanism for changing the Apache and virtual host configuration - Apache configuration templates. These templates are files, based on which Panel re-generates certain Apache configuration files. Other Apache configuration files are generated automatically and cannot be changed. The hierarchy of the Apache configuration files generated from Panel automatically and from templates is shown in the Appendix A: Apache Configuration Files.
Apache configuration files support versioning. This allows you to roll back to a previous configuration if the new one contains errors.
The default templates are located in
/admin/conf/templates/default/, where the
/usr/local/psa for RPM-based systems or
/opt/psa on DEB based systems.
To introduce your customizations to the configuration, copy the templates you need to the
/admin/conf/templates/custom/ directory and modify them, preserving the directory structure, and then modify these copies. You can create new templates from scratch and place them in the
custom/ directory according to the default structure.
Important: Do not change the default templates. All template customizations must be performed in the
/admin/conf/templates/custom/ directory, and the default templates structure and content must be kept unchanged, since there are no specific tools to undo the changes.
To remove customizations and restore the default configuration, just delete the custom template files.
To change virtual hosts configuration using Apache configuration templates:
custom/preserving the directory structure. You can find the complete list of templates and their descriptions in the Appendix B: Apache Templates Structure.
# php -l <file-name>
# httpdmng <command>
Where <command> is one of the following:
--reconfigure-servergenerates sever-wide configuration files.
generates files for a specified domain.
--reconfigure-allgenerates all configuration files.
Note: Panel generates configuration files automatically upon a variety of events. For example, if a website's hosting settings are changed - say PHP is enabled - configuration for this website is generated anew.
Example: modifying error pages:
# mkdir -p /usr/local/psa/admin/conf/templates/custom/domain/service/
# cp /usr/local/psa/admin/conf/templates/default/domain/service/errordocs.php /usr/local/psa/admin/conf/templates/custom/domain/service/errordocs.php
Please send us your feedback on this help page.