1. Get/Install SQUID3
代碼:
$ sudo apt-get install squid3
$ sudo service squid3 stop
2. Setup SQUID3 user password
代碼:
$ sudo htpasswd -c /etc/squid3/passwd <proxy-user-name>
$ sudo cat /etc/squid3/passwd (To check if it created already)
$ sudo chmod 644 /etc/squid3/passwd
3. Find out NCSA_AUTH handle program location
代碼:
$ sudo dpkg -L squid3 | grep ncsa_auth
/usr/lib/squid3/ncsa_auth
or
/usr/lib/squid3/basic_ncsa_auth
4. Setup Basic auth_param
@ /etc/squid3/squid.conf
Search "Examples:", and umcomment "basic auth example"
replace ""
with "/usr/lib/squid3/ncsa_auth /etc/squid3/passwd"
or
with "/usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd"
代碼:
auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
or
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
5. Setup ACL
@ /etc/squid3/squid.conf
Search "And finally deny all"
Put these two ACL rules before that
代碼:
acl ncsa_auth_users proxy_auth REQUIRED
http_access allow ncsa_auth_users
6. (Optional) Do other setup/performance tuning
@ /etc/squid3/squid.conf
e.g. Make memory pool larger
代碼:
memory_pools_limit 64 MB
e.g. Skip X-Forwarded-For Header
代碼:
forwarded_for delete
8. Finally Startup the squid3
代碼:
$ sudo service squid3 restart
________________
美術插畫設計案子報價系統 v0.1 Beta
爪哇禾雀
|