New files of configuration for Apache error in Plesk - How to fix it ?





Are your trying to resolve the error "New Files of Configuration for Apache"?

This guide is for you.

This plesk error occurs while accessing the home page in their Plesk control panel.
The factors that can trigger this error includes PHP memory issue or any database error or even when the mailman package not installed.
Also is can be due to the records in the Plesk database containing information about non-existent configuration files or old error messages.
When it occurs, you will see an error message such as :
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.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix Plesk related errors.
In this context, we shall look into fix this Plesk error.

Different Methods to fix Error: New files of configuration for Apache ?

Here, you will learn how to fix this Plesk error which is caused due to some of the following causes.

a. Mailman package is not installed

At times while reconfiguring the domain, we will get the following error.

# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
No valid mailman bindir detected

From the error, we understand it is due to a missing mailman package.

Following are the steps to fix this issue:
1. First we will download and install the mailman package from http://autoinstall.plesk.com
2. Then we will remove all entries from the ‘Configurations’ table of the ‘psa’ database with the following command:

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

3. After that we will remove all ‘Include’ records from configuration files and other 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/*

4. Finally with the following command we will reconfigure and fix this issue.

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


b. Database related error

We can check to confirm if it is a DB related error using the following command:

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

If we see any error similar to the below one we can conclude that there is a database error.
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

Following are the steps to fix this:
1. First, we will log in to MySQL and connect to the psa database with the following command:

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

2. Now we will 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)

3. We will get the ‘objectId’ from the above results with which we will find out the domain which is using 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)

4. After this we will find the subscription ID for the specified domain using the following command:

mysql> select id, object_id from Subscriptions where object_id=8
+----+-----------+
| id | object_id |
+----+-----------+
| 5 | 8 |
+----+-----------+
1 row in set (0.00 sec)

5. Next we will check whether this subscription has any 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)

6. If we find the subscription ID to be different from the Plesk ID we can correct it.

mysql> update apsContexts set subscriptionId=5 where pleskId=8;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

7. Finally with the following command we will reconfigure and fix this issue.

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

c. PHP memory issue

We 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)
This error usually It is because Plesk is unable to process or function with the current PHP memory limit.

Following are the steps to fix this issue:
To fix this, we can set the PHP 'memory_limit' parameter in ‘/usr/local/psa/admin/conf/php.ini’ to a higher value than the current value.

d. The Plesk database contains records about non-existent configuration files or old error messages.

We can either remove old information via the Plesk interface or via an SSH connection.

Steps to follow for removing the old information via Plesk interface:
1. First Log in to Plesk.
2. Go to Tools & Settings and take Webserver Configurations Troubleshooter.
3. Click the “v” button on the right side and set the Status search filter to Error from the drop-down menu.

We can do any of the following to fix the errors:
a) Select all the broken configuration files and click Rebuild.
b) If configuration files do not get repaired, we can select them all and click Remove.
c) After this we will click Check configuration to ensure that there are no broken configuration files left.

Steps to follow for removing the old information via SSH connection:
1. First, connect to the Plesk server via SSH.
2. For removing broken configuration entries from the Plesk database we will use the following command:

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

3. After that we will validate configuration files using the following command:

plesk repair web -validate-configuration

4. In case if any errors are found, we will fix them with the following command:

plesk repair web -y

Alternatively, we can use the Plesk ‘fix_vhosts’ script given below:

# 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

The script will find all missing virtual host directories and re-create the basic virtual host structure for them. If any sub-directories "conf" or "statistics/logs" are missing, it will be recreated as well with proper permissions/ownership.

[Need urgent assistance in fixing Plesk related errors? – We can help you. ]


Conclusion

This article will guide you on methods to fix the Plesk error : new files of configuration for Apache.
The causes of this Plesk error:
1. Mailman package is not installed.
2. Database related error.
3. PHP memory issue.
To fix this Plesk 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
This will resolve the error.


Related Post


Keep In Touch

We hope to hear from you.

Accept File Type: jpg,jpeg,png,txt,pdf,doc,docx