dimanche 2 novembre 2014

Require ip 127.0.0.1 works sometimes and sometimes' it won't


Vote count:

0




I have a very simple .htaccess file:



<RequireAll>
Require all granted

# require localhost
Require ip 127.0.0.1
</RequireAll>


and it works... sometimes!


Sometimes, it will throw me a 403, and the error.log explains:



[client ::1:65443] AH01630: client denied by server configuration



Why won't it match that local client to the Require ip 127.0.0.1 rule?



asked 31 secs ago

Domi

3,195

1 Answer



Vote count:

0




As it turns out, Apache 2.4's Require matches the IP exactly. If you have multiple IP addresses aliasing localhost, you need to list all of them.


In this particular case, the error.log entry reveals it all: The client connected through the IPv6 interface (ip == ::1). That needs to be white-listed as well:



<RequireAll>
Require all granted

# require localhost
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</RequireAll>


answered 31 secs ago

Domi

3,195





Require ip 127.0.0.1 works sometimes and sometimes' it won't

Aucun commentaire:

Enregistrer un commentaire