Temat: Lighttpd i katalog na hasło
Witam,
Przeczytałem lekturę http://redmine.lighttpd.net/projects/1/ … oBasicAuth i mam kilka pytań.
1. Czy mod_auth muszę doinstalować czy jest on już w Lighttpd, w configu lighttpd.conf mam # "mod_auth", może wystarczy że usunę #
2. Przykładowe wpisy poniżej rozumiem że mam dodać w /etc/lighttpd/lighttpd.conf , jeśli tak to ma to znaczenie w którym miejscu?
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/etc/lighttpd/lighttpd.user"auth.require = ( "/admin" =>
(
"method" => "basic",
"realm" => "Admin Realm",
"require" => "user=firstadmin|user=secondadmin"
)
)3. Najmniej rozumiem to: Now you have to generate lines to put in the lighttpd.user file. This is the script I use to spit out the appropriate line format (mam utworzyć plik lighttpd.user w /etc/lighttpd/ i w nim dokonać stosownych wpisów ?)
#!/usr/bin/perl
print "User: ";
$user = <>;
chomp $user;
print "Realm: ";
$realm = <>;
chomp $realm;
use Term::ReadKey;
{
ReadMode('noecho');
print "Password: ";
$password = ReadLine(0);
chomp $password;
print "\nPassword again: ";
$password2 = ReadLine(0);
chomp $password2;
ReadMode('normal');
print "\n";
if($password ne $password2)
{
print "Passwords don't match\n";
redo;
}
}
print "$user:$realm:";
open(MD5, "|md5sum | cut -b -32") or die;
print MD5 "$user:$realm:$password";
close(MD5);Pozdrawia Krynio
TP-Link TL-WR1043ND Mod, RAM 64 MB, chłodzenie pasywne, Gargoyle 1.5.10.14, extroot, kamerka Logitech HD Webcam C270