|
首先下载squid for windows安装包 squid-2.7.STABLE5-bin.zip然后解压缩,放到C盘squid目录内.进入目录c:/squid/etc内,将所有文件的.default全部删掉编辑下squid.conf,将所有内容删掉,替换以下内容,并保存下面的配置文件,是可以加速一整台服务器的所有网站。acl all src 0.0.0.0/0.0.0.0acl all src 0.0.0.0/0.0.0.0cache_mem 1024 MBcache_dir ufs c:/squid/var/cache 30000 16 256http_access allow allhttp_port 80 vhostvisible_hostname MY_CDN_Host_Systemlogformat combined %{20%y%m%d %H:%M:%S}tl,%>a,%{host}>h,%<st,HTTP/%rv,%03Hs,%rm,%ru,%{Referer}>h,%{User-Agent}>h,%Ss:%Shacl localhost src 127.0.0.1acl purge method PURGEhttp_access allow purge localhosthttp_access deny purgeaccess_log c:/squid/var/logs/access.log combinedrefresh_pattern -i .php$ 1440 90% 129600 reload-into-imsrefresh_pattern -i .asp$ 1440 50% 2880 override-expire ignore-reload reload-into-imsrefresh_pattern -i .aspx$ 1440 50% 2880 override-expire ignore-reload reload-into-imscache_peer 8.8.8.8 parent 80 0 no-query originserver name=cdn1cache_peer_domain cdn1 .com .net .cn .cc .me .org .biz .top .mobi .asia .tw .gov.cn .com.cn .hk .pw .tv .info .so .travel .la .tel .co .net.cn .org.cn打开目录C:/squid/var新建两个目录,分别为cache和logs打开CMD,进入c:/squid/sbin目录,执行squid -i 将SQLUID写入服务项。初始化cache目录squid -z 如果配置文件出错的话,初始化cache目录将会出错。一定要关闭或禁用IIS。在服务里面运行squid。—–到这里,squid就搭建成功了! Squid相关的命令结束squid进程 /squid/sbin/squid –k shutdown取得squid运行状态信息:/squid/bin/squidclient -p 80 mgr:info取得squid内存使用情况:/squid/bin/squidclient -p 80 mgr:mem取得squid已经缓存的列表:/squid/bin/squidclient -p 80 mgrbjects. use it carefully,it may crash取得squid的磁盘使用情况:/squid/bin/squidclient -p 80 mgr:diskd强制更新某个url:/squid/bin/squidclient -p 80 -m PURGE http://www.hnhack.com/查命中率:/squid/bin/squidclient -h111.222.111.111 -p80 mgr:info/squid/bin/squidclient -h具体的IP -p80 mgr:info |
|
|