Gentoo Archives: gentoo-user

From: Michael Orlitzky <michael@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Restrict certain web users by IP
Date: Fri, 30 Nov 2012 01:06:13
Message-Id: 50B80631.1020302@orlitzky.com
In Reply to: Re: [gentoo-user] Restrict certain web users by IP by Alan McKinnon
1 On 11/29/2012 03:43 PM, Alan McKinnon wrote:
2 >
3 > Run two vhosts that deliver the same content from the same DocumentRoot
4 >
5 > One has jack and jill as users in htpasswd with no acls in place
6 > The other has john and jacob as users in a different htpasswd with IP
7 > acls in place
8 >
9 > Trying to specify access rules to a group of users and not to other
10 > users all in the same context is a problem that will drive you nuts in a
11 > day. Rather side-step it entirely by applying your rules globaly to two
12 > different things.
13 >
14
15 You can probably accomplish the same with path aliases and <Location>
16 restrictions. Untested:
17
18 Alias /jackjill /var/www/your-stuff
19 Alias /johnjacob /var/www/your-stuff
20
21 <Location /jackjill>
22 AuthType Basic
23 AuthName "Restricted"
24 AuthUserFile /var/www/jackjill.passwd
25 Require valid-user
26 Allow from <jack-ip>
27 Allow from <jill-ip>
28 Deny from all
29 </Location>
30
31 <Location /johnjacob>
32 AuthType Basic
33 AuthName "Restricted"
34 AuthUserFile /var/www/johnjacob.passwd
35 Require valid-user
36 </Location>
37
38
39 I tried to come up with a less stupid way; I don't think there is one.

Replies

Subject Author
Re: [gentoo-user] Restrict certain web users by IP Grant <emailgrant@×××××.com>