Browse Source

Add --with-config-file-scan-dir

lj2007331 9 years ago
parent
commit
48c95ca596

+ 7 - 7
apps.conf

@@ -1,6 +1,6 @@
 # newest software version
 # Web
-nginx_version=1.9.12
+nginx_version=1.9.14
 tengine_version=2.1.1
 
 tomcat_7_version=7.0.68
@@ -17,7 +17,7 @@ mysql_5_7_version=5.7.11
 mysql_5_6_version=5.6.29
 mysql_5_5_version=5.5.48
 
-mariadb_10_1_version=10.1.12
+mariadb_10_1_version=10.1.13
 mariadb_10_0_version=10.0.24
 mariadb_5_5_version=5.5.48
 
@@ -28,14 +28,14 @@ percona_5_5_version=5.5.48-37.8
 # JDK
 jdk_6_version=1.6.0_45
 jdk_7_version=1.7.0_80
-jdk_8_version=1.8.0_74
+jdk_8_version=1.8.0_77
 
 # PHP
 php_3_version=5.3.29
 php_4_version=5.4.45
-php_5_version=5.5.33
-php_6_version=5.6.19
-php_7_version=7.0.4
+php_5_version=5.5.34
+php_6_version=5.6.20
+php_7_version=7.0.5
 
 zendopcache_version=7.0.5
 xcache_version=3.2.0
@@ -69,4 +69,4 @@ phpMyAdmin_version=4.4.15.5
 jemalloc_version=4.1.0
 
 # tcmalloc
-tcmalloc_version=2.4.90
+tcmalloc_version=2.5

+ 3 - 5
config/index.html

@@ -1,12 +1,11 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>OneinStack - A PHP/JAVA Deployment Tool</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta name="keywords" content="OneinStack,lemp Stack,lamp Stack,lnmp stack">
-<meta name="description" content="OneinStack is a LEMP, LAMP stack of Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA. It's quite simple to use, manage and extend.">
+<meta name="keywords" content="OneinStack,lemp Stack,lamp Stack,lnmp stack" />
+<meta name="description" content="OneinStack is a LEMP, LAMP stack of Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA. It's quite simple to use, manage and extend." />
 <style type="text/css">
-<!--
 body {
 color:#333333;
 font-family:"Microsoft YaHei",sans-serif;
@@ -17,7 +16,6 @@ font-family:"Microsoft YaHei",sans-serif;
 	margin-left: auto;
 	width: 920px;
 }
--->
 </style>
 </head>
 <body>

+ 3 - 5
config/index_cn.html

@@ -1,12 +1,11 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>OneinStack - PHP/JAVA环境一键部署工具</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta name="keywords" content="OneinStack,LAMP Stack,LNMP Stack,lnmpa stack">
-<meta name="description" content="OneinStack是PHP/JAVA环境一键部署工具, 包括Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA.">
+<meta name="keywords" content="OneinStack,LAMP Stack,LNMP Stack,lnmpa stack" />
+<meta name="description" content="OneinStack是PHP/JAVA环境一键部署工具, 包括Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA." />
 <style type="text/css">
-<!--
 body {
 color:#333333;
 font-family:微软雅黑,sans-serif;
@@ -17,7 +16,6 @@ font-family:微软雅黑,sans-serif;
 	margin-left: auto;
 	width: 920px;
 }
--->
 </style>
 </head>
 <body>

+ 7 - 5
include/GraphicsMagick.sh

@@ -25,9 +25,9 @@ Install_php-gmagick() {
 cd $oneinstack_dir/src
 if [ -e "$php_install_dir/bin/phpize" ];then
     if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        src_url=https://pecl.php.net/get/gmagick-2.0.2RC1.tgz && Download_src
-        tar xzf gmagick-2.0.2RC1.tgz 
-        cd gmagick-2.0.2RC1
+        src_url=https://pecl.php.net/get/gmagick-2.0.2RC2.tgz && Download_src
+        tar xzf gmagick-2.0.2RC2.tgz 
+        cd gmagick-2.0.2RC2
     else
         src_url=http://pecl.php.net/get/gmagick-$gmagick_version.tgz && Download_src
         tar xzf gmagick-$gmagick_version.tgz 
@@ -42,8 +42,10 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     rm -rf gmagick-$gmagick_version
 
     if [ -f "`$php_install_dir/bin/php-config --extension-dir`/gmagick.so" ];then
-        [ -z "`grep '^extension_dir' $php_install_dir/etc/php.ini`" ] && sed -i "s@extension_dir = \"ext\"@extension_dir = \"ext\"\nextension_dir = \"`$php_install_dir/bin/php-config --extension-dir`\"@" $php_install_dir/etc/php.ini
-        sed -i 's@^extension_dir\(.*\)@extension_dir\1\nextension = "gmagick.so"@' $php_install_dir/etc/php.ini
+        cat > $php_install_dir/etc/php.d/ext-gmagick.ini << EOF
+[gmagick]
+extension=gmagick.so
+EOF
         [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
     else
         echo "${CFAILURE}PHP Gmagick module install failed, Please contact the author! ${CEND}"

+ 4 - 2
include/ImageMagick.sh

@@ -42,8 +42,10 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     rm -rf imagick-$imagick_version
 
     if [ -f "`$php_install_dir/bin/php-config --extension-dir`/imagick.so" ];then
-        [ -z "`grep '^extension_dir' $php_install_dir/etc/php.ini`" ] && sed -i "s@extension_dir = \"ext\"@extension_dir = \"ext\"\nextension_dir = \"`$php_install_dir/bin/php-config --extension-dir`\"@" $php_install_dir/etc/php.ini
-        sed -i 's@^extension_dir\(.*\)@extension_dir\1\nextension = "imagick.so"@' $php_install_dir/etc/php.ini
+        cat > $php_install_dir/etc/php.d/ext-imagick.ini << EOF
+[imagick]
+extension=imagick.so
+EOF
         [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
     else
         echo "${CFAILURE}PHP imagick module install failed, Please contact the author! ${CEND}"

+ 2 - 2
include/ZendGuardLoader.sh

@@ -75,9 +75,9 @@ else
 fi
 
 if [ -f "`$php_install_dir/bin/php-config --extension-dir`/ZendGuardLoader.so" ];then
-    cat >> $php_install_dir/etc/php.ini << EOF
+    cat > $php_install_dir/etc/php.d/ext-zendGuardLoader.ini << EOF
 [Zend Guard Loader]
-zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ZendGuardLoader.so"
+zend_extension=`$php_install_dir/bin/php-config --extension-dir`/ZendGuardLoader.so
 zend_loader.enable=1
 zend_loader.disable_licensing=0
 zend_loader.obfuscation_level_support=3

+ 3 - 2
include/apcu.sh

@@ -19,8 +19,9 @@ $php_install_dir/bin/phpize
 ./configure --with-php-config=$php_install_dir/bin/php-config
 make && make install
 if [ -f "`$php_install_dir/bin/php-config --extension-dir`/apcu.so" ];then
-    cat >> $php_install_dir/etc/php.ini << EOF
-extension = apcu.so
+    cat > $php_install_dir/etc/php.d/ext-apcu.ini << EOF
+[apcu]
+extension=apcu.so
 apc.enabled=1
 apc.shm_size=32M
 apc.ttl=7200

+ 18 - 18
include/eaccelerator-0.9.sh

@@ -21,25 +21,25 @@ make && make install
 
 if [ -f "`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so" ];then
     mkdir /var/eaccelerator_cache;chown -R ${run_user}.$run_user /var/eaccelerator_cache
-    cat >> $php_install_dir/etc/php.ini << EOF
+    cat > $php_install_dir/etc/php.d/ext-eaccelerator.ini << EOF
 [eaccelerator]
-zend_extension="`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so"
-eaccelerator.shm_size="64"
-eaccelerator.cache_dir="/var/eaccelerator_cache"
-eaccelerator.enable="1"
-eaccelerator.optimizer="1"
-eaccelerator.check_mtime="1"
-eaccelerator.debug="0"
-eaccelerator.filter=""
-eaccelerator.shm_max="0"
-eaccelerator.shm_ttl="0"
-eaccelerator.shm_prune_period="0"
-eaccelerator.shm_only="0"
-eaccelerator.compress="0"
-eaccelerator.compress_level="9"
-eaccelerator.keys = "disk_only"
-eaccelerator.sessions = "disk_only"
-eaccelerator.content = "disk_only"
+zend_extension=`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so
+eaccelerator.shm_size=64
+eaccelerator.cache_dir=/var/eaccelerator_cache
+eaccelerator.enable=1
+eaccelerator.optimizer=1
+eaccelerator.check_mtime=1
+eaccelerator.debug=0
+eaccelerator.filter=
+eaccelerator.shm_max=0
+eaccelerator.shm_ttl=0
+eaccelerator.shm_prune_period=0
+eaccelerator.shm_only=0
+eaccelerator.compress=0
+eaccelerator.compress_level=9
+eaccelerator.keys=disk_only
+eaccelerator.sessions=disk_only
+eaccelerator.content=disk_only
 EOF
     echo "${CSUCCESS}Accelerator module install successfully! ${CEND}"
     cd ..

+ 18 - 18
include/eaccelerator-1.0-dev.sh

@@ -21,25 +21,25 @@ $php_install_dir/bin/phpize
 make && make install
 if [ -f "`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so" ];then
     mkdir /var/eaccelerator_cache;chown -R ${run_user}.$run_user /var/eaccelerator_cache
-    cat >> $php_install_dir/etc/php.ini << EOF
+    cat > $php_install_dir/etc/php.d/ext-eaccelerator.ini << EOF
 [eaccelerator]
-zend_extension="`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so"
-eaccelerator.shm_size="64"
-eaccelerator.cache_dir="/var/eaccelerator_cache"
-eaccelerator.enable="1"
-eaccelerator.optimizer="1"
-eaccelerator.check_mtime="1"
-eaccelerator.debug="0"
-eaccelerator.filter=""
-eaccelerator.shm_max="0"
-eaccelerator.shm_ttl="0"
-eaccelerator.shm_prune_period="0"
-eaccelerator.shm_only="0"
-eaccelerator.compress="0"
-eaccelerator.compress_level="9"
-eaccelerator.keys = "disk_only"
-eaccelerator.sessions = "disk_only"
-eaccelerator.content = "disk_only"
+zend_extension=`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so
+eaccelerator.shm_size=64
+eaccelerator.cache_dir=/var/eaccelerator_cache
+eaccelerator.enable=1
+eaccelerator.optimizer=1
+eaccelerator.check_mtime=1
+eaccelerator.debug=0
+eaccelerator.filter=
+eaccelerator.shm_max=0
+eaccelerator.shm_ttl=0
+eaccelerator.shm_prune_period=0
+eaccelerator.shm_only=0
+eaccelerator.compress=0
+eaccelerator.compress_level=9
+eaccelerator.keys=disk_only
+eaccelerator.sessions=disk_only
+eaccelerator.content=disk_only
 EOF
     echo "${CSUCCESS}Accelerator module install successfully! ${CEND}"
     cd ..

+ 9 - 1
include/init_CentOS.sh

@@ -101,7 +101,7 @@ net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
 net.ipv4.tcp_max_syn_backlog = 65536 
-net.ipv4.tcp_max_tw_buckets = 20000
+net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
@@ -120,8 +120,16 @@ elif [ "$CentOS_RHEL_version" == '6' ];then
     sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES=/dev/tty[1-2]@' /etc/sysconfig/init	
     sed -i 's@^start@#start@' /etc/init/control-alt-delete.conf
     sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/sysconfig/i18n
+    [ -z "`grep net.netfilter.nf_conntrack_max /etc/sysctl.conf`" ] && cat >> /etc/sysctl.conf << EOF
+net.netfilter.nf_conntrack_max = 1048576 
+net.netfilter.nf_conntrack_tcp_timeout_established = 1200
+EOF
 elif [ "$CentOS_RHEL_version" == '7' ];then
     sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/locale.conf 
+    [ -z "`grep net.netfilter.nf_conntrack_max /etc/sysctl.conf`" ] && cat >> /etc/sysctl.conf << EOF
+net.netfilter.nf_conntrack_max = 1048576 
+net.netfilter.nf_conntrack_tcp_timeout_established = 1200
+EOF
 fi
 init q
 

+ 6 - 2
include/init_Debian.sh

@@ -72,7 +72,7 @@ net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
 net.ipv4.tcp_max_syn_backlog = 65536 
-net.ipv4.tcp_max_tw_buckets = 20000
+net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
@@ -129,7 +129,11 @@ fi
 FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules` 
 [ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules 
 iptables-restore < /etc/iptables.up.rules
-echo 'pre-up iptables-restore < /etc/iptables.up.rules' >> /etc/network/interfaces
+cat > /etc/network/if-pre-up.d/iptables << EOF
+#!/bin/bash
+/sbin/iptables-restore < /etc/iptables.up.rules
+EOF
+chmod +x /etc/network/if-pre-up.d/iptables
 service ssh restart
 
 . ~/.bashrc

+ 6 - 2
include/init_Ubuntu.sh

@@ -91,7 +91,7 @@ net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_tw_recycle = 1
 net.ipv4.ip_local_port_range = 1024 65000
 net.ipv4.tcp_max_syn_backlog = 65536 
-net.ipv4.tcp_max_tw_buckets = 20000
+net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
@@ -147,7 +147,11 @@ fi
 FW_PORT_FLAG=`grep -ow "dport $SSH_PORT" /etc/iptables.up.rules` 
 [ -z "$FW_PORT_FLAG" -a "$SSH_PORT" != '22' ] && sed -i "s@dport 22 -j ACCEPT@&\n-A INPUT -p tcp -m state --state NEW -m tcp --dport $SSH_PORT -j ACCEPT@" /etc/iptables.up.rules 
 iptables-restore < /etc/iptables.up.rules
-echo 'pre-up iptables-restore < /etc/iptables.up.rules' >> /etc/network/interfaces
+cat > /etc/network/if-pre-up.d/iptables << EOF
+#!/bin/bash
+/sbin/iptables-restore < /etc/iptables.up.rules
+EOF
+chmod +x /etc/network/if-pre-up.d/iptables
 service ssh restart
 
 . ~/.bashrc

+ 2 - 6
include/ioncube.sh

@@ -40,14 +40,10 @@ else
 fi
 
 rm -rf ioncube
-if [ -n "`grep '^\[opcache\]' $php_install_dir/etc/php.ini`" -a -z "`grep '^\[ionCube Loader\]' $php_install_dir/etc/php.ini`" ];then
-    sed -i "s@^\[opcache\]@[ionCube Loader]\nzend_extension=\"$zend_extension\"\n[opcache]@" $php_install_dir/etc/php.ini
-elif [ -z "`grep '^\[ionCube Loader\]' $php_install_dir/etc/php.ini`" ];then
-    cat >> $php_install_dir/etc/php.ini << EOF
+cat > $php_install_dir/etc/php.d/ext-ioncube.ini << EOF
 [ionCube Loader]
-zend_extension="$zend_extension"
+zend_extension=$zend_extension
 EOF
-fi
 [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
 cd ..
 }

+ 7 - 4
include/memcached.sh

@@ -60,8 +60,9 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     ./configure --with-php-config=$php_install_dir/bin/php-config
     make && make install
     if [ -f "`$php_install_dir/bin/php-config --extension-dir`/memcache.so" ];then
-        [ -z "`grep '^extension_dir' $php_install_dir/etc/php.ini`" ] && sed -i "s@extension_dir = \"ext\"@extension_dir = \"ext\"\nextension_dir = \"`$php_install_dir/bin/php-config --extension-dir`\"@" $php_install_dir/etc/php.ini
-        [ -z "`grep 'memcache.so' $php_install_dir/etc/php.ini`" ] && sed -i 's@^extension_dir\(.*\)@extension_dir\1\nextension = "memcache.so"@' $php_install_dir/etc/php.ini
+        cat > $php_install_dir/etc/php.d/ext-memcache.ini << EOF
+extension=memcache.so
+EOF
         [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
         echo "${CSUCCESS}PHP memcache module install successfully! ${CEND}"
         cd ..
@@ -103,8 +104,10 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     ./configure --with-php-config=$php_install_dir/bin/php-config
     make && make install
     if [ -f "`$php_install_dir/bin/php-config --extension-dir`/memcached.so" ];then
-        [ -z "`grep '^extension_dir' $php_install_dir/etc/php.ini`" ] && sed -i "s@extension_dir = \"ext\"@extension_dir = \"ext\"\nextension_dir = \"`$php_install_dir/bin/php-config --extension-dir`\"@" $php_install_dir/etc/php.ini
-        [ -z "`grep 'memcached.so' $php_install_dir/etc/php.ini`" ] && sed -i 's@^extension_dir\(.*\)@extension_dir\1\nextension = "memcached.so"\nmemcached.use_sasl = 1@' $php_install_dir/etc/php.ini
+        cat > $php_install_dir/etc/php.d/ext-memcached.ini << EOF
+extension=memcached.so
+memcached.use_sasl=1
+EOF
         echo "${CSUCCESS}PHP memcached module install successfully! ${CEND}"
         cd ..
         rm -rf memcached-$memcached_pecl_version

+ 6 - 3
include/php-5.3.sh

@@ -68,8 +68,9 @@ patch -p1 < ../php5.3patch
 patch -p1 < ../debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
 make clean
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
-if [[ $Apache_version =~ ^[1-2]$ ]];then
+if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-apxs2=$apache_install_dir/bin/apxs --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -80,6 +81,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -108,6 +110,7 @@ fi
 # wget -c http://pear.php.net/go-pear.phar
 # $php_install_dir/bin/php go-pear.phar
 
+[ ! -e "$php_install_dir/etc/php.d" ] && mkdir -p $php_install_dir/etc/php.d
 /bin/cp php.ini-production $php_install_dir/etc/php.ini
 
 sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" $php_install_dir/etc/php.ini
@@ -123,7 +126,7 @@ sed -i 's@^max_execution_time.*@max_execution_time = 5@' $php_install_dir/etc/ph
 sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
 
-if [[ ! $Apache_version =~ ^[1-2]$ ]];then
+if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ];then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     chmod +x /etc/init.d/php-fpm
@@ -218,7 +221,7 @@ EOF
     #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf 
     service php-fpm start
 
-elif [[ $Apache_version =~ ^[1-2]$ ]];then
+elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     service httpd restart
 fi
 cd ..

+ 6 - 3
include/php-5.4.sh

@@ -63,8 +63,9 @@ patch -d php-$php_4_version -p0 < fpm-race-condition.patch
 cd php-$php_4_version
 make clean
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
-if [[ $Apache_version =~ ^[1-2]$ ]];then
+if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-apxs2=$apache_install_dir/bin/apxs --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -75,6 +76,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -102,6 +104,7 @@ fi
 # wget -c http://pear.php.net/go-pear.phar
 # $php_install_dir/bin/php go-pear.phar
 
+[ ! -e "$php_install_dir/etc/php.d" ] && mkdir -p $php_install_dir/etc/php.d
 /bin/cp php.ini-production $php_install_dir/etc/php.ini
 
 sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" $php_install_dir/etc/php.ini
@@ -117,7 +120,7 @@ sed -i 's@^max_execution_time.*@max_execution_time = 5@' $php_install_dir/etc/ph
 sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
 
-if [[ ! $Apache_version =~ ^[1-2]$ ]];then
+if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ];then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     chmod +x /etc/init.d/php-fpm
@@ -212,7 +215,7 @@ EOF
     #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf 
     service php-fpm start
 
-elif [[ $Apache_version =~ ^[1-2]$ ]];then
+elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     service httpd restart
 fi
 cd ..

+ 19 - 15
include/php-5.5.sh

@@ -63,8 +63,9 @@ cd php-$php_5_version
 make clean
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
 [ "$PHP_cache" == '1' ] && PHP_cache_tmp='--enable-opcache' || PHP_cache_tmp='--disable-opcache'
-if [[ $Apache_version =~ ^[1-2]$ ]];then
+if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-apxs2=$apache_install_dir/bin/apxs $PHP_cache_tmp --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -75,6 +76,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm $PHP_cache_tmp --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -102,6 +104,7 @@ fi
 # wget -c http://pear.php.net/go-pear.phar
 # $php_install_dir/bin/php go-pear.phar
 
+[ ! -e "$php_install_dir/etc/php.d" ] && mkdir -p $php_install_dir/etc/php.d
 /bin/cp php.ini-production $php_install_dir/etc/php.ini
 
 sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" $php_install_dir/etc/php.ini
@@ -117,20 +120,21 @@ sed -i 's@^max_execution_time.*@max_execution_time = 5@' $php_install_dir/etc/ph
 sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
 
-if [ "$PHP_cache" == '1' ];then
-    sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable=.*@opcache.enable=1@' $php_install_dir/etc/php.ini
-    sed -i "s@^;opcache.memory_consumption.*@opcache.memory_consumption=$Memory_limit@" $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.interned_strings_buffer.*@opcache.interned_strings_buffer=8@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.max_accelerated_files.*@opcache.max_accelerated_files=4000@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.revalidate_freq.*@opcache.revalidate_freq=60@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.save_comments.*@opcache.save_comments=0@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.fast_shutdown.*@opcache.fast_shutdown=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable_cli.*@opcache.enable_cli=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.optimization_level.*@;opcache.optimization_level=0@' $php_install_dir/etc/php.ini
-fi
+[ "$PHP_cache" == '1' ] && cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
+[opcache]
+zend_extension=opcache.so
+opcache.enable=1
+opcache.memory_consumption=$Memory_limit
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=4000
+opcache.revalidate_freq=60
+opcache.save_comments=0
+opcache.fast_shutdown=1
+opcache.enable_cli=1
+;opcache.optimization_level=0
+EOF
 
-if [[ ! $Apache_version =~ ^[1-2]$ ]];then
+if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ];then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     chmod +x /etc/init.d/php-fpm
@@ -225,7 +229,7 @@ EOF
     #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf 
     service php-fpm start
 
-elif [[ $Apache_version =~ ^[1-2]$ ]];then
+elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     service httpd restart
 fi
 cd ..

+ 19 - 15
include/php-5.6.sh

@@ -62,8 +62,9 @@ cd php-$php_6_version
 make clean
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
 [ "$PHP_cache" == '1' ] && PHP_cache_tmp='--enable-opcache' || PHP_cache_tmp='--disable-opcache'
-if [[ $Apache_version =~ ^[1-2]$ ]];then
+if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-apxs2=$apache_install_dir/bin/apxs $PHP_cache_tmp --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -74,6 +75,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm $PHP_cache_tmp --disable-fileinfo \
 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -101,6 +103,7 @@ fi
 # wget -c http://pear.php.net/go-pear.phar
 # $php_install_dir/bin/php go-pear.phar
 
+[ ! -e "$php_install_dir/etc/php.d" ] && mkdir -p $php_install_dir/etc/php.d
 /bin/cp php.ini-production $php_install_dir/etc/php.ini
 
 sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" $php_install_dir/etc/php.ini
@@ -116,20 +119,21 @@ sed -i 's@^max_execution_time.*@max_execution_time = 5@' $php_install_dir/etc/ph
 sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
 
-if [ "$PHP_cache" == '1' ];then
-    sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable=.*@opcache.enable=1@' $php_install_dir/etc/php.ini
-    sed -i "s@^;opcache.memory_consumption.*@opcache.memory_consumption=$Memory_limit@" $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.interned_strings_buffer.*@opcache.interned_strings_buffer=8@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.max_accelerated_files.*@opcache.max_accelerated_files=4000@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.revalidate_freq.*@opcache.revalidate_freq=60@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.save_comments.*@opcache.save_comments=0@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.fast_shutdown.*@opcache.fast_shutdown=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable_cli.*@opcache.enable_cli=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.optimization_level.*@;opcache.optimization_level=0@' $php_install_dir/etc/php.ini
-fi
+[ "$PHP_cache" == '1' ] && cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
+[opcache]
+zend_extension=opcache.so
+opcache.enable=1
+opcache.memory_consumption=$Memory_limit
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=4000
+opcache.revalidate_freq=60
+opcache.save_comments=0
+opcache.fast_shutdown=1
+opcache.enable_cli=1
+;opcache.optimization_level=0
+EOF
 
-if [[ ! $Apache_version =~ ^[1-2]$ ]];then
+if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ];then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     chmod +x /etc/init.d/php-fpm
@@ -224,7 +228,7 @@ EOF
     #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf 
     service php-fpm start
 
-elif [[ $Apache_version =~ ^[1-2]$ ]];then
+elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     service httpd restart
 fi
 cd ..

+ 23 - 20
include/php-7.sh

@@ -63,8 +63,9 @@ make clean
 ./buildconf
 [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
 [ "$PHP_cache" == '1' ] && PHP_cache_tmp='--enable-opcache' || PHP_cache_tmp='--disable-opcache'
-if [[ $Apache_version =~ ^[1-2]$ ]];then
+if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-apxs2=$apache_install_dir/bin/apxs $PHP_cache_tmp --disable-fileinfo \
 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -75,6 +76,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+--with-config-file-scan-dir=$php_install_dir/etc/php.d \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm $PHP_cache_tmp --disable-fileinfo \
 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
@@ -102,6 +104,7 @@ fi
 # wget -c http://pear.php.net/go-pear.phar
 # $php_install_dir/bin/php go-pear.phar
 
+[ ! -e "$php_install_dir/etc/php.d" ] && mkdir -p $php_install_dir/etc/php.d
 /bin/cp php.ini-production $php_install_dir/etc/php.ini
 
 sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" $php_install_dir/etc/php.ini
@@ -118,25 +121,25 @@ sed -i 's@^;realpath_cache_size.*@realpath_cache_size = 2M@' $php_install_dir/et
 sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
 
-if [ "$PHP_cache" == '1' ];then
-    sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable=.*@opcache.enable=1@' $php_install_dir/etc/php.ini
-    sed -i "s@^;opcache.memory_consumption.*@opcache.memory_consumption=$Memory_limit@" $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.interned_strings_buffer.*@opcache.interned_strings_buffer=8@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.max_accelerated_files.*@opcache.max_accelerated_files=4000@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.revalidate_freq.*@opcache.revalidate_freq=60@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.save_comments.*@opcache.save_comments=0@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.fast_shutdown.*@opcache.fast_shutdown=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.validate_timestamps.*@opcache.validate_timestamps=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.enable_cli.*@opcache.enable_cli=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.use_cwd.*@opcache.use_cwd=1@' $php_install_dir/etc/php.ini
-    sed -i 's@^opcache.max_accelerated_files.*@opcache.max_accelerated_files=100000@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.max_wasted_percentage.*@opcache.max_wasted_percentage=5@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.consistency_checks.*@opcache.consistency_checks=0@' $php_install_dir/etc/php.ini
-    sed -i 's@^;opcache.optimization_level.*@;opcache.optimization_level=0@' $php_install_dir/etc/php.ini
-fi
+[ "$PHP_cache" == '1' ] && cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
+[opcache]
+zend_extension=opcache.so
+opcache.enable=1
+opcache.enable_cli=1
+opcache.memory_consumption=$Memory_limit
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=100000
+opcache.max_wasted_percentage=5
+opcache.use_cwd=1
+opcache.validate_timestamps=1
+opcache.revalidate_freq=60
+opcache.save_comments=0
+opcache.fast_shutdown=1
+opcache.consistency_checks=0
+;opcache.optimization_level=0
+EOF
 
-if [[ ! $Apache_version =~ ^[1-2]$ ]];then
+if [[ ! $Apache_version =~ ^[1-2]$ ]] && [ ! -e "$apache_install_dir/bin/apxs" ];then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     chmod +x /etc/init.d/php-fpm
@@ -231,7 +234,7 @@ EOF
     #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf 
     service php-fpm start
 
-elif [[ $Apache_version =~ ^[1-2]$ ]];then
+elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ];then
     service httpd restart
 fi
 cd ..

+ 4 - 2
include/redis.sh

@@ -69,8 +69,10 @@ if [ -e "$php_install_dir/bin/phpize" ];then
     ./configure --with-php-config=$php_install_dir/bin/php-config
     make && make install
     if [ -f "`$php_install_dir/bin/php-config --extension-dir`/redis.so" ];then
-        [ -z "`grep '^extension_dir' $php_install_dir/etc/php.ini`" ] && sed -i "s@extension_dir = \"ext\"@extension_dir = \"ext\"\nextension_dir = \"`$php_install_dir/bin/php-config --extension-dir`\"@" $php_install_dir/etc/php.ini
-        [ -z "`grep 'redis.so' $php_install_dir/etc/php.ini`" ] && sed -i 's@^extension_dir\(.*\)@extension_dir\1\nextension = "redis.so"@' $php_install_dir/etc/php.ini
+        cat > $php_install_dir/etc/php.d/ext-redis.ini << EOF
+[redis]
+extension=redis.so
+EOF
         echo "${CSUCCESS}PHP Redis module install successfully! ${CEND}"
         cd ..
         rm -rf redis-$redis_pecl_version

+ 24 - 24
include/xcache.sh

@@ -24,34 +24,34 @@ if [ -f "`$php_install_dir/bin/php-config --extension-dir`/xcache.so" ];then
     chown -R ${run_user}.$run_user $wwwroot_dir/default/xcache
     touch /tmp/xcache;chown ${run_user}.$run_user /tmp/xcache
 
-    cat >> $php_install_dir/etc/php.ini << EOF
+    cat > $php_install_dir/etc/php.d/ext-xcache.ini << EOF
 [xcache-common]
-extension = "xcache.so"
+extension=xcache.so
 [xcache.admin]
-xcache.admin.enable_auth = On
-xcache.admin.user = "admin"
-xcache.admin.pass = "$xcache_admin_md5_pass"
+xcache.admin.enable_auth=On
+xcache.admin.user=admin
+xcache.admin.pass="$xcache_admin_md5_pass"
 
 [xcache]
-xcache.size = $(expr $Memory_limit / 2)M
-xcache.count = $(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
-xcache.slots = 8K
-xcache.ttl = 3600
-xcache.gc_interval = 300
-xcache.var_size = 4M
-xcache.var_count = $(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
-xcache.var_slots = 8K
-xcache.var_ttl = 0
-xcache.var_maxttl = 0
-xcache.var_gc_interval = 300
-xcache.test = Off
-xcache.readonly_protection = Off
-xcache.shm_scheme = "mmap"
-xcache.mmap_path = "/tmp/xcache"
-xcache.coredump_directory = ""
-xcache.cacher = On
-xcache.stat = On
-xcache.optimizer = Off
+xcache.size=$(expr $Memory_limit / 2)M
+xcache.count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
+xcache.slots=8K
+xcache.ttl=3600
+xcache.gc_interval=300
+xcache.var_size=4M
+xcache.var_count=$(expr `cat /proc/cpuinfo | grep -c processor` + 1) 
+xcache.var_slots=8K
+xcache.var_ttl=0
+xcache.var_maxttl=0
+xcache.var_gc_interval=300
+xcache.test=Off
+xcache.readonly_protection=Off
+xcache.shm_scheme=mmap
+xcache.mmap_path=/tmp/xcache
+xcache.coredump_directory=
+xcache.cacher=On
+xcache.stat=On
+xcache.optimizer=Off
 
 [xcache.coverager]
 ; enabling this feature will impact performance

+ 3 - 2
include/zendopcache.sh

@@ -20,9 +20,10 @@ $php_install_dir/bin/phpize
 ./configure --with-php-config=$php_install_dir/bin/php-config
 make && make install
 if [ -f "`$php_install_dir/bin/php-config --extension-dir`/opcache.so" ];then
-    cat >> $php_install_dir/etc/php.ini << EOF
+    cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
 [opcache]
-zend_extension="`$php_install_dir/bin/php-config --extension-dir`/opcache.so"
+zend_extension=opcache.so
+opcache.enable=1
 opcache.memory_consumption=$Memory_limit
 opcache.interned_strings_buffer=8
 opcache.max_accelerated_files=4000

+ 13 - 9
vhost.sh

@@ -216,14 +216,6 @@ else
     echo "domain=$domain"
 fi
 
-if [ "$nginx_ssl_yn" == 'y' ]; then
-    Nginx_ssl
-    Nginx_conf=$(echo -e "listen $LISTENOPT;\nssl_certificate $web_install_dir/conf/ssl/$domain.crt;\nssl_certificate_key $web_install_dir/conf/ssl/$domain.key;\nssl_session_timeout 10m;\nssl_protocols TLSv1 TLSv1.1 TLSv1.2;\nssl_prefer_server_ciphers on;\nssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:\!aNULL:\!eNULL:\!EXPORT:\!DES:\!3DES:\!MD5:\!DSS:\!PKS";\nssl_session_cache builtin:1000 shared:SSL:10m;\nresolver 8.8.8.8 8.8.4.4 valid=300s;\nresolver_timeout 5s;")
-    Nginx_http_to_https=$(echo -e "server {\nlisten 80;\nserver_name $domain;\nrewrite ^/(.*) https://$domain/\$1 permanent;\n}")
-else
-    Nginx_conf='listen 80;'
-fi
-
 while :
 do
     echo
@@ -268,6 +260,18 @@ if [ "$moredomainame_yn" == 'y' ]; then
     fi
 fi
 
+if [ "$nginx_ssl_yn" == 'y' ]; then
+    Nginx_ssl
+    Nginx_conf=$(echo -e "listen $LISTENOPT;\nssl_certificate $web_install_dir/conf/ssl/$domain.crt;\nssl_certificate_key $web_install_dir/conf/ssl/$domain.key;\nssl_session_timeout 10m;\nssl_protocols TLSv1 TLSv1.1 TLSv1.2;\nssl_prefer_server_ciphers on;\nssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:\!aNULL:\!eNULL:\!EXPORT:\!DES:\!3DES:\!MD5:\!DSS:\!PKS";\nssl_session_cache builtin:1000 shared:SSL:10m;\nresolver 8.8.8.8 8.8.4.4 valid=300s;\nresolver_timeout 5s;")
+    if [ "$moredomainame_yn" == 'y' ]; then
+        Nginx_http_to_https=$(echo -e "server {\nlisten 80;\nserver_name $domain$moredomainame;\nrewrite ^/(.*) https://$domain/\$1 permanent;\n}")
+    else
+        Nginx_http_to_https=$(echo -e "server {\nlisten 80;\nserver_name $domain;\nrewrite ^/(.*) https://$domain/\$1 permanent;\n}")
+    fi
+else
+    Nginx_conf='listen 80;'
+fi
+
 while :
 do
     echo
@@ -344,7 +348,7 @@ else
     	rewrite="other"
     fi
     echo "You choose rewrite=${CMSG}$rewrite${CEND}"
-    [ "$NGX_FLAG" == 'php' -a "$rewrite" == "thinkphp" ] && NGX_CONF=$(echo -e "location ~ \.php {\n    #fastcgi_pass remote_php_ip:9000;\n    fastcgi_pass unix:/dev/shm/php-cgi.sock;\n    fastcgi_index index.php;\n    include fastcgi_params;\n    set \$real_script_name \$fastcgi_script_name;\n        if (\$fastcgi_script_name ~ \"^(.+?\.php)(/.+)\$\") {\n        set \$real_script_name \$1;\n        }\n    fastcgi_param SCRIPT_FILENAME \$document_root\$real_script_name;\n    fastcgi_param SCRIPT_NAME \$real_script_name;\n    }")
+    [ "$NGX_FLAG" == 'php' -a "$rewrite" == "thinkphp" ] && NGX_CONF=$(echo -e "location ~ \.php {\n    #fastcgi_pass remote_php_ip:9000;\n    fastcgi_pass unix:/dev/shm/php-cgi.sock;\n    fastcgi_index index.php;\n    include fastcgi_params;\n    set \$real_script_name \$fastcgi_script_name;\n        if (\$fastcgi_script_name ~ \"^(.+?\.php)(/.+)\$\") {\n        set \$real_script_name \$1;\n        #set \$path_info \$2;\n        }\n    fastcgi_param SCRIPT_FILENAME \$document_root\$real_script_name;\n    fastcgi_param SCRIPT_NAME \$real_script_name;\n    #fastcgi_param PATH_INFO \$path_info;\n    }")
     if [ -e "config/$rewrite.conf" ];then
     	/bin/cp config/$rewrite.conf $web_install_dir/conf/rewrite/$rewrite.conf
     else