测试环境:RedHat Linux Enterprise 5 + LAN
最简单配置(任意局域网用户都可以连接):
--------------------------------------------------
http_port 服务器IP:8080
cache_mem 64 MB
cache_dir ufs /var/spool/squid 4096 16 256
cache_effective_user squid
cache_effective_group squid
dns_nameservers DNS服务器IP
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
visible_hostname 服务器IP
cache_mgr 管理员邮箱地址
acl all src 0.0.0.0/0.0.0.0
http_access allow all
--------------------------------------------------
透明代理配置:
1.添加以下配置命令
--------------------------------------------------
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
--------------------------------------------------
2.用 iptables 实现端口转接
用户口令配置:
1.添加以下配置命令
--------------------------------------------------
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic credentialsttl 2 hours
auth_param basic realm Example.com's Squid proxy-caching
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
--------------------------------------------------
2.用Apache工具生成用户口令/密码文件