1 |
On Monday, 30 November 2020 22:52:05 GMT thelma@×××××××××××.com wrote: |
2 |
|
3 |
> Access based on IP address works from .htaccess with Files directive: |
4 |
> |
5 |
> <Files *> |
6 |
> Require ip 10.0.0.109 |
7 |
> </Files> |
8 |
> |
9 |
> But it doesn't read AuthType Basic, it doesn't ask me for any password. |
10 |
> |
11 |
> AuthName "restricted stuff" |
12 |
> AuthType Basic |
13 |
> AuthUserFile "/etc/apache2/users" |
14 |
> require user webmaster |
15 |
> |
16 |
> It seems to me Apache 2.4 is very limited what can, and can not go into |
17 |
> .htaccess. |
18 |
|
19 |
OK, probably Authentication takes precedence from Authorization on apache 2.4. |
20 |
|
21 |
Since you prefer to use .htaccess rather than a central apache config, let's |
22 |
check if this works in your /admin/.htaccess: |
23 |
|
24 |
=========================== |
25 |
AuthName "restricted stuff" |
26 |
AuthType Basic |
27 |
AuthUserFile "/etc/apache2/users" |
28 |
<RequireAll> |
29 |
Require ip 10.0.0.100 |
30 |
Require user webmaster |
31 |
</RequireAll> |
32 |
========================== |
33 |
|
34 |
It should allow you to connect and then request username and passwd from IP |
35 |
10.0.0.100, but return '403 Forbidden' for clients connecting from any other |
36 |
IP address, without requesting authentication. |