Instead of editing Apache configuration files, the suggested way is to introduce changes to the templates of configuration, based on which the Panel generates its configuration files.
A set of templates from which the Panel default configurations for Web server are created - default templates - is located at $PRODUCT_ROOT/admin/conf/templates/default/.
Important: 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.
Custom templates override the default ones during the configuration files generation.
To introduce your customizations to Web server configuration, you should copy the templates you need to modify to the custom/ directory preserving the directories structure, and then modify these copies. You can write a completely new templates from scratch as well, what's important is that they are placed in the custom/ directory according to the default structure. For detailed information on the template files and directories structure, refer to the Template Files section.
Note: Configuration files for all domains are generated from the configuration templates. It is important to understand that changing a configuration templates is not the way to customize configuration file for a single domain because all domains will be affected.
For example, to modify configuration template for website error pages, which affects error pages configuration for all websites, do the following:
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.To remove customizations and have the default configuration generated, it is enough to just delete files of custom templates.
To manually generate Web server configuration, call the $PRODUCT_ROOT/admin/bin/httpdmng utility with one of the following arguments:
--reconfigure-serverGenerates server-wide configuration files:
/usr/local/psa/admin/conf/generated/<version>_server.include/usr/local/psa/admin/conf/generated/<version>_horde.include/usr/local/psa/admin/conf/generated/<version>_atmail.include/usr/local/psa/admin/conf/generated/<version>_atmailcom.include--reconfigure-domain <domain-name> Generates files for the website with specified domain name:
/var/www/vhosts/<domain-name>/conf/<version>_httpd.include/usr/local/psa/admin/conf/generated/<version>_<domain_name>_webmail.include--reconfigure-allGenerates all configuration files.
Aside from manually running the utility, configuration files are generated by the Panel automatically upon a variety of events. For example, in case a website hosting settings are changed, say, PHP got enabled, configuration for this website is generated anew.
To sum it up, changing web server configuration implies the following:
$PRODUCT_ROOT/admin/conf/templates/custom/ folder.default/ to custom/ preserving the directory structure.# php -l <file-name>
# httpdmng <command>