Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<Directory> with wildcards...use different password files?

Status
Not open for further replies.

virtualoverride

Programmer
May 29, 2005
3
US
I am working on setting up a streaming media server over my LAN...I won't go into details, but I want each user of my computer (which is a Windows XP machine, btw) to be able to access their music folder by going to " This is fairly easily accomplished by using AliasMatch and a corresponding Directory block.

AliasMatch ^/~(.+)/music "C:/Documents and Settings/$1/My Documents/My Music/"

<Directory "C:/Documents and Settings/*/My Documents/My Music">
AllowOverride All
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
AuthUserFile .htpasswd
AuthType Basic
AuthName "Music Server"
Require valid-user
</Directory>

Right now it authenticates everyone using ".htpasswd" as the user file (which is stored in my server root). What I would like to do is have a different .htpasswd file for each user account. For example, if I go to then it should authenticate me with "Andrew.htpasswd" etc. Is there any way to do this?

I already tried the stupid stuff like "AuthUserFile *.htpasswd" and I tried using <DirectoryMatch> so that maybe I could do "AuthUserFile $1.htpasswd" but that doesn't seem to work...let me know if it's possible!
Andrew
 
Hi

Never tried this before. The simple solution is to put the authentication settings in separate .htaccess files in the music directories.

Beside this, there are different authentication modules for Apache, probably one of them has comfortable support for this.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top