Error: New files of configuration for Apache web server in Plesk

We usually receive an error while accessing the home page of the Plesk control panel. The error might be due to the mailman package is not installed, PHP memory issue, aps database-related error. 

We handle Plesk errors for our clients by using our Plesk management plan. Our technical team expert will handle and fix the error on behalf of you which is caused due to some following reason. You can check out our Plesk management plan for further assistance.

While accessing the Plesk you will be receiving the below popup message. 

Error: New files of configuration for the 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 mail, fix the error, and click here to retry generating configuration.

Follow the below steps to fix the issue.

  1. Mailman package is not installed

While reconfiguring the domain, you will be experiencing the following error.

# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

No valid mailman bindir detected

 In this case, the error is due to the mailman package missing.

Follow the below steps to fix this issue.

First of all, you need to download and install the mailman package from http://autoinstall.plesk.com

After that remove all entries from the configuration table of the ‘psa’ database and follow the commands below.

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"delete from Configurations"

Then remove all ‘Include’ records from the configuration files and all the contents 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/*

Finally, you can reconfigure and try to fix the issues. 

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Aps database-related error.

Ensure its DB-related error and follow the below steps.  Run the following commands to check the reason behind the error.

mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -Nse"select * from Configurations where status='error' G"

Follow the below steps to fix the error.
First, login into MYSQL and connect to the psa database by using the following commands.

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
mysql> connect psa

Then 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)
From the above result you will get the objectId that will find out the domain by using the ID. 
mysql> select id,name,parentDomainId from domains where id=8;
+----+------------------+----------------+
| id | name | parentDomainId |
+----+------------------+----------------+
| 8 | test.com | 0 |
+----+------------------+----------------+
1 row in set (0.00 sec)

We will 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)

Later check the subscription has entries in the APS context 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)

 As you can see the subscription ID to be different from the Plesk 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

Finally, you can reconfigure and then fix the issues.

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

PHP Memory issue

 You can check the PHP memory issue in the ‘/var/log/sw-cp-server/error_log’

 
PHP Fatal error: allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes)

The error is due to the Plesk PHP memory limit.

Follow the steps to solve the issue.

Try to set the Php memory _limit” parameter in”/usr/local/psa/admin/conf/php.ini” into a high value than the current one.

Try to remove the old error messages (non-existent configuration files) via the Plesk interface or through the SSH connection.

Follow the steps to remove the old error via the Plesk interface:

  • For that, you need to login into the Plesk account.
  • Click on the tools and settings then select the webserver configurations trouble-shooter.
  • Click the ‘v’ button and select the status search filter to error from the drop-down menu.
  • You can choose any of the following to fix the errors.
  • Click on the Rebuild button and select all the broken configuration files.
  • If the configuration files get the same error then choose all the files and try to remove them by clicking on the remove button.
  • Check and ensure no broken configuration files are leftover.

Follow the steps to remove the old messages via SSH connection.

Connect to the Plesk server via SSH.

Use the following commands to remove the broken configuration files from the Plesk database.

plesk db "delete from Configurations where status <> 'ok'\G"	

Validate configuration files by using the following commands.

plesk repair web -validate-configuration

In case, any further errors are found that would be solved by following the commands.

plesk repair web -y

Use the Plesk ‘fix_vhosts’ script to find out all the missing virtual host directories and then create the basic virtual host structure.

# wget http://kb.parallels.com/Attachments/24430/Attachments/fix_vhosts.sh.zip
# unzip fix_vhosts.sh.zip
# chmod +x fix_vhosts.sh
# ./fix_vhosts.sh


This blog will give clear instructions to fix the Plesk error and configure new files. If you are stuck with the setup, our technical support team will solve it for you.

FREE SERVER AUDITING

Get Auditing Report of Your Server for FREE!!

Fix this issue for

$25/Hour

$6.25/Hour

Applicable only to the first hour.