Hi!
My Let's encrypt certificate is expired 4 days ago and I didn't found a solution to renew it.
My domain is: dph.ddns.net
Domain registred by: noip
I ran this command:
certbot renew -a webroot -w /var/www/html --dry-run
It produced this output:
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for dph.ddns.net
Using the webroot path /var/www/html for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (old_dph.ddns.net) from /etc/letsencrypt/renewal/old_dph.ddns.net.conf produced an unexpected error: Failed authorization procedure. dph.ddns.net (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://dph.ddns.net/index.php/login [XX.XXX.XX.XXX]: "<!DOCTYPE html>\n<html class=\"ng-csp\" data-placeholder-focus=\"false\" lang=\"en\" data-locale=\"en\" >\n\t<head\n data-requesttoken=\"Wpma". Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/dph.ddns.net/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates below have not been saved.)
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/dph.ddns.net/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: dph.ddns.net
Type: unauthorized
Detail: Invalid response from https://dph.ddns.net/index.php/login
[XX.XXX.XX.XXX]: "<!DOCTYPE html>\n<html class=\"ng-csp\"
data-placeholder-focus=\"false\" lang=\"en\" data-locale=\"en\"
>\n\t<head\n data-requesttoken=\"Wpma"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My web server is (include version): RaspberryPi4
The operating system my web server runs on is (include version): NextcloudPi
Unfortunately it didn't work. I've removed the lines and reentered the renewal command. No success. Can I install a new certificate?
If yes, what do I have to remove/due?
Did you just run certbot renew or did you also add the webroot options to that command again, as suggested by @rg305?
Also, your Nextcloud is returning a redirect to https://dph.ddns.net/index.php/login, so your Nextcloud might interfer with certbots webroot method. Could you please put a text file called "test" with some random text in it the directory /var/www/html/.well-known/acme-challenge ? You might need to make those two latter directories with mkdir if they don't exist already.
So either NextCloud is interfering with the access to the /.well-known/acme-challenge/ directory or your webroot path isn't correct. It should be the same as the DocumentRoot directive in the appropriate Apache VirtualHost.