官网下载的windows版本,默认是要放c:\squid中,如果需要改默认路径的话,需要etc\squid.conf文件中至少增加如下配置
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs G:/apps/squid2/var/cache/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir G:/apps/squid2/var/cache/squid
mime_table G:/apps/squid2/etc/mime.conf
logformat squid %tl %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
logfile_daemon G:/apps/squid2/libexec/logfile-daemon.exe
diskd_program G:/apps/squid2/libexec/diskd-daemon.exe
unlinkd_program G:/apps/squid2/libexec/unlinkd.exe
#pinger_program G:/apps/squid2/libexec/pinger.exe
#cache_dns_program G:/apps/squid2/libexec/dnsserver.exe
icon_directory G:/apps/squid2/share/icons
error_directory G:/apps/squid2/share/errors/English
cache_log G:/apps/squid2/var/logs/cache.log
cache_store_log G:/apps/squid2/var/logs/store.log
access_log G:/apps/squid2/var/logs/access.log squid
首次运行的时候需要手工创建cache目录
mkdir G:\apps\squid2\var\cache\squid
执行
squid.exe -f G:/apps/squid2/etc/squid.conf -z
然后执行squid.exe -f G:/apps/squid2/etc/squid.conf -i 安装windows服务,安装的时候需要使用管理员命令行窗口,否则无法安装
然后就可以使用net start squid来启动了