Proxy
, Squid
PS. ~夜晚的星空~ 原發表於 HiNet Xuite DATE: 01/30/2012 10:46:58 AM
yum install squid
(RH系列的linux可以這樣裝)$ cat /etc/squid/squid.conf
# Set the acl
acl allowdomain dstdomain "/etc/squid/allowdomain.txt"
acl allowip dst "/etc/squid/allowip.txt"
acl Safe_ports port 80
acl Safe_ports port 443
# Bind the acl
http_access deny !Safe_ports
http_access allow allowdomain
http_access allow allowip
http_access deny all
# Set proxy listening port
http_port 80
# Set read only (Without cache)
cache_dir ufs /var/spool/squid 10 1 1 read-only
cache_mem 0 MB
# Set the parent proxy (If there is a parent proxy)
cache_peer url.parent.proxy parent 80 3130 proxy-only no-query no-digest no-netdb-exchange
cache_peer_access url.parent.proxy allow all
# Ask for all request from parent, if you want.
never_direct allow all
# Set proxy manager.
cache_mgr admin@your.net.work
$ cat /etc/squid/allowdomain.txt
www.google.com
www.google.com.tw
.gov.tw
.edu.tw
.microsoft.com .microsoft.com.tw .windowsupdate.com
$ cat /etc/squid/allowip.txt
140.0.0.0/8
/etc/init.d/squid start