For example:
<VirtualHost *:80>
Servername le-test-06.example.com
DocumentRoot /var/www/vhosts/le-test-06.example.com/htdocs/
<Directory "/var/www/vhosts/le-test-06.example.com/htdocs/">
Require all denied
</Directory>
<Directory "/var/www/vhosts/le-test-06.example.com/htdocs/.well-known/acme-challenge">
Require all granted
</Directory>
</VirtualHost>
Did the trick on my server. If you really want to be correct, you could/should put the <Directory>
containers between <IfModule mod_authz_core.c>
and </IfModule>
because the Require
directive is part of the mod_authz_core
module.
Your location of the webroot might be different ofcourse. Just use the directory from the DocumentRoot
directive, once without modification and once with the .well-known/acme-challenge/
part trailing it, in that order (deny, allow)..