mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-01-04 20:32:19 +08:00
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
@@ -41,19 +41,19 @@ Configure your webserver to respond statelessly to challenges for a given accoun
|
|||||||
```
|
```
|
||||||
### APACHE
|
### APACHE
|
||||||
|
|
||||||
_Tested on Apache 2.4.61_
|
_Tested on Apache 2.4.62_
|
||||||
|
|
||||||
Add something similar to your `httpd.conf`:
|
Add something similar to your `httpd.conf`:
|
||||||
```apache
|
```apache
|
||||||
...
|
...
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
...
|
...
|
||||||
<Directory "/PATH/TO/WWW/ROOT/.well-known/acme-challenge/">
|
<LocationMatch "/.well-known/acme-challenge/(?<challenge>[-_a-zA-Z0-9]+)">
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteRule "^([-_a-zA-Z0-9]+)$" "$1" [E=challenge:$1]
|
RewriteRule "^([-_a-zA-Z0-9]+)$" "$1" [E=challenge:$1]
|
||||||
ErrorDocument 200 "%{ENV:challenge}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
|
ErrorDocument 200 "%{ENV:MATCH_CHALLENGE}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
|
||||||
RewriteRule ^ - [L,R=200]
|
RewriteRule ^ - [L,R=200]
|
||||||
</Directory>
|
</LocationMatch>
|
||||||
...
|
...
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
...
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user