• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved New configuration files for the Apache web server were not created due to the errors in configuratio

KiamOe

Basic Pleskian
Hi I'm struggling to solve this problem related to configuration files. My system appear to run ok, websites are ok.. but this needs fixing so I can upgrade and modify the server. Tips are greatly appreciated:

(‪CentOS Linux 7.3 / Plesk Onyx 17.0.17)

My server generate error messages like this:

New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/vhosts/MY-DOMAIN.conf: SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-m4kTYW' does not exist or is empty .

And this by mail:

Unable to generate the web server configuration file on the host <spaniaonline.com> because of the following errors:

Template_Exception: AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/ip_default/WEBSPACE-DOMAIN.conf:
SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-jjHvIR' does not exist or is empty

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0


I'm unable to generate broken config files.. that only generate more similar error messages.
When I go into the Webserver Configurations Troubleshooter I see errors on many config files. Looking at the files there are messages like "This config file can not used, because error appears after including it in configuration."

The file /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php contained lot's of "garbage" like these characters "½ï¿½ï¿½ï¿½ã^U^ÃAc^\ÊÏ^M$-��anÆ^GËZ^SÏ" before and after php code. I removed it.. tried to regenerate files but no change.

That file only have this content, is that correct???

<?php
die("The file {$_SERVER['SCRIPT_FILENAME']} is part of Plesk distribution. It cannot be run outside of Plesk environment.\n");
__sw_loader_pragma__('PLESK_12_5');
?>



I have found this resource:
Apache configuration is corrupted: New files of configuration for Apache web server were not built due to errors in configuration templates

it looks similar but the solution provided here don't do much for me. I try to repair files with the following command:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain MY-WEBSPACE-DOMAIN.com

The error I get is this one:
The file /usr/local/psa/admin/sbin/httpdmng is part of Plesk distribution. It cannot be run outside of Plesk environment.

The SSL certificate file does not exist on the server for some reason. Certificates on this server generated and renewed using plesk and Let's encrypt.

Any tips are greatly appreciated.
 
Hi KiamOe,

contained lot's of "garbage" like these characters "½ï¿½ï¿½ï¿½ã^U^ÃAc^\ÊÏ^M$-��anÆ^GËZ^SÏ" before and after php code. I removed it.. tried to regenerate files but no change.
Absolutely WRONG decision, because what you call "garbage" is decrypted code ( to protect the content and to ensure that the code can't be stolen by others! ) from Plesk.

Pls. never ever touch decrypted code from Plesk files, because you are only destroying the functionality of Plesk. ;)
 
Hi, thanks for looking at this. I did a backup of the file so I've restored it.

Now if I do "/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain DOMAIN.com" I get this error:

[2017-05-04 14:42:04] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [ 1]
[2017-05-04 14:42:04] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [ 1]
[2017-05-04 14:42:04] ERR [panel] Apache config (14939017230.76941900) generation failed: Template_Exception: AH00526: Syn tax error on line 49 of /etc/httpd/conf/plesk.conf.d/vhosts/DOMAIN2.conf:
SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-m4kTYW' does not exist or is empty

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/vhosts/ads.spania.no.conf:
SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-m4kTYW' does not exist or is empty


The SSL Certificate file does not exist on the server. There are other certificate files there in that folder.. all belong to root user.

K
 
Thanks again, great input, appreciate it greatly. I did run the commands. I still see error messages in plesk and the error refer to a certificate that don't exist on the server. I've used "let's encrypt" to renew the certificate it complain about and no change. I'm also unable to "generate the broken configuration files" using plesk.

"New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/vhosts/DOMAIN.conf: SSLCertificateFile: file "

Could it be that these error are old error messages?

When I go into the configuration troubleshooter I see a list of files system report have syntax error. For example many _webmail.conf files. Trying to rebuild one of them I get:

Error: Can not reconfigure web server configurations: Unable to execute httpdmng: [2017-05-04 16:09:56] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-05-04 16:09:56] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
[2017-05-04 16:09:56] ERR [panel] Apache config (14939069950.88154600) generation failed: Template_Exception: AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/ip_default/WEBSPACE-DOMAIN.com.conf:
SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-jjHvIR' does not exist or is empty

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/ip_default/spaniaonline.com.conf:
SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-jjHvIR' does not exist or is empty


--------------

Error: New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00526: Syntax error on line 49 of /etc/httpd/conf/plesk.conf.d/vhosts/ANOTHER-DOMAIN.conf: SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-m4kTYW' does not exist or is empty. Search in KB
 
Hi KiamOe,

pls. consider to manually delete configuration files, if you don't want to use the Plesk extensions "Webserver configurations troubleshooter" to REBUILD configuration files with issues/errors/problems or misconfigurations.

An example command would be:
Code:
rm /etc/httpd/conf/plesk.conf.d/vhosts/ANOTHER-DOMAIN.conf
Afterwards, you could use the command
Code:
plesk repair web ANOTHER-DOMAIN -y -v


Pls. consider to READ the official Plesk documentation for MORE repair options and corresponding commands:

 
but when I create new domains or subscriptions I have this error, the created domain is not associated with any hosting, but I have some solutions to recreate damaged but unsuccessful files. Associating a hosting from the domain panel I get the same result. Comer do? I tried with other domains and I get the same mistake. Thank you

ERROR:
The new configuration files for the Apache web server were not created due to errors in the configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: No data. file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Variable_Exception: No data. file: /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php line: 67 code: 0. Detailed error descriptions were sent to you by email. Fix the errors and click here to generate the corrupted configuration files again or suqi to generate all the configuration files. See details in the configuration error resolution tools
 
Hi Piero Meloni,

pls. make sure that you have the latest Plesk updates/upgrades/patches installed, as your error message:
The new configuration files for the Apache web server were not created due to errors in the configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: No data
... indicates, that you might have old/obsolete configuration templates.

As this thread is already solved, pls. consider to open a NEW thread, where you should consider as well to include more informations about your current used Plesk version ( incl. #MU ), YOUR current used operating system and more corresponding log - entries, if you desire help with your investigations from people willing to you, to solve your issues/errors/problems. :)
 
Back
Top