今次又是偷Justice同事的,呵呵
#!/bin/sh
# squid 2.6 安装脚本 v1.0
# 如果发现报错 configure: error: cannot compute sizeof (void *)
# 请把编译参数 --enable-cache-digests 去掉
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export LANG=zh_CN.GB18030
TarFile="squid-2.6.STABLE20-20080808.tar.gz"
Root=`dirname $0`
cd $Root
echo "Root: $Root"
if [ -z $1 ]; then
PREFIX="/usr/local/squid"
else
PREFIX="$1"
fi
echo "squid install prefix is: $PREFIX"
if [ -d $PREFIX ]; then
echo -n "Folder $PREFIX exist.Overwrite it?(y/n) "
read ORD
case $ORD in
y)
echo "Overwrite!"
;;
*)
echo "No overwrite.exit.pls run [$0 prefix] to install"
exit
esac
fi
if [ -e $TarFile ];then
tar xzf $TarFile && echo "Extract $TarFile done." || (echo "Extract $TarFile failed.";exit)
else
echo "$TarFile file not exist."
exit
fi
ExFolder=`tar tzvf $TarFile |head -n 1|awk '{ print $NF }'`
cd $ExFolder
uname -a|grep x86_64
if [ $? = 0 ];then
echo "Found 64bit LinuxOS set: ulimit -n 65535"
ulimit -n 65535
else
echo "64bit LinuxOS not found. ulimit -n 8192"
ulimit -n 8192
fi
./configure --prefix=$PREFIX --enable-storeio=coss,aufs,ufs,diskd,null --enable-default-err-language=Simplify_Chinese --enable-err-languages="Simplify_Chinese English" --disable-internal-dns --enable-async-io=40 --disable-icmp --disable-delay-pools --disable-mem-gen-trace --disable-useragent-log --enable-kill-parent-hack --disable-select --disable-arp-acl --disable-poll --enable-epoll --disable-ident-lookups --disable-wccp --disable-wccpv2 --disable-htcp --enable-snmp --enable-cache-digests --with-large-files --with-maxfd=65536 --disable-select --enable-removal-policies=lru,heap --disable-kqueue --enable-stacktraces
###
if [ $? -eq 0 ];then
make && make install && echo "squid install successfully.Pls cp the webcache to /etc/init.d"
else
echo "configure failed.exit"
exit
fi
#test -e /etc/init.d/webcache || cp $Root/webcache /etc/init.d/
cd $Root
#cp webcache_re* $PREFIX/bin/
阅读(1068) | 评论(0) | 转发(0) |