Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Restrict certain web users by IP
Date: Fri, 30 Nov 2012 08:38:48
Message-Id: CAN0CFw1Gn-K8qPvn3yw5ka6d1nMOJn4yXFYtF8QbC5YCVZqv8g@mail.gmail.com
In Reply to: Re: [gentoo-user] Restrict certain web users by IP by Michael Orlitzky
1 > > Run two vhosts that deliver the same content from the same DocumentRoot
2 > >
3 > > One has jack and jill as users in htpasswd with no acls in place
4 > > The other has john and jacob as users in a different htpasswd with IP
5 > > acls in place
6 > >
7 > > Trying to specify access rules to a group of users and not to other
8 > > users all in the same context is a problem that will drive you nuts in a
9 > > day. Rather side-step it entirely by applying your rules globaly to two
10 > > different things.
11 > >
12 >
13 > You can probably accomplish the same with path aliases and <Location>
14 > restrictions. Untested:
15 >
16 > Alias /jackjill /var/www/your-stuff
17 > Alias /johnjacob /var/www/your-stuff
18 >
19 > <Location /jackjill>
20 > AuthType Basic
21 > AuthName "Restricted"
22 > AuthUserFile /var/www/jackjill.passwd
23 > Require valid-user
24 > Allow from <jack-ip>
25 > Allow from <jill-ip>
26 > Deny from all
27 > </Location>
28 >
29 > <Location /johnjacob>
30 > AuthType Basic
31 > AuthName "Restricted"
32 > AuthUserFile /var/www/johnjacob.passwd
33 > Require valid-user
34 > </Location>
35
36 I like this idea since it means I don't need to mess with another domain
37 name. The only problem I'm running into is one of the applications on the
38 server doesn't work with www.example.com/jackjill/app, it only works with
39 www.example.com/app. I set up a RewriteRule to rewrite /jackjill/app to
40 /app, and that makes the application work, but then <Location /jackjill>
41 doesn't work. Is there any way around this?
42
43 - Grant

Replies

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