• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Apache and <Files> Container

In my httpd.conf I have the following for example

ScriptAlias /perlstuff/ "/home/meme/apache/perlstuff"

<Files /home/meme/apache/perlstuff/perl1.pl >
AuthUserFile /home/meme/apache/conf/.pwdfile
AuthName "Protected File"
AuthType Basic
Require valid-user
</Files>

Whenever I go to for example

http://localhost/perlstuff/perl1.pl

I can still access it, it doesn't prompt me.  I have the .pwdfile created and correctly in the conf directory so I'm not exactly sure where I'm going wrong.  I can do directories and wildcards but can't seem to do single files properly.



0
kevin_ma
Asked:
kevin_ma
1 Solution
 
yuzhCommented:
You can't control acess to a single file, you can only control access to dir level.

You can use .htaccess files or a single access.conf (you can use a different file name
as long as you defined it in your httpd.conf file) to control the dir access.

Fot  authentication using .htaccess, have a look at the following Tutorial:

http://erudition.com/htaccess.htm

Apache FAQ:
http://httpd.apache.org/docs/misc/FAQ.html

also:
http:Q_21148770.html
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now