squid源码安装、使用、优化、实例
#社博论
http://www.codesky.net/article/200805/119557.html
#3.5版本yum默认安装的配置文件如下:
‘–build=x86_64-redhat-linux-gnu’
‘–host=x86_64-redhat-linux-gnu’
‘–target=x86_64-redhat-linux-gnu’
‘–program-prefix=’
‘–prefix=/usr’
‘–exec-prefix=/usr’
‘–bindir=/usr/bin’
‘–sbindir=/usr/sbin’
‘–sysconfdir=/etc’
‘–datadir=/usr/share’
‘–includedir=/usr/include’
‘–libdir=/usr/lib64’
‘–libexecdir=/usr/libexec’
‘–sharedstatedir=/var/lib’
‘–mandir=/usr/share/man’
‘–infodir=/usr/share/info’
‘–verbose’ ‘–exec_prefix=/usr’
‘–libexecdir=/usr/lib64/squid’
‘–localstatedir=/var’
‘–datadir=/usr/share/squid’
‘–sysconfdir=/etc/squid’
‘–with-logdir=$(localstatedir)/log/squid’
‘–with-pidfile=$(localstatedir)/run/squid.pid’
‘–disable-dependency-tracking’
‘–enable-follow-x-forwarded-for’
‘–enable-auth’
‘–enable-auth-basic=DB,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB,getpwnam’
‘–enable-auth-ntlm=smb_lm,fake’
‘–enable-auth-digest=file,LDAP’
‘–enable-auth-negotiate=kerberos,wrapper’
‘–enable-external-acl-helpers=wbinfo_group,kerberos_ldap_group’
‘–enable-cache-digests’
‘–enable-cachemgr-hostname=localhost’
‘–enable-delay-pools’
‘–enable-epoll’
‘–enable-icap-client’
‘–enable-ident-lookups’
‘–enable-linux-netfilter’
‘–enable-removal-policies=heap,lru’
‘–enable-snmp’
‘–enable-storeio=aufs,diskd,ufs,rock’
‘–enable-wccpv2’
‘–enable-esi’
‘–enable-ssl-crtd’
‘–enable-icmp’
‘–with-aio’
‘–with-default-user=squid’
‘–with-filedescriptors=16384’
‘–with-dl’
‘–with-openssl’
‘–with-pthreads’
‘–with-included-ltdl’
‘–disable-arch-native’
‘–without-nettle’
‘build_alias=x86_64-redhat-linux-gnu’
‘host_alias=x86_64-redhat-linux-gnu’
‘target_alias=x86_64-redhat-linux-gnu’
‘CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic’
‘CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC’
‘PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig’ –enable-ltdl-convenience
#源码安装:
#编译设置:
#安装依赖
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel cURL cURL-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel
#编译配置:
./configure –prefix=/usr/local/squid3.0 \
–enable-async-io=100 \
–with-pthreads \
–enable-storeio=”aufs,diskd,ufs” \
–enable-removal-polioies=”heap,lru” \
–enable-icmp \
–enable-delay-pools \
–enable-useragent-log \
–enable-referer-log \
–enable-kill-parent-hack \
–enable-cachemgr-hostname=localhost \
–enable-arp-acl \
–enable-default-err-language=English \
–enable-err-languages=”Simplify_Chinese English” \
–disable-poll \
–disable-wccp \
–disable-wccpv2 \
–disable-ident-lookups \
–disable-internal-dns \
–enable-basic-auth-helpers=”NCSA” \
–enable-stacktrace \
–with-filedscriptors=64000 \
–enable-ssl \
–enable-x-accelerator-vary \
–disable-snmp \
–with-aio
————–以下为选择项————————
–enable-linux-netfilter \
–enable-linux-tproxy \
#内核配置
options MSGMNB=8192 # max # of bytes in a queue
options MSGMNI=40 # number of message queue identifiers
options MSGSEG=512 # number of message segments per queue
options MSGSSZ=64 # size of a message segment
options MSGTQL=2048 # max messages in system
options SHMSEG=16
options SHMMNI=32
options SHMMAX=2097152
options SHMALL=4096
options MAXFILES=16384