Symptoms
-
Apache configuration generation fails with the following or similar error:
New configuration files for the Apache web server were not created due to the errors in configuration templates:
Template processing failed: file = /opt/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: [Template_Variable_Domain_PhysicalHosting] Wrong variable to subsitute: maintenanceMode file: /opt/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Exception: [Template_Variable_Domain_PhysicalHosting] Wrong variable to subsitute: maintenanceMode file: /opt/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Exception: [Template_Variable_Domain_PhysicalHosting] Wrong variable to subsitute: maintenanceMode file: /opt/psa/admin/plib/Template/Variable/Abstract.php line: 67 code: 0. -
Custom Apache virtual host templates are used:
# ls -l /usr/local/psa/admin/conf/templates/custom/domain/
-rw-r--r-- 1 root root 987 Jul 22 16:13 domainVhost.php
Cause
Custom Apache virtual host templates contain a syntax error or reference to a nonexistent variable.
Resolution
-
Connect to the server using SSH.
-
Move the custom templates folder to another location:
# mv -f /usr/local/psa/admin/conf/templates/custom /root/custom_templates/
-
Rebuild web server configuration files:
For RHEL-based Linux distributions (CentOS, RedHat, CloudLinux):
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
For Debian-based Linux distributions (Ubuntu, Debian):
# /opt/psa/admin/sbin/httpdmng --reconfigure-all
Note: Check Plesk Advanced Administration Guide to see the full list of allowed variables for custom virtual host templates.