• 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

Issue Error when renewing Let's Encrypt certificate on each domain

gareth94

New Pleskian
When I try to re-new a Let's Encrypt certificate on each of our domain, I receive the following error via e-mail. I wonder if anyone can help? Thank you

Code:
Unable to generate the web server configuration file on the host <xxxx.server-cp.com> because of the following errors:

Template_Exception: apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Syntax error on line 7 of /etc/apache2/conf-enabled/zz010_psa_httpd.conf: Could not open configuration file /etc/apache2/plesk.conf.d/vhosts/xxxxx.conf: No such file or directory

file: /opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php

line: 75
code: 0

Please resolve the errors in web server configuration templates and generate the file again.
 
Seems like a configuration doesn't exist. Did you make any kind of customed changes outside of plesk at one point? That would more likely be the only reason. If possible try to use Webserver Configurations Troubleshooter to check the configuration and repair any issues. You can also just reconfigure the domain by following this article:

 
There are some rare situations when a symbolic link to a web server configuration file for a deleted domain is not removed from the web server configuration directory. In that case, web server repair may not help. Instead, check whether the xxxxx domain mentioned in the error message excerpt "... /etc/apache2/plesk.conf.d/vhosts/xxxxx.conf ..." exists in Plesk. If it does not exist in Plesk, simply remove the symbolic link with rm /etc/apache2/plesk.conf.d/vhosts/xxxxx.conf, then reload the web server configuration with # service apache2 reload.
 
Seems like a configuration doesn't exist. Did you make any kind of customed changes outside of plesk at one point? That would more likely be the only reason. If possible try to use Webserver Configurations Troubleshooter to check the configuration and repair any issues. You can also just reconfigure the domain by following this article:

Thank you for your help. No changes have been made outside of Plesk. Where do I find the Webserver Configurations Troubleshooter?
 
Tools & Settings > Assistance & Troubleshooting > Webserver Configurations Troubleshooter

I suggest to first check whether the domain in question is listed under "Domains". If it is not listed there, please follow advice from Issue - Error when renewing Let's Encrypt certificate on each domain first.
Thanks for your help Peter. Yes, the domain is listed under 'Domains'. Unfortunately, I don't have a 'Webserver Configurations Troubleshooter' under settings. I'm running Plesk Plesk Onyx Version 17.8.11 Update #53.
 
There are some rare situations when a symbolic link to a web server configuration file for a deleted domain is not removed from the web server configuration directory. In that case, web server repair may not help. Instead, check whether the xxxxx domain mentioned in the error message excerpt "... /etc/apache2/plesk.conf.d/vhosts/xxxxx.conf ..." exists in Plesk. If it does not exist in Plesk, simply remove the symbolic link with rm /etc/apache2/plesk.conf.d/vhosts/xxxxx.conf, then reload the web server configuration with # service apache2 reload.
Hi again Peter. I've just checked the conf file is present in that directory.
 
If the symbolic link is present but the Apache syntax check cannot find the configuration file, the only possibility left is that the physical configuration file of the domain is missing. In that case it may help to reconfigure only that one domain with
# plesk repair web <your domain name>
What is the result of that repair attempt?
 
If the symbolic link is present but the Apache syntax check cannot find the configuration file, the only possibility left is that the physical configuration file of the domain is missing. In that case it may help to reconfigure only that one domain with
# plesk repair web <your domain name>
What is the result of that repair attempt?
Thanks Peter for your help. I've tried plesk repair on one of the domains but I get the following error result (below). I get the same result when running the repair on our other domains too :(

Code:
blue1080:~# plesk repair web dramacrash.cymru



Repairing web server configuration



  Repair web server configuration for domains dramacrash.cymru? [Y/n] Y

    Repairing web server configuration for the domain dramacrash.cymru[2023-01-22 13:25:40.011] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/httpdmng' '--reconfigure-domain' 'dramacrash.cymru'] with exit code [1]

Curl failed: Peer certificate cannot be authenticated with given CA certificates



................................................................... [FAILED]

    - httpdmng failed: [2023-01-22 13:25:39.639] ERR [util_exec]

      proc_close() failed ['/opt/psa/admin/bin/apache-config' '-t']

      with exit code [1]

      Curl failed: Peer certificate cannot be authenticated with

      given CA certificates

      [2023-01-22 13:25:39.826] ERR [util_exec] proc_close() failed

      ['/opt/psa/admin/bin/apache-config' '-t'] with exit code [1]

      Curl failed: Peer certificate cannot be authenticated with

      given CA certificates

      [2023-01-22 13:25:39.900] ERR [panel] Apache config

      (16743939390.41049700) generation failed: Template_Exception:

      apache2: Syntax error on line 216 of /etc/apache2/apache2.conf:

      Syntax error on line 7 of

      /etc/apache2/conf-enabled/zz010_psa_httpd.conf: Could not open

      configuration file

      /etc/apache2/plesk.conf.d/vhosts/atebol.cymru.conf: No such

      file or directory



      file:

      /opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php

      line: 75

      code: 0

      Curl failed: Peer certificate cannot be authenticated with

      given CA certificates

      apache2: Syntax error on line 216 of /etc/apache2/apache2.conf:

      Syntax error on line 7 of

      /etc/apache2/conf-enabled/zz010_psa_httpd.conf: Could not open

      configuration file

      /etc/apache2/plesk.conf.d/vhosts/atebol.cymru.conf: No such

      file or directory



Error messages: 0; Warnings: 0; Errors resolved: 0





exit status 1
 
Please check if your operating system is current. Maybe the root certificates should have been updated a while ago?
 
Please check if your operating system is current. Maybe the root certificates should have been updated a while ago?
There’s no option for us to update the OS unfortunately. We’re planning on moving to a different host due to this reason. Sorry, how do we update the root certificates?
 
There’s no option for us to update the OS unfortunately. We’re planning on moving to a different host due to this reason. Sorry, how do we update the root certificates?
Sorry, I’m not that familiar with SSL certificates (or how they work within Plesk)
 
Back
Top