采用Squid 2.7 stable5版本,假定安装到E:\squid目录下。
1)下载软件,并解压缩到E:\squid;
2)修改E:\squid\etc\squid.conf文件,假定采用用户名/口令(ncsa_auth)认证,限制用户最多10个并发连接:
auth_param basic program e:/squid/libexec/ncsa_auth.exe e:/squid/etc/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server cill
auth_param basic casesensitive off
acl numconn maxconn 10
acl internet proxy_auth REQUIRED
http_access deny numconn internet
http_access allow internet
http_port 8080
cache_dir ufs e:/squid/var/cache 10000 16 256
access_log e:/squid/var/logs/access.log squid
logfile_daemon e:/squid/libexec/logfile-daemon.exe
cache_log e:/squid/var/logs/cache.log
cache_store_log e:/squid/var/logs/store.log
mime_table e:/squid/etc/mime.conf
pid_filename e:/squid/var/logs/squid.pid
diskd_program e:/squid/libexec/diskd-daemon.exe
unlinkd_program e:/squid/libexec/unlinkd.exe
icon_directory e:/squid/share/icons
error_directory e:/squid/share/errors/English
coredump_dir e:/squid/var/cache
3)创建目录
E:\squid\sbin>md e:\squid\var\cache
E:\squid\sbin>squid -z -f e:/squid/etc/squid.conf
4)安装并启动服务
E:\squid\sbin>squid.exe -i -f e:/squid/etc/squid.conf -n SquidCache
E:\squid\sbin>net start squidcache
5)使用htpasswd命令创建用户名和密码,并写入到E:\squid\etc\passwd文件中。