1. 下载最新版本squid2.7 for windows
下载地址:http://squid.acmeconsulting.it/download/dl-squid.html
2. 解压到c:squid
进入到c:squidetc下更改以下文件名
squid.conf.default拷贝一份重新命名为squid.conf
cachemgr.conf.default拷贝一份重新命名为cachemgr.conf
mime.conf.default拷贝一份重新命名为mime.conf
3. 修改squid.conf,删除原有的配置信息直接复制下面的就可以
# squid 2.7
#
# 只提供对外反向代理,禁用了缓存功能。
# 使用默认端口80
# 访问规则默认为 "http_access deny all"
#
# by skyjing
#
#
# 本机IP : 172.18.85.146
# 要转向的外网服务器IP : 172.18.85.119
# 网关映射 : 内网80端口---本机80端口
# 基本acl
acl all src all
# 允许所有访问
http_access allow all
# 允许内网服务器到本机80端口的代理
#acl Safe_ports port 3128
#acl Safe_ports port 80
#acl Safe_ports port 80
#http_access allow Safe_ports
http_access allow all
# 防止被人利用为HTTP代理,设置允许访问的IP地址
#acl myip dst 172.18.85.0/32
#http_access deny !myip
# 允许本地管理
#acl manager proto cache_object
#http_access allow manager localhost
# Squid信息设置
visible_hostname qingyun
cache_mgr [email protected]
# 单台使用,使用该功能去掉#
#icp_port 0
# 禁止磁盘缓存
cache_dir null /tmp
# 禁止缓存本地web server
#acl localserver dst 172.18.85.0/32
no_cache deny all
# 监听服务器的80端口,透明代理
http_port 80 transparent
# web反向代理
# 这里填写你的外网服务器IP和对应的域名
# -----------------------------------------------------------------------------
cache_peer 172.18.85.119 parent 80 0 no-query originserver
4. 从命令行到c:squidsbin目录下执行
squid -i
注:squid -i -n dnt_squid (命名squid服务的新名称)
squid -r -n dnt_squid (删除指定名称的服务)
squid -z
安装完成
5.从服务里启动squid
或在cmd下: net start dnt_squid (启动), net stop dnt_squid (关闭)
访问squid服务器:http://172.18.85.146