1 |
On 11/30/2020 02:20 PM, Michael wrote: |
2 |
> On Monday, 30 November 2020 20:07:10 GMT thelma@×××××××××××.com wrote: |
3 |
> |
4 |
>> Thank for looking into it and input. |
5 |
>> I must be missing someting because if I use in .htaccess file direcive: |
6 |
>> <Directory "/var/www/localhost/htdocs/*/admin"> or |
7 |
>> <Location "*/admin"> |
8 |
>> |
9 |
>> In both cases I get an error from Apache: |
10 |
>> |
11 |
>> [client 10.0.0.109] /var/www/localhost/htdocs/catalog/admin/.htaccess: |
12 |
>> <Directory not allowed here [client 10.0.0.109 |
13 |
>> /var/www/localhost/htdocs/catalog/admin/.htaccess: <Location not allowed |
14 |
>> here |
15 |
> |
16 |
> Yes, the error is because Directory and/or Location directives ought to go in |
17 |
> the main apache config files for this vhost, rather than in .htaccess. |
18 |
> |
19 |
> Is there a particular reason you want to use .htaccess, rather than files in |
20 |
> the /etc/apache subdirectories? |
21 |
|
22 |
Access based on IP address works from .htaccess with Files directive: |
23 |
|
24 |
<Files *> |
25 |
Require ip 10.0.0.109 |
26 |
</Files> |
27 |
|
28 |
But it doesn't read AuthType Basic, it doesn't ask me for any password. |
29 |
|
30 |
AuthName "restricted stuff" |
31 |
AuthType Basic |
32 |
AuthUserFile "/etc/apache2/users" |
33 |
require user webmaster |
34 |
|
35 |
It seems to me Apache 2.4 is very limited what can, and can not go into |
36 |
.htaccess. |