Centos下Proxy代理服务器配置
安装套件
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