Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

can't password protect a file but can a directory

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


jswordtestem at yahoo

Mar 20, 2012, 2:42 AM

Post #1 of 2 (160 views)
Permalink
can't password protect a file but can a directory

I can't get b.htm to be password protected.

I can put directives AuthType, AuthName, AuthUserFile, Require.. In <directory..> and get the directory password protected.

But I want the directory to not be password protected, and for just a file (b.htm) to be password protected but i'm having no luck in my attempts

here are some extracts from my httpd.conf file


<Directory "C:/apachefiles">

#AuthUserFile "C:/Program Files/Apache Software #Foundation/Apache2.2/bin/pfile"
#AuthType Basic
#AuthName "My Secret Page"

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny
Allow from all

</Directory>



<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

<FilesMatch "b\.htm">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
Require user barny
</FilesMatch>

<Files "b.htm">
AuthType Basic
AuthName "My Secret Page"
AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
Require user barny
</Files>

<Files "C:/apachefiles/b.htm">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
Require user barny
</Files>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


rbowen at rcbowen

Mar 20, 2012, 6:18 AM

Post #2 of 2 (156 views)
Permalink
Re: can't password protect a file but can a directory [In reply to]

On Mar 20, 2012, at 5:42 AM, phil curb wrote:

>
> I can't get b.htm to be password protected.
>
> I can put directives AuthType, AuthName, AuthUserFile, Require.. In <directory..> and get the directory password protected.
>
> But I want the directory to not be password protected, and for just a file (b.htm) to be password protected but i'm having no luck in my attempts

Please elaborate on "no luck". What happens, exactly? Are there error messages? (ie, in the error log, not in the browser.)

>
> here are some extracts from my httpd.conf file
>
>
> <Directory "C:/apachefiles">
>
> #AuthUserFile "C:/Program Files/Apache Software #Foundation/Apache2.2/bin/pfile"
> #AuthType Basic
> #AuthName "My Secret Page"
>
> Options Indexes FollowSymLinks
>
> AllowOverride None
>
> Order allow,deny
> Allow from all
>
> </Directory>
>
>
>
> <FilesMatch "^\.ht">
> Order allow,deny
> Deny from all
> Satisfy All
> </FilesMatch>
>
> <FilesMatch "b\.htm">
> AuthType Basic
> AuthName "Restricted Files"
> AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
> Require user barny
> </FilesMatch>
>
> <Files "b.htm">
> AuthType Basic
> AuthName "My Secret Page"
> AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
> Require user barny
> </Files>
>
> <Files "C:/apachefiles/b.htm">
> AuthType Basic
> AuthName "Restricted Files"
> AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/bin/pfile"
> Require user barny
> </Files>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>

--
Rich Bowen
rbowen [at] rcbowen :: @rbowen
rbowen [at] apache

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.