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 $PRODUCT_ROOT/admin/conf/templates/default/, where the $PRODUCT_ROOT_D is /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 $PRODUCT_ROOT/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 $PRODUCT_ROOT/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:
$PRODUCT_ROOT/admin/conf/templates/custom/ folder.default/ to 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-server generates sever-wide configuration files.--reconfigure-domain <domain-name> generates files for a specified domain.--reconfigure-all generates 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:
custom/ directory:# 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
/usr/local/psa/admin/conf/templates/custom/domain/service/errordocs.php file.