使用当前最新的稳定版本squid-2.6.STABLE9
配置选项
./configure --prefix=/usr/local/squid \
--enable-poll \
--enable-snmp \
--enable-removal-policies="heap,lru" \
--enable-storeio="aufs,coss,diskd,null,ufs" \
--enable-ssl \
--enable-delay-pools \
--enable-linux-netfilter \
--enable-useragent-log \
--enable-referer-log \
--enable-truncate \
--enable-underscores \
--enable-basic-auth-helpers="NCSA" \
--enable-err-language="Simplify_Chinese" \
--enable-default-err-language="Simplify_Chinese" \
--enable-stacktrace \
--enable-auth="basic" \
--disable-dependency-tracking \
--disable-internal-dns \
--with-openssl=/usr/kerberos \
--with-pthreads \
--with-winbind-auth-challenge
配置文件
# NETWORK OPTIONS
# -----------------------------------------------------------------------------
http_port 192.168.0.1:80 vhost vport
icp_port 0
cache_peer 192.168.0.1 parent 81 0 no-query originserver
# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM
# -----------------------------------------------------------------------------
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl IMAGE urlpath_regex images
cache deny !IMAGE
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# OPTIONS WHICH AFFECT THE CACHE SIZE
# -----------------------------------------------------------------------------
cache_mem 512 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 80 KB
# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# -----------------------------------------------------------------------------
cache_dir ufs /usr/local/squid/var/cache 1024 56 256
access_log /usr/local/squid/var/logs/access.log squid
cache_log /usr/local/squid/var/logs/cache.log
#cache_store_log /usr/local/squid/var/logs/store.log
emulate_httpd_log on
pid_filename /usr/local/squid/var/logs/squid.pid
# ACCESS CONTROLS
# -----------------------------------------------------------------------------
acl all src 0.0.0.0/0.0.0.0
acl example dstdomain .example.org.cn
acl Safe_ports port 80 # http
acl Safe_ports port 81 # http
http_access allow example
http_access deny !Safe_ports
http_access deny all
http_reply_access allow all
icp_access deny all
# ADMINISTRATIVE PARAMETERS
# -----------------------------------------------------------------------------
cache_mgr david.chenfuwei@gmail.com
cache_effective_user squid
cache_effective_group squid
visible_hostname www.example.org.cn
# MISCELLANEOUS
# -----------------------------------------------------------------------------
logfile_rotate 0
tcp_recv_bufsize 65535 bytes
error_directory /usr/local/squid/share/errors/Simplify_Chinese
# DELAY POOL PARAMETERS (all require DELAY_POOLS compilation option)
# -----------------------------------------------------------------------------
coredump_dir /usr/local/squid/var/cache
client_persistent_connections off
server_persistent_connections on