免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1061 | 回复: 0
打印 上一主题 下一主题

debian手动安装lighttpd及php5的脚本 [复制链接]

论坛徽章:
4
ChinaUnix专家徽章
日期:2015-07-27 10:05:26IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2016-07-29 06:20:00PHP
日期:2016-10-25 16:08:01
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-06 16:23 |只看该作者 |倒序浏览
#! /bin/sh
#这是手动安装lighttpd及php5的脚本
support(){
SUPPORT="gcc g++ gcc-3.4 g++-3.4 libc6-dev libaio1 libbz2-dev libaio-dev bzip2 ntpdate make gawk libncurses5-dev libpcre3-dev openssl libxml2-dev libssl-dev libjpeg62-dev libpng12-dev libmysqlclient15off libmysqlclient15-dev libfreetype6-dev libmcrypt-dev axel";
for pkgs in ${SUPPORT};
      do
        pkg_status=`dpkg -l|grep ${pkgs}|awk '$2~/'^${pkgs}$'/{print $2}'`;
        if [ "${pkg_status}" != "${pkgs}" ]; then
            apt-get install ${pkgs}
        fi
    done;
}
lighttpd(){
echo "please select a path where you want to install! eg. /opt/moudules/lighttpd!"
read path
LITPATH=$path ;
if [ ! -d "/opt" ]; then
        mkdir /opt
    fi
if [ ! -d "/opt/distfiles" ]; then
        mkdir /opt/distfiles
    fi
cd /opt/distfiles
axel -10
http://www.lighttpd.net/download/lighttpd-1.4.20.tar.gz
tar zxvf lighttpd-1.4.20.tar.gz
cd lighttpd-1.4.20
export CFLAGS="-O3 -fomit-frame-pointer"
export CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
./configure --prefix=$LITPATH --enable-static --without-mysql --without-ldap --with-openssl --with-linux-aio
make && make install
    if [ "$?" != "0" ]; then
        echo "configure lighttpd ERROR!";
        echo "SKIP lighttpd install...";
        return 1;
    fi
}
phpcgi(){
echo  "please select a path where you want to install! eg. /opt/moudules/phpcgi!"
read path
PHPPATH=$path
if [ ! -d "/opt" ]; then
        mkdir /opt
    fi
if [ ! -d "/opt/distfiles" ]; then
        mkdir /opt/distfiles
    fi
cd /opt/distfiles
axel -10
http://cn2.php.net/distributions/php-5.2.6.tar.gz
tar zxvf php-5.2.6.tar.gz
cd php-5.2.6
export CFLAGS="-O3 -fomit-frame-pointer"
export CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
./configure \
--prefix="$PHPPATH" \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-bcmath \
--enable-inline-optimization \
--enable-magic-quotes \
--enable-sockets \
--enable-mbstring \
--enable-sqlite-utf8 \
--enable-safe-mode \
--enable-gd-native-ttf \
--enable-ftp \
--disable-debug \
--with-mcrypt \
--with-openssl \
--with-mysql=/opt/modules/mysql5 \
--with-pdo-mysql=/opt/modules/mysql5 \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--with-jpeg-dir \
--with-gd \
--with-ttf \
--with-iconv-dir \
--with-zlib-dir \
--with-openssl \
--enable-soap \
--enable-pdo
make && make install
    if [ "$?" != "0" ]; then
        echo "configure lighttpd ERROR!";
        echo "SKIP lighttpd install...";
        return 1;
    fi
}
read -p "Enter a number: " opmode
if [ "$opmode" = "" ] ; then
    continue;
fi
echo
if [ "$opmode" != "q" ] ; then
    echo "Your input number is : $opmode";
    read -p "Are you sure to continue?[y/n]: " opsure ;
    if [ "${opsure}" != "y" ] ; then
        opmode="0";
    fi
else
    read -p "Are you sure to exit this script?[y/n]: " opsure ;
    if [ "${opsure}" != "y" ] ; then
        continue;
    else
        exit 0;
    fi
fi
case ${opmode} in
1)
   delftpuser;
    ;;
2)
   delftpuserdata;
    ;;
q)
    exit 0;
    ;;
esac
done
}
while : ; do
echo "1) lighttpd install"
echo "2) php install "
echo "3) source "
echo "q) Exit this tool"
echo
read -p "Enter a number: " opmode
if [ "$opmode" = "" ] ; then
    continue;
fi
echo
if [ "$opmode" != "q" ] ; then
    echo "Your input number is : $opmode";
    read -p "Are you sure to continue?[y/n]: " opsure ;
    if [ "${opsure}" != "y" ] ; then
        opmode="0";
    fi
else
    read -p "Are you sure to exit this script?[y/n]: " opsure;
    if [ "${opsure}" != "y" ] ; then
        continue;
    else
        exit 0;
    fi
fi
case ${opmode} in
1)
    lighttpd;
    ;;
2)
    phpcgi ;
    ;;
3)
  support ;
   ;;
q)
    exit 0;
    ;;
esac
done

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/88527/showart_1777693.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP