码迷,mamicode.com
首页 > Web开发 > 详细

centos6.2+nginx-1.2.3+php-5.3.17安装脚本

时间:2014-06-05 03:41:52      阅读:280      评论:0      收藏:0      [点我收藏+]

标签:nginx   php   

#!/bin/bash
#
# vm test install script
#
# create by xk
#
# data 2013-04-25
#
#
SOFTPATH=/home/tools
PROGRAMPATH=/export/servers

#Usage
show_usage() {
    echo "$0 {php|nginx|libmcrypt|all}"
}


if [ $# -ne ]; then
   show_usage
fi

#check dict
if [ !-d ${PEOGRAMPATH} ] ;then
   mkdir -p ${PEOGRAMPATH}
fi

cd ${SOFTPATH}
unzip vm_test.zip
cd software

#update package
yum install -y libxml2 libxl2-devel curl-devel mysql mysql-devel
ln -s /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so

nginx_fun() {
     tar xvf pcre-8.30.tar.bz2
     cd pcre-8.30
     ./configure
     make && make install
     cd ../
     tar xvf nginx-1.2.3.tar.gz
     cd nginx-1.2.3
     ./configure --prefix=${PROGRAMPATH}/nginx-1.2.3 \
     --with-pcre=../pcre-8.30
     make && make install
     cd ../
     #cp file
     cp nginx.conf  ${PROGRAMPATH}/nginx-1.2.3/conf/nginx.conf
     cp search.conf ${PROGRAMPATH}/nginx-1.2.3/conf/search.conf
     cp php-fpm.conf ${PROGRAMPATH}/php-5.3.17/etc/php-fpm.conf
     #mkdir data
     mkdir -p /export/data/www
     cp search.360buy.com.tar.gz /export/data/www
     cd /export/data/www && tar zxvf search.360buy.com.tar.gz
     #add user
     useradd www
     #star nginx php
     ${PROGRAMPATH}/php-5.3.17/sbin/php-fpm
     ${PROGRAMPATH}/nginx-1.2.3/sbin/nginx

}
libmcrypt_fun() {
     tar xvf libmcrypt-2.5.7.tar.gz
     cd libmcrypt-2.5.7
     ./configure prefix=${PROGRAMPATH}/libmcrypt
     make
     make install
     cd ../
}
# php install
php_fun() {
     #php install
     tar xvf php-5.3.17.tar.bz2
     cd php-5.3.17
     ./configure --prefix=${PROGRAMPATH}/php-5.3.17 \
     --with-config-file-path=${PROGRAMPATH}/php-5.3.17/etc \
     --enable-fpm \
     --with-fpm-user=www \
     --with-fpm-group=www \
     --enable-mbstring \
     --with-curl \
     --with-mcrypt=${PROGRAMPATH}/libmcrypt \
     --with-mysql=/usr/local/mysql \
     --with-mysqli=mysqlnd \
     --with-pdo-mysql=mysqlnd \
     --with-iconv
     make
     make install
     cd ../
     #eaccelerator
     #tar jxvf eaccelerator-0.9.6.1.tar.bz2
     #cd eaccelerator-0.9.6.1/
     #${PROGRAMPATH}/php-5.3.17/bin/phpize
     #./configure --enable-eaccelerator=shared --with-php-config=/export/servers/php-5.3.17/bin/php-config
     #make && make install
     #cd ../
     cp php.ini ${PROGRAMPATH}/php-5.3.17/etc/
     
}

case $1 in

     nginx)
     nginx_fun
     ;;

     php)
     php_fun
     ;;

     libmcrypt)
     libmcrypt_fun    
     ;;

     all)
     libmcrypt_fun
     php_fun
     nginx_fun
     ;;

     *)
     
     ;;
esac

centos6.2+nginx-1.2.3+php-5.3.17安装脚本,布布扣,bubuko.com

centos6.2+nginx-1.2.3+php-5.3.17安装脚本

标签:nginx   php   

原文地址:http://blog.csdn.net/xuekunyansukun/article/details/27212183

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!