Apache configuration is corrupted: New files of configuration for Apache web server were not built due to errors in configuration templates
Applicable to:
- Plesk 12.5 for Linux
- Plesk 10.4 for Linux
- Plesk Onyx for Linux
- Plesk 11.0 for Linux
- Plesk 11.5 for Linux
- Plesk 12.0 for Linux
- Plesk 10.3 for Linux
- Plesk 10.x and below for Linux
Symptoms
The following error is shown for a subscription:
Error: New configuration files for the Apache web server were not created due to the errors in configuration templates: Destination directory '/etc/nginx/plesk.conf.d/vhosts' not exist.
The following error may be shown on Plesk homepage:
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
There are a lot of entries in “error” status in Configurations table in psa database:
mysql> select id,objectId,status,description from Configurations where status="error";
+------+----------+--------+-------------------------------------------------------------------+
| id | objectId | status | description |
+------+----------+--------+-------------------------------------------------------------------+
| 9 | 1 | error | Destination directory '/etc/nginx/plesk.conf.d/vhosts' not exist |
| 13 | 2 | error | Destination directory '/etc/nginx/plesk.conf.d/vhosts' not exist |
| 17 | 3 | error | Destination directory '/etc/nginx/plesk.conf.d/vhosts' not exist |
| 25 | 5 | error | Destination directory '/etc/nginx/plesk.conf.d/vhosts' not exist |
Rebuilding of web server configuration files fails with an error:
# /usr/local/psa/admin/bin/httpdmng --reconfigure-all
2016-09-23T13:51:14-07:00 ERR (3): Apache config (14746638730.91104700) generation failed:
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-server
[1] => -no-restart
)
Details: Empty error message from utility.
Cause
Domains’ configuration is broken
Solution
Log in to Plesk database and check which domains’ configuration is corrupted:
mysql> select id,objectId,status,description from Configurations where status="error";
Depending on the quantity of domains in the output apply one of the following two solutions.
I. Solution to fix a few domains
Reconfigure domains one by one:
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain example.com
II. Solution to fix all domains in bulk
- Remove all entries from the
psa.Configurations:# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"delete from Configurations" - Reconfigure Apache using the
httpdmngutility:~# /usr/local/psa/admin/bin/httpdmng --reconfigure-all