安裝套件
yum -y install squid*
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
vi /etc/squid/squid.conf
#請視使用人數和硬碟狀況加大 cache 資料夾容量
cache_dir ufs /var/spool/squid 1000 16 256
#限制允許連線範圍,請依自己學校狀況修改
acl hostname src 192.168.1.0/24
http_access deny all
http_access allow localhost
http_access allow hostname
#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#限制允許連線範圍,請依自己學校狀況修改 111cn.net
service squid restart
NAT 與 Proxy :transparent proxy 加快網路傳輸
#Fedora core 7 新的 squid 版本 Transparent Proxy 設定簡化,整合到 http_port 的 option 內了。
vi /etc/squid/squid.conf
http_port 3128 transparent
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
service squid restart
--------------------------------------------
#Fodora Core 6 以前的版本 squid Transparent Proxy 設定在 squid 設定檔內加上如下四行
vi /etc/squid/squid.conf
httpd_accel_host ha.shsps.kh.edu.tw
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on