apache gurus please help me restricting directories

They have: 6 posts

Joined: Mar 2002

i have restricted directories using ....
now i want a particular file in that directory to be not restricted or should be viewable without password challenge?
please help me

thanks

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

How did you restrict the directory by something like this:

<?php
<Directory /directoryname>
 
Order Deny,Allow
  Deny from All
</Directory>
?>

If so, I don't believe that you could do it this way since directory locks down or allows a directory. You could probably do it using Apache's Location directive.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 6 posts

Joined: Mar 2002

We are using the following

Auth_Ora_home d:\orant
Auth_Ora_dbuser userid
Auth_Ora_dbpasswd password
Auth_Ora_encrypted off
Auth_Ora_nopasswd off
Auth_Ora_SID NETT
Auth_Ora_pwd_table userstable
Auth_Ora_uid_field customer
Auth_Ora_pwd_field password
Auth_Ora_pwd_whereclause "and date < sysdate "
AuthName "Secure Area"
AuthType basic

require valid-user

now i want one of a file in xyg directory not to be restricted..
i.e no password challenge to be asked.

how can i do that, i am trying with but no luck
help me if you know how to use or etc.. to over come this.

thanks

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

I haven't really tested this out so I don't know how well it will work but here is a try:

<?php
<Location \"d:\Program Files\Apache Group\Apache\htdocs\xyg\">
Order Deny, Allow
Deny from all
Allow url link
</Directory>
?>

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 6 posts

Joined: Mar 2002

... "url link"? doesn't "Allow" always have to be followed by "from"? I thought the arguments "Allow" accepted were "all", a host definition, or an environment variable?

They have: 117 posts

Joined: Feb 2002

Maybe you have to do the inverse using files. Unlock the directory, and then use files to protect all of the other files in it.

They have: 6 posts

Joined: Mar 2002

how do i do the inverse? they are too many files
how to say "if not equal to" ?

thanks for the input

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Yeah, I initially tried the using the location directive to accomplish what you are trying to do. It appeared to work with the allow from option. But after a little more testing, it didn't. Maybe we should change the direction that this is going by explaining what exactly you are trying to accomplish. What is in the directory, etc?

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 6 posts

Joined: Mar 2002

heres the situation:

i have a directory which has html pages in it.
and one of the html page is index page where it has links to other html pages.

we have restricted the directory, so that only users who has valid id and password can enter (checks users and password in oracle database, using mod_auth_oracle).

what i want is i want the index page to be viewable without asking for id/password. i cant move the index page out of this directory.

hope this makes sense.

thanks for all the inputs

They have: 117 posts

Joined: Feb 2002

well, I've never tried this but...

there is the FilesMatch which allows you to use regular expressions in a file container. Soooo...

.
.
.

would match just the index dot whatever file. Can you put an AllowsOverride inside that container then? Not sure to be honest.

They have: 6 posts

Joined: Mar 2002

here it is

in the restricted directory use files command like this

.
..
..

-- any file that ends with that string
Satisfy any
Allow from all

They have: 117 posts

Joined: Feb 2002

Ahh... thanks for posting that.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.