Reconfiguration fails with <VirtualHost> cannot occur within <VirtualHost> section error

Created:

2016-11-16 12:44:43 UTC

Modified:

2017-08-16 15:46:21 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Reconfiguration fails with <VirtualHost> cannot occur within <VirtualHost> section error

Applicable to:

  • Plesk 10.x for Linux
  • Plesk 11.x for Linux

Symptoms

The following error message is displayed in Plesk:

Error: New files of configuration for Apache web server were not built due to errors in configuration templates. The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating configuration.

Server reconfiguration fails:

# /usr/local/psa/admin/bin/httpdmng --reconfigure-all
Syntax error on line 2 of /var/www/vhosts/domain.tld/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section

Cause

<VirtualHost> directive is presented in specified vhost.conf which is not allowed.

Resolution

Delete <VirtualHost> and </VirtualHost> tags from /var/www/vhosts/domain.tld/conf/vhost.conf file. Then, reconfigure the domain:

# /usr/local/psa/admin/bin/httpdmng --reconfigure-domain domain.tld

If it still does not help, delete /var/www/vhosts/domain.tld/conf/vhost.conf file and reconfigure the domain.

Have more questions? Submit a request
Please sign in to leave a comment.