Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache directory protection
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
-Craig-
Guru
Guru


Joined: 03 Jun 2004
Posts: 333

PostPosted: Tue Feb 26, 2008 11:00 am    Post subject: Apache directory protection Reply with quote

Hi,

I want to allow Users to request /f00/bar.do without passwort, but the rest of /f00 should be protected via passwort+ip protection.
Is this possible? I cannot use <Directory> as the bar.do comes from a tomcat server.
For some reason this does not work here: :(

Code:
<Location ^/f00/bar.do>
        order allow,deny
        allow from all
        Satisfy any
</Location>

<LocationMatch "/f00">
    AuthType Basic
    AuthName "f00auth"
    AuthUserFile /etc/apache2/htpasswd

    require user bar
    order deny,allow
    deny from all
    allow from X.X.X.X
    Satisfy all
</LocationMatch>


Last edited by -Craig- on Thu Feb 28, 2008 10:23 am; edited 1 time in total
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Feb 28, 2008 2:45 am    Post subject: Reply with quote

I've definitely done things like that,
you might you need to change the order though....
A little different, but this worked for me


<Directory /var/www/protected_stuff>
UseCanonicalName Off
AuthType Basic
AuthName "Password Required"
AuthUserFile /password.file
AuthGroupFile /group.file
Require group special_people
</Directory>

<Location /protected_stuff/test>
order allow,deny
allow from all
Satisfy any
</Location>
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
-Craig-
Guru
Guru


Joined: 03 Jun 2004
Posts: 333

PostPosted: Thu Feb 28, 2008 10:24 am    Post subject: Re: Apache directory protection Reply with quote

Thanks, BUT:
-Craig- wrote:
Hi,
I cannot use <Directory> as the bar.do comes from a tomcat server.

It does not work with <Location>
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Feb 28, 2008 4:54 pm    Post subject: Reply with quote

I know, but the directive that specifies the file is not, which did not appear to violate your previous requirement, and I thought changing the order might help, but

Try using the <Files>
http://httpd.apache.org/docs/2.0/mod/core.html#files
note they can be nested.
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
-Craig-
Guru
Guru


Joined: 03 Jun 2004
Posts: 333

PostPosted: Fri Feb 29, 2008 9:48 am    Post subject: Reply with quote

No, doesn't work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum