authentication in subfolders
Added by jschilli over 16 years ago
Hi,
sorry for this question. I'm new using lighttpd and searched lots of forums but without success.
I use lighttpd 1.4.13-4etch11 on my debian slug.
Since I have only one domain but want to use my webserver for different people I devided my server-root into different subdirectories.
Server-root Subfolder1
Subfolder 2
Subfolder 3
Now I need different authentication for the subfolders. Therefore I used .htaccess and .htpasswd files in each subfolder. The problem is, that if I use .htaccess and .htpasswd in the server-root, this authentication is automatically valid for each subfolder. The .htaccess and .htpasswd files of the subfolders get senseless.
How can I configure lighttpd to pass the authentication to subfolders until there is another .htaccess and .htpasswd?
My lighttpd.conf looks like:
$HTTP["url"] =~ "^/" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/lighttpd/www-root.user"
auth.require = ("/" => (
"method" => "basic",
"realm" => "my_server",
"require" => "user=admin"
))
}
$HTTP["url"] =~ "^/subfolder1/" {
AllowOverride All
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/lighttpd/www-root.user"
auth.require = ("/subfolder1" => (
"method" => "basic",
"realm" => "my_server",
"require" => "user=user1|user=user2"
))
}
$HTTP["url"] =~ "^/subfolder2/" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/lighttpd/www-root.user"
auth.require = ("/subfolder2" => (
"method" => "basic",
"realm" => "my_server",
"require" => "valid-user"
))
}
Thank you for every answer
jschilli
Replies (1)
RE: authentication in subfolders - Added by jschilli over 16 years ago
It's a pity that there is nobody who answers my question!