My domain is: https://www.shitouttaluck.co.uk/
I ran this command: certbot --apache
It produced this output:
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
Unable to restart apache using ['apache2ctl', 'graceful']
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
Unable to restart apache using ['apache2ctl', 'graceful']
Encountered exception during recovery: certbot.errors.MisconfigurationError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.
My web server is (include version): Server version: Apache/2.4.41 (Ubuntu)
The operating system my web server runs on is (include version): Ubuntu 20.04.5 LTS
My hosting provider, if applicable, is: Fasthosts
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 1.32.2
Problem
I am trying to generate a new certificate for the above site but I run into the errors shown above.
If I take a look at my virtual servers error logs I see the following
Apache Error log for Virtual Server - tail -30 /var/log/apache2/shitouttaluck.error.log
[Thu Dec 22 23:18:38.285171 2022] [ssl:info] [pid 1378473] AH01914: Configuring server www.shitouttaluck.co.uk:443 for SSL protocol
[Thu Dec 22 23:18:38.285311 2022] [ssl:emerg] [pid 1378473] AH02572: Failed to configure at least one certificate and key for www.shitouttaluck.co.uk:443
[Thu Dec 22 23:18:38.285325 2022] [ssl:emerg] [pid 1378473] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecting: DH PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
[Thu Dec 22 23:18:38.285334 2022] [ssl:emerg] [pid 1378473] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecting: EC PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
[Thu Dec 22 23:18:38.285347 2022] [ssl:emerg] [pid 1378473] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned
I have several other servers running on this box all running LetsEncrypt certificates, but this has just stopped working for me.
** Steps to recreate the problem**
As the root user
- Create config file in /etc/apache2/sites-available
- apache2 -configtest - This passes with an OK
- a2ensite - Enabling site shitouttaluck
- Activate new config by running - systemctl reload apache2 This loads fine and returns to prompt
- run **certbot --apache"
certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: <Site removed by issue logger>
2: <Site removed by issue logger>
3: <Site removed by issue logger>
4: www.shitouttaluck.co.uk
5: www.stupid-cunt.co.uk
6: <Site removed by issue logger>
7: <Site removed by issue logger>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 4
This then generates the error from above.
I have left 5 showing as this is a working config (don't be displeased, they let me buy them. i didn't think profanity was allowed in DNS names)
I then have to disable the site that isn't working and restart apache as this error causes Apache to barf and crash out.
Any help gratefully recieved