#===================================== 安装LTP =======================================
#下载LTP:
cd $SoftDir && wget -q
#解压
tar jxf ltp-full-20150420.tar.bz2
#配置编译参数:
cd ./ltp-full-20150420 && ./configure >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#===================================== 安装openssl1.0.2 =======================================
#下载openssl:
cd $SoftDir && wget -q
#解压:
tar zxf openssl-1.0.2.tar.gz
#进入解压目录,配置编译参数:
cd ./openssl-1.0.2 && ./config >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#===================================== 安装curl-7.45.0 =======================================
#下载:
cd $SoftDir && wget -q
#解压:
tar zxf curl-7.45.0.tar.gz
#进入解压目录,配置编译参数:
cd ./curl-7.45.0 && ./configure >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#===================================== 安装libmcrypt-2.5.8 ==================================
#下载:
cd $SoftDir && wget -q
#解压:
tar zxf libmcrypt-2.5.8.tar.gz
#进入解压目录,配置编译参数:
cd ./libmcrypt-2.5.8 && ./configure >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#======================================= 安装PHP 5.5.22 ====================================
#下载PHP 5.5.22
cd $SoftDir && wget -q
#解压PHP:
tar zxf php-5.5.30.tar.gz
#添加php-fpm 用户,不允许登陆系统
useradd -s /sbin/nologin php-fpm
#进入PHP解压目录,配置编译参数:
cd ./php-5.5.30 && ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl --with-openssl --with-mysqli --enable-mysqlnd --with-gettext >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#复制Php 主配置:
\cp php.ini-production /usr/local/php/etc/php.ini
#创建php-fpm 主配置文件:
cat <<EOF > /usr/local/php/etc/php-fpm.conf
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
[www]
listen = 127.0.0.1:9000
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
EOF
#测试php-fpm 配置:
/usr/local/php/sbin/php-fpm -t
if [ `echo $?` -eq 0 ];then
echo "php-fpm installed successfully"
else
exit
fi
#拷贝php-fpm 启动脚本:
\cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
#赋予脚本可执行权限:
chmod 755 /etc/init.d/php-fpm
#关闭php 版本信息:
sed -i 's/expose_php = On/expose_php = Off/g' /usr/local/php/etc/php.ini
#将php-fpm 写入随机启动:
chkconfig --add php-fpm && chkconfig php-fpm on
#启动php-fpm
service php-fpm start
#======================================= 安装pcre2-10.00 ====================================
#下载
cd $SoftDir && wget -q
#解压:
tar zxf pcre-8.37.tar.gz
#接入pcre,配置编译参数:
cd ./pcre-8.37 && ./configure >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS
#======================================= 添加libmaxminddb ====================================
#下载:
cd $SoftDir && wget -q
#解压:
tar zxf libmaxminddb-1.1.1.tar.gz
cd ./libmaxminddb-1.1.1 && ./configure >> $LOG_INS 2>&1
#编译及安装
MAKE && MAKE_INS