Passsword protected folder

This is a discussion on Passsword protected folder within the Apache Web Server forums, part of the Web Server and Related Forums category; I have read and studied and googled and still don't quite get the concept. If someone could give me ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-05-2005
Jim Jones
 
Posts: n/a
Default Passsword protected folder

I have read and studied and googled and still don't quite get the
concept. If someone could give me a nudge in the right direction it
would be muckly appreciated.

I have a small server at work with SuSe 9.2 and Apache 2.x that we use
to hold small tibits or support information. The html docs path is
/srv/www/htdocs which is the standard path set in SuSe. I have one
folder under htdocs that I want to protect from the general users and
just allows the support folks use it. It is called admin. I have managed
to protect it in httpd.conf, using a user/password file. When I do this
however, it requires a username and password for all folders. Can anyone
give me a quick and dirty way of setting this up in the httpd.conf so
that only the admin folder is protected and anything else in htdocs is
free to be used by anyone else no username or password required?

Thanks in Advance
Jim
  #2 (permalink)  
Old 08-08-2005
caepo3
 
Posts: n/a
Default Re: Passsword protected folder

Jim Jones wrote:
> I have read and studied and googled and still don't quite get the
> concept. If someone could give me a nudge in the right direction it
> would be muckly appreciated.
>
> I have a small server at work with SuSe 9.2 and Apache 2.x that we use
> to hold small tibits or support information. The html docs path is
> /srv/www/htdocs which is the standard path set in SuSe. I have one
> folder under htdocs that I want to protect from the general users and
> just allows the support folks use it. It is called admin. I have managed
> to protect it in httpd.conf, using a user/password file. When I do this
> however, it requires a username and password for all folders. Can anyone
> give me a quick and dirty way of setting this up in the httpd.conf so
> that only the admin folder is protected and anything else in htdocs is
> free to be used by anyone else no username or password required?
>
> Thanks in Advance
> Jim


I'm relatively new at using Apache (so forgive me if I'm wrong!), but I
managed to get this working on my site. You'll want to create a
<Directory> structure set up something like this:

<Directory "/srv/htdocs/admin">
AuthType Basic
AuthName "Only Support Folks Allowed!"
AuthUserFile "/path/to/auth/file"
Require valid-user
</Directory>

That should make only the admin folder password-protected. Hope that helps!

~Chad
  #3 (permalink)  
Old 08-09-2005
Jim Jones
 
Posts: n/a
Default Re: Passsword protected folder

caepo3 wrote:
> Jim Jones wrote:
>> I have read and studied and googled and still don't quite get the
>> concept. If someone could give me a nudge in the right direction it
>> would be muckly appreciated.
>>
>> I have a small server at work with SuSe 9.2 and Apache 2.x that we use
>> to hold small tibits or support information. The html docs path is
>> /srv/www/htdocs which is the standard path set in SuSe. I have one
>> folder under htdocs that I want to protect from the general users and
>> just allows the support folks use it. It is called admin. I have
>> managed to protect it in httpd.conf, using a user/password file. When
>> I do this however, it requires a username and password for all
>> folders. Can anyone give me a quick and dirty way of setting this up
>> in the httpd.conf so that only the admin folder is protected and
>> anything else in htdocs is free to be used by anyone else no username
>> or password required?
>>
>> Thanks in Advance
>> Jim

>
> I'm relatively new at using Apache (so forgive me if I'm wrong!), but I
> managed to get this working on my site. You'll want to create a
> <Directory> structure set up something like this:
>
> <Directory "/srv/htdocs/admin">
> AuthType Basic
> AuthName "Only Support Folks Allowed!"
> AuthUserFile "/path/to/auth/file"
> Require valid-user
> </Directory>
>
> That should make only the admin folder password-protected. Hope that
> helps!
>
> ~Chad

Ok that part works, had it working in hte first place. I guess I mis
stated my query. Now that I have that one folder password protected, how
do I define the rest of the folders under the htdocs to be free for
anyone to use. When I invoke the method rules for the Admin folder it
either blocks access to the rest of the folders all together or the
users have to have a user name and password.
  #4 (permalink)  
Old 08-09-2005
George Adams
 
Posts: n/a
Default Re: Passsword protected folder


>> I'm relatively new at using Apache (so forgive me if I'm wrong!), but
>> I managed to get this working on my site. You'll want to create a
>> <Directory> structure set up something like this:
>>
>> <Directory "/srv/htdocs/admin">
>> AuthType Basic
>> AuthName "Only Support Folks Allowed!"
>> AuthUserFile "/path/to/auth/file"
>> Require valid-user
>> </Directory>
>>
>> That should make only the admin folder password-protected. Hope that
>> helps!
>>
>> ~Chad

>
> Ok that part works, had it working in hte first place. I guess I mis
> stated my query. Now that I have that one folder password protected, how
> do I define the rest of the folders under the htdocs to be free for
> anyone to use. When I invoke the method rules for the Admin folder it
> either blocks access to the rest of the folders all together or the
> users have to have a user name and password.


Chad's solution should do what you want. In your httpd.conf, you should
already have something like this:

<Directory "/srv/htdocs">
Order allow,deny
Allow from all
(... other directives ...)
</Directory>

so by adding

<Directory "/srv/htdocs/admin">
AuthType Basic
AuthName "Only Support Folks Allowed!"
AuthUserFile "/path/to/auth/file"
Require valid-user
</Directory>

you protect only /srv/htdocs/admin while leaving the rest of /srv/htdocs
unprotected for general viewing.

(make sure you're not nesting the <Directory "/srv/htdocs/admin">
section within the <Directory "/srv/htdocs"> section. Keep them
separate in your httpd.conf)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:22 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0