Did you ever get the below error while accessing 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.
There are mainly three possibilities for this error.
1) Mailman package is not installed.
2) aps database related error
3) PHP memory issue
You can follow the below steps to fix this issue.
Mailman package is not installed.
When you try to reconfigure the domain, you will get the following error.
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all No valid mailman bindir detected
So, in this case, it is clear that the issue is causing because the mailman package is missing.
To fix the issue, you can follow the steps mentioned below.
a) Download and install the mailman package from http://autoinstall.plesk.com
b) After that remove all entries from the ‘Configurations’ table of the ‘psa’ database.
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from Configurations"
c) Remove all ‘Include’ records from configuration files and all content from the directory below:
# sed -i /Include/d /usr/local/psa/admin/conf/ip_vhosts_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/vhosts_bootstrap.conf&& sed -i /include/d /usr/local/psa/admin/conf/nginx_vhosts_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/webmail_horde_bootstrap.conf&& sed -i /Include/d /usr/local/psa/admin/conf/webmail_atmail_bootstrap.conf&& sed -i /Include/d /etc/httpd/conf.d/zz010_psa_httpd.conf&& rm -f /usr/local/psa/admin/conf/generated/*
d) Now you can reconfigure and that will fix the issues.
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
aps database related error
To make sure it a DB-related error, please follow the below steps.
Run the below command to check what is exactly causing the error.
mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -Nse"select * from Configurations where status='error' G" id: name: domainVhost file: version: objectType: domain objectId: status: error description: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
You can follow the below steps to fix it.
a) Login to MySQL and connect to the psa database.
[root@~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql> connect psa
b) Now run the below query to find the objectIDs with an Error status.
mysql> select objectId from Configurations where status='error'; +----------+ | objectId | +----------+ | 8 | +----------+ 1 row in set (0.00 sec)
c) We got the “objectId”. Let’s find out the domain that is having this ID.
mysql> select id,name,parentDomainId from domains where id=8; +----+------------------+----------------+ | id | name | parentDomainId | +----+------------------+----------------+ | 8 | hostingtrainer.com | 0 | +----+------------------+----------------+ 1 row in set (0.00 sec)
d) Get the subscription ID for the specified domain:
mysql> select id, object_id from Subscriptions where object_id=8 +----+-----------+ | id | object_id | +----+-----------+ | 5 | 8 | +----+-----------+ 1 row in set (0.00 sec)
e) Check whether this subscription has entries in the apsContext table.
mysql> SELECT `apsContexts`.* FROM `apsContexts` AS `apsContexts` WHERE (`pleskType` = 'hosting' AND `pleskId` =8 ); +----+-----------+---------+-------+----------------+ | id | pleskType | pleskId | ssl | subscriptionId | +----+-----------+---------+-------+----------------+ | 5 | hosting | 8 | false | 0 | +----+-----------+---------+-------+----------------+ 1 row in set (0.00 sec)
f) As you can see, the subscription ID is different from the Plesk ID. It is showing “0”. Correct the subscription ID.
mysql> update apsContexts set subscriptionId=5 where pleskId=8; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
g) Now, you can reconfigure, and that will fix the issues.
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
PHP memory issue.
When you check the “/var/log/sw-cp-server/error_log”, you will get the following error.
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes)
It is because Plesk is unable to process or function with the current PHP memory limit. Please set the PHP “memory_limit” parameter in “/usr/local/psa/admin/conf/php.ini” to a higher value.
If these steps didn’t fix the issues, you may please use the Plesk “Webserver Configuration Troubleshooter” plugin. You may also use the Plesk “fix_vhosts” script.