Ref. http://www.babyface2.com/NetAdmin/27200804squid/
1
2
3
4
5
6
7
|
[root@localhost ~]# rpm -ql squid | grep ncsa
/usr/lib64/squid/ncsa_auth
/usr/share/man/man8/ncsa_auth.8.gz
[root@localhost ~]# rpm -ql httpd | grep htpasswd
/usr/bin/htpasswd
/usr/share/man/man1/htpasswd.1.gz
|
1
|
[root@localhost ~]# yum install httpd squid
|
1
2
3
4
5
6
7
|
[root@localhost ~]# vim /etc/squid/squid.conf
#修改前
#acl password proxy_auth REQUIRED
#修改後
acl password proxy_auth REQUIRED
http_access allow password
|
auth_param basic children 5
同時接受認證的連線數
auth_param basic realm Squid proxy-caching web server
使用者在輸入帳密的地方所顯示的說明文字
auth_param basic credentialsttl 2 hours
使用者連線時的連續時間
auth_param basic casesensitive off
使用特殊權限的帳號登入時會直接取消不給登入
1.4 建立帳密
在使用htpasswd建立帳密時第一次要記得加參數-c,之後就不用加了。「derek」和「faq」為要新增的帳號。