I ran this command: certbot certonly --webroot --agree-tos --email my-list@example.com --domains test-case.example.com --webroot-path /var/www/letsencrypt/.well-known/acme-challenge/
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for test-case.example.com
Performing the following challenges:
http-01 challenge for test-case.example.com
Using the webroot path /var/www/letsencrypt/.well-known/acme-challenge for all unmatched domains.
Waiting for verification...
Challenge failed for domain test-case.example.com
http-01 challenge for test-case.example.com
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: test-case.example.com
Type: unauthorized
Detail: 1.2.3.4: Invalid response from
http://test-case.example.com/.well-known/acme-challenge/xjELNfkqNTen92RxwVzAA0-sdKfIL-FleojoWnNha7I:
404
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): Apache 2.4.53-1~deb11u1
The operating system my web server runs on is (include version): Debian 11
I can login to a root shell on my machine (yes or no, or I don't know): yes
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): cerbot 1.12.0-2
My Apache config that's active, taken from here:
<virtualHost *.80>
Alias /.well-known/acme-challenge/ /var/www/letsencrypt/.well-known/acme-challenge/
<Directory "/var/www/letsencrypt/.well-known/acme-challenge/">
Options None
AllowOverride None
ForceType text/plain
RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
</Directory>
</virtualHost>
Permissions of this dir are set correctly:
tree -ap /var/www/letsencrypt/
/var/www/letsencrypt/
βββ [drwxr-xr-x] .well-known
βββ [drwxr-xr-x] acme-challenge
2 directories, 0 files
This nginx example works fine on another server. So I'm looking for something similar.
server {
listen 80;
listen [::]:80;
server_name _;
include hardening;
location /.well-known/acme-challenge/ {
root /var/www/acme-challenge/;
}
location / {
return 301 https://$host$request_uri;
}
}
So my question is. Is there a nice catch-all example config to use? Because I've been looking for fully described examples from official sources, i.e. Apache or Let's Encrypt and such. But can't find any.