Apache config file cannot be generated: "Wrong variable to subsitute"

Created:

2016-11-16 13:11:39 UTC

Modified:

2017-04-25 06:32:57 UTC

5

Was this article helpful?


Have more questions?

Submit a request

Apache config file cannot be generated: "Wrong variable to subsitute"

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

  1. Apache configuration generation fails with the following or similar error:

    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.
  2. Custom Apache virtual host templates are used:

    # ls -l /usr/local/psa/admin/conf/templates/custom/domain/
    total 80
    -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

  1. Check Parallels Plesk Panel Advanced Administration Guide to see the full list of allowed variables for custom virtual host templates.

  2. Verify that all variables in the custom templates are used according to the documentation and there are no syntax errors.

  3. Recreate all Apache configuration files:
    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

As a workaround solution, move the custom templates folder to another location and recreate all Apache configuration files:

# mv -f /usr/local/psa/admin/conf/templates/custom /root/custom_templates/
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Have more questions? Submit a request
Please sign in to leave a comment.