I used to certbot run -a webroot -i apache -w /home/www.vske.cz/novy_moodle.vske.cz -d moodle.vske.cz but same problem:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer apache
Cert is due for renewal, auto-renewing…
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for moodle.vske.cz
Using the webroot path /home/www.vske.cz/novy_moodle.vske.cz for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. moodle.vske.cz (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://moodle.vske.cz/.well-known/acme-challenge/mUJi0Ck2j0oBHIObkIa2kdcjeGiGMXcsLQVFPsviIVg [2a02:e98:80:a01::111]: “\n\n404 Not Found\n\n
Not Found
\n<p”IMPORTANT NOTES:
-
The following errors were reported by the server:
Domain: moodle.vske.cz
Type: unauthorized
Detail: Invalid response from
http://moodle.vske.cz/.well-known/acme-challenge/mUJi0Ck2j0oBHIObkIa2kdcjeGiGMXcsLQVFPsviIVg
[2a02:e98:80:a01::111]: “\n\n404 Not
Found\n\nNot Found
\n<p”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.
I have alias for /.well-known/acme-challenge/ to /var/www/acme-challenge/
# Serve ACME challenge responses
Alias /.well-known/acme-challenge/ /var/www/acme-challenges/
<Directory /var/www/acme-challenges/>
Options FollowSymlinks
Options -Indexes
AllowOverride None
# Apache >= 2.3
Require all granted
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order Allow,Deny
Allow from all