Switch suggested Apache configuration from `<Directory>` to `<LocationMatch>` to avoid the requirement for a "<DocumentRoot>/.well-known/acme-challenge" directory to exist on the file-system

master
Dadeos 2024-09-21 18:44:37 +01:00
parent 5467963d1a
commit 3b3c642766
1 changed files with 4 additions and 4 deletions

@ -41,19 +41,19 @@ Configure your webserver to respond statelessly to challenges for a given accoun
```
### APACHE
_Tested on Apache 2.4.61_
_Tested on Apache 2.4.62_
Add something similar to your `httpd.conf`:
```apache
...
<VirtualHost *:80>
...
<Directory "/PATH/TO/WWW/ROOT/.well-known/acme-challenge/">
<LocationMatch "/.well-known/acme-challenge/(?<challenge>[-_a-zA-Z0-9]+)">
RewriteEngine On
RewriteRule "^([-_a-zA-Z0-9]+)$" "$1" [E=challenge:$1]
ErrorDocument 200 "%{ENV:challenge}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
ErrorDocument 200 "%{ENV:MATCH_CHALLENGE}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
RewriteRule ^ - [L,R=200]
</Directory>
</LocationMatch>
...
</VirtualHost>
...