安装编译squid2.5stable14的脚本

工作需要,接触了些squid的东西

以下的安装、编译方式适用于反向加速模式

ulimit -HSn 65536

这里是增大file descriptors(缺省是1024,太小了)

export CFLAGS=’-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mcpu=pentium4 -march=pentium4 -mmmx -msse -msse2′

export这个环境变量是为了在make的时候

1,打开大文件支持(支持存取>2G的文件);

2,针对p4的cpu做优化

./configure –prefix=/usr/local/squid \

–enable-useragent-log \

–enable-referer-log \

–enable-storeio=’diskd, ufs, aufs’ \

–enable-poll \

–enable-removal-policies=heap,lru \

–disable-ssl \

–enable-delay-pools \

–with-pthreads \

–disable-dependency-tracking \

–enable-cachemgr-hostname=localhost \

–disable-ident-lookups \

–enable-truncate \

–enable-underscores \

–enable-gnuregex \

–enable-dlmalloc \

–enable-async-io=240 \

–enable-cahce-digests

make;make install

strip /usr/local/squid/sbin/squid

安装完毕

初始化cache目录(如果是没有初始化过的需要先初始化)

/usr/local/squid/sbin/squid -z

启动:

ulimit -HSn 65536;/usr/local/squid/sbin/squid -D

One Response to “安装编译squid2.5stable14的脚本”

  1. 其实前面export CFLAGS的用来加上大文件支持的工作可以不做
    因为configure的时候有个参数“–with-large-files”可以做同样的事情

Discussion Area - Leave a Comment




*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word