โปรแกรมที่จำเป็น
Dwimperlsquid_db_authAppserv 2.5.10SquidNT Proxy Setup 2.7.rarSquidNT Control Service 2.7.rarฐานข้อมูล SQL ชื่อ squid
CREATE TABLE `passwd` (
`user` varchar(32) NOT NULL default '',
`password` varchar(35) NOT NULL default '',
`enabled` tinyint(1) NOT NULL default '1',
`fullname` varchar(60) default NULL,
`comment` varchar(60) default NULL,
PRIMARY KEY (`user`)
);
สร้าง User ทดสอบ ใน SQL
insert into passwd values(1,"testuser1","test1",1,"Test User1",''for testing purpose");
คำสั่ง
squid.conf
auth_param basic program C:/Dwimperl/perl/bin/perl.exe C:/squid/libexec/squid_db_auth.pl --user root(userฐานข้อมูลSQL) --password 1234(รหัสผ่านฐานข้อมูลSQL)
auth_param basic children 5
auth_param basic realm SquidNT 2.7 bY Oek2002
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive on
acl db-auth proxy_auth REQUIRED
http_access allow db-auth
http_access allow localhost
http_access deny all
ถ้ายังไม่ได้ ให้เข้า MySQL Command Line Client แล้วพิมพ์
GRANT ALL PRIVILEGES ON squid.* TO root@localhost;