Chinaunix首页 | 论坛 | 博客
  • 博客访问: 814467
  • 博文数量: 167
  • 博客积分: 7173
  • 博客等级: 少将
  • 技术积分: 1671
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-04 23:07
文章分类

全部博文(167)

文章存档

2018年(1)

2017年(11)

2012年(2)

2011年(27)

2010年(88)

2009年(38)

分类:

2010-07-02 18:31:18

今次又是偷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/

阅读(1033) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~