Apache multidomain webroot

You might also need to allow apache reading the folder (and prevent script from being executed):

Alias /.well-known/acme-challenge/ /var/www/html/.well-known/acme-challenge/
<Directory "/var/www/html/.well-known/acme-challenge/">
    Options None
    AllowOverride None
    ForceType text/plain
    RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
</Directory>

The redirect match is not required, but helps preventing an information leak so that other people can see that this folder is redirected.

PS: if you are a hoster, this also prevents users from requesting a LetsEncrypt certificate.
PPS: apache reload should be enough.

3 Likes