Renew fails with a 404

Hi,

I have tried with the help of ChatGPT to get my certificates to renew, but I have failed so far.

My domain is:
hjohansen.dk

I ran this command:
sudo certbot renew --apache -v

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log


Processing /etc/letsencrypt/renewal/hjohansen.dk.conf


Certificate is due for renewal, auto-renewing...
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate for hjohansen.dk and www.hjohansen.dk
Performing the following challenges:
http-01 challenge for hjohansen.dk
http-01 challenge for www.hjohansen.dk
Waiting for verification...
Challenge failed for domain hjohansen.dk
Challenge failed for domain www.hjohansen.dk
http-01 challenge for hjohansen.dk
http-01 challenge for www.hjohansen.dk

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: hjohansen.dk
Type: unauthorized
Detail: 62.66.182.80: Invalid response from http://hjohansen.dk/.well-known/acme-challenge/rFcGP4tK_gf8C0N0rq0kgJKdc_wNAGXEitbdX8gPeBc: 404

Domain: www.hjohansen.dk
Type: unauthorized
Detail: 62.66.182.80: Invalid response from http://www.hjohansen.dk/.well-known/acme-challenge/-t9LJqAhfso2s5GVefyqzSPXvkpA8h-Vn31mH1IVnrc: 404

Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure that the listed domains point to this Apache server and that it is accessible from the internet.

Cleaning up challenges
Failed to renew certificate hjohansen.dk with error: Some challenges have failed.


All renewals failed. The following certificates could not be renewed:
/etc/letsencrypt/live/hjohansen.dk/fullchain.pem (failure)


1 renew failure(s), 0 parse failure(s)
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
My web server is (include version):

The operating system my web server runs on is (include version):

Raspberry Pi OS

My hosting provider, if applicable, is:
N/A

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 2.11.0

Here are my apache configurations:
<VirtualHost *:80>
ServerName hjohansen.dk
ServerAlias www.hjohansen.dk
DocumentRoot /var/www/hjohansen.dk
DirectoryIndex index.html
Alias /pihole /var/www/hjohansen.dk/pihole
ErrorLog ${APACHE_LOG_DIR}/hjohansen_error.log
CustomLog ${APACHE_LOG_DIR}/hjohansen_access.log combined

ServerName hjohansen.dk ServerAlias www.hjohansen.dk DocumentRoot /var/www/hjohansen.dk ErrorLog ${APACHE_LOG_DIR}/hjohansen_error.log CustomLog ${APACHE_LOG_DIR}/hjohansen_access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/hjohansen.dk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hjohansen.dk/privkey.pem

Hello @, welcome to the Let's Encrypt community. :slightly_smiling_face:

Please show the output of sudo apachectl -t -D DUMP_VHOSTS

4 Likes

I don't know what happened to the apache configurations, but here they are again:

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName hjohansen.dk
ServerAlias www.hjohansen.dk
DocumentRoot /var/www/hjohansen.dk
ErrorLog ${APACHE_LOG_DIR}/hjohansen_error.log
CustomLog ${APACHE_LOG_DIR}/hjohansen_access.log combined

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/hjohansen.dk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hjohansen.dk/privkey.pem

</VirtualHost>
</IfModule>

<VirtualHost *:80>
ServerName hjohansen.dk
ServerAlias www.hjohansen.dk
DocumentRoot /var/www/hjohansen.dk
DirectoryIndex index.html
Alias /pihole /var/www/hjohansen.dk/pihole
ErrorLog ${APACHE_LOG_DIR}/hjohansen_error.log
CustomLog ${APACHE_LOG_DIR}/hjohansen_access.log combined
</VirtualHost>

VirtualHost configuration:
192.168.50.2:80 192.168.50.2 (/etc/apache2/sites-enabled/pihole.conf:1)
*:443 hjohansen.dk (/etc/apache2/sites-enabled/hjohansen.dk-le-ssl.conf:2)
*:80 hjohansen.dk (/etc/apache2/sites-enabled/hjohansen.dk.conf:1)

I changed my pihole.conf from <VirtualHost 192.168.50.2:80> to <VirtualHost *:80> and now it works. Thank you!

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.