1.下载软件
http://squid.acmeconsulting.it/
也可以使用附件中的文件,该配置使用squid-2.7.STABLE8版本
2.解压缩
解压到C盘,命名为squid
3.在D盘创建var\cache,和var\logs目录
4.进入c:\squid\etc
4.1拷贝squid.conf.default为squid.conf
4.2拷贝mime.conf.default为mime.conf
4.3拷贝cachemgr.conf.default为cachemgr.conf
5.修改squid.conf
acl manager proto cache_objectacl all src allacl localhost src 127.0.0.1/32acl to_localhost dst 127.0.0.0/8 0.0.0.0/32acl localnet src 10.0.0.0/8 # RFC1918 possible internal networkacl localnet src 172.16.0.0/12 # RFC1918 possible internal networkacl localnet src 192.168.0.0/16 # RFC1918 possible internal networkacl SSL_ports port 443acl Safe_ports port 80 # httpacl Safe_ports port 21 # ftpacl Safe_ports port 443 # httpsacl Safe_ports port 70 # gopheracl Safe_ports port 210 # waisacl Safe_ports port 1025-65535 # unregistered portsacl Safe_ports port 280 # http-mgmtacl Safe_ports port 488 # gss-httpacl Safe_ports port 591 # filemakeracl Safe_ports port 777 # multiling httpacl CONNECT method CONNECT#http_access deny sexhttp_access allow manager localhosthttp_access deny managerhttp_access deny !Safe_portshttp_access allow CONNECT !SSL_portshttp_access allow localnethttp_access deny allicp_access allow localneticp_access deny allhtcp_access allow localnethtcp_access deny allhttp_port 3128hierarchy_stoplist cgi-bin ?cache_dir ufs d:/var/cache 100 16 256access_log d:/var/logs/access.log squidcache_log d:/var/logs/cache.logcache_store_log d:/var/logs/store.logrefresh_pattern ^ftp: 1440 20% 10080refresh_pattern ^gopher: 1440 0% 1440refresh_pattern (cgi-bin|\?) 0 0% 0refresh_pattern . 0 20% 4320cache_mgr [email protected]cache_effective_user squidcache_effective_group squidvisible_hostname syprox.monitor.greatwall.com.cnicp_port 3130coredump_dir d:/var/cache
6.初始化缓存目录
C:\squid\sbin\squid.exe -z
会在D:\cache下面发现16个目录
7.将squid做成windows服务
以管理员身份运行cmd
C:\squid\sbin\squid.exe -i -n squid_proxy 服务名字为squid_proxy
8.在浏览器设置代理,端口3128
时间: 2024-10-06 08:59:39