1. 程式人生 > >window7部署squid代理,並安裝成服務

window7部署squid代理,並安裝成服務

squid代理

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_object
acl all src all
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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
#http_access deny sex
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow CONNECT !SSL_ports
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all
htcp_access allow localnet
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
cache_dir ufs d:/var/cache 100 16 256
access_log d:/var/logs/access.log squid
cache_log d:/var/logs/cache.log
cache_store_log d:/var/logs/store.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320
cache_mgr [email protected]
cache_effective_user squid
cache_effective_group squid
visible_hostname syprox.monitor.greatwall.com.cn
icp_port 3130
coredump_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


本文出自 “走在路上的朋友” 博客,請務必保留此出處http://supan.blog.51cto.com/7405859/1950922

window7部署squid代理,並安裝成服務