Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Nov 29, 2025, 01:14 AM

Title: Apache config file cannot be generated on a Plesk server: Wrong variable to
Post by: Suhitha on Nov 29, 2025, 01:14 AM
Question: Apache config file cannot be generated on a Plesk server: Wrong variable to subsitute


Applicable to:

[/b]

Symptoms


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.

# 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

1.Connect to the server using SSH.

2.Move the custom templates folder to another location:

# mv -f /usr/local/psa/admin/conf/templates/custom /root/custom_templates/

3.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.