Browse Source

Update init.d

lj2007331 8 years ago
parent
commit
37902b1ed5

+ 1 - 1
README.md

@@ -7,7 +7,7 @@ Script properties:
 - Source compiler installation, most stable source is the latest version, and download from the official site
 - Some security optimization
 - Providing a plurality of database versions (MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.1, MariaDB-10.0, MariaDB-5.5, Percona-5.7, Percona-5.6, Percona-5.5, AliSQL-5.6)
-- Providing multiple PHP versions (php-7, php-5.6, php-5.5, php-5.4, php-5.3)
+- Providing multiple PHP versions (PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
 - Provide Nginx, Tengine, OpenResty
 - Providing a plurality of Tomcat version (Tomcat-8, Tomcat-7, Tomcat-6)
 - Providing a plurality of JDK version (JDK-1.8, JDK-1.7, JDK-1.6)

+ 1 - 0
addons.sh

@@ -396,6 +396,7 @@ What Are You Doing?
           ./configure --with-php-config=${php_install_dir}/bin/php-config
           make -j ${THREAD} && make install
           popd;popd
+          rm -rf php-${PHP_detail_version}
           echo "extension=fileinfo.so" > ${php_install_dir}/etc/php.d/ext-fileinfo.ini
           Check_succ
         else

+ 3 - 4
include/apache-2.2.sh

@@ -45,12 +45,10 @@ Install_Apache22() {
   if [ "$Nginx_version" == '4' -a ! -e "$web_install_dir/sbin/nginx" ]; then
     sed -i 's/^#ServerName www.example.com:80/ServerName 0.0.0.0:80/' $apache_install_dir/conf/httpd.conf
     TMP_PORT=80
-    TMP_IP=$IPADDR
   elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ]; then
     sed -i 's/^#ServerName www.example.com:80/ServerName 127.0.0.1:88/' $apache_install_dir/conf/httpd.conf
     sed -i 's@^Listen.*@Listen 127.0.0.1:88@' $apache_install_dir/conf/httpd.conf
     TMP_PORT=88
-    TMP_IP=127.0.0.1
   fi
   sed -i "s@AddType\(.*\)Z@AddType\1Z\n    AddType application/x-httpd-php .php .phtml\n    AddType application/x-httpd-php-source .phps@" $apache_install_dir/conf/httpd.conf
   sed -i "s@#AddHandler cgi-script .cgi@AddHandler cgi-script .cgi .pl@" $apache_install_dir/conf/httpd.conf
@@ -70,7 +68,7 @@ $wwwlogs_dir/*apache.log {
   notifempty
   sharedscripts
   postrotate
-    [ -f $apache_install_dir/logs/httpd.pid ] && kill -USR1 \`cat $apache_install_dir/logs/httpd.pid\`
+    [ -e /var/run/httpd.pid ] && kill -USR1 \`cat /var/run/httpd.pid\`
   endscript
 }
 EOF
@@ -81,7 +79,7 @@ NameVirtualHost *:$TMP_PORT
 <VirtualHost *:$TMP_PORT>
   ServerAdmin admin@linuxeye.com
   DocumentRoot "$wwwroot_dir/default"
-  ServerName $TMP_IP
+  ServerName 127.0.0.1
   ErrorLog "$wwwlogs_dir/error_apache.log"
   CustomLog "$wwwlogs_dir/access_apache.log" common
 <Directory "$wwwroot_dir/default">
@@ -112,6 +110,7 @@ EOF
   SetOutputFilter DEFLATE
 </IfModule>
 
+PidFile /var/run/httpd.pid
 ServerTokens ProductOnly
 ServerSignature Off
 Include conf/vhost/*.conf

+ 3 - 4
include/apache-2.4.sh

@@ -53,12 +53,10 @@ Install_Apache24() {
   if [ "$Nginx_version" == '4' -a ! -e "$web_install_dir/sbin/nginx" ]; then
     sed -i 's/^#ServerName www.example.com:80/ServerName 0.0.0.0:80/' $apache_install_dir/conf/httpd.conf
     TMP_PORT=80
-    TMP_IP=$IPADDR
   elif [[ $Nginx_version =~ ^[1-3]$ ]] || [ -e "$web_install_dir/sbin/nginx" ]; then
     sed -i 's/^#ServerName www.example.com:80/ServerName 127.0.0.1:88/' $apache_install_dir/conf/httpd.conf
     sed -i 's@^Listen.*@Listen 127.0.0.1:88@' $apache_install_dir/conf/httpd.conf
     TMP_PORT=88
-    TMP_IP=127.0.0.1
   fi
   sed -i "s@AddType\(.*\)Z@AddType\1Z\n    AddType application/x-httpd-php .php .phtml\n    AddType application/x-httpd-php-source .phps@" $apache_install_dir/conf/httpd.conf
   sed -i "s@#AddHandler cgi-script .cgi@AddHandler cgi-script .cgi .pl@" $apache_install_dir/conf/httpd.conf
@@ -84,7 +82,7 @@ $wwwlogs_dir/*apache.log {
   notifempty
   sharedscripts
   postrotate
-    [ -f $apache_install_dir/logs/httpd.pid ] && kill -USR1 \`cat $apache_install_dir/logs/httpd.pid\`
+    [ -e /var/run/httpd.pid ] && kill -USR1 \`cat /var/run/httpd.pid\`
   endscript
 }
 EOF
@@ -94,7 +92,7 @@ EOF
 <VirtualHost *:$TMP_PORT>
   ServerAdmin admin@linuxeye.com
   DocumentRoot "$wwwroot_dir/default"
-  ServerName $TMP_IP
+  ServerName 127.0.0.1 
   ErrorLog "$wwwlogs_dir/error_apache.log"
   CustomLog "$wwwlogs_dir/access_apache.log" common
 <Directory "$wwwroot_dir/default">
@@ -126,6 +124,7 @@ EOF
   SetOutputFilter DEFLATE
 </IfModule>
 
+PidFile /var/run/httpd.pid
 ServerTokens ProductOnly
 ServerSignature Off
 Include conf/vhost/*.conf

+ 3 - 1
include/init_CentOS.sh

@@ -83,10 +83,12 @@ net.core.wmem_default = 8388608
 net.core.rmem_default = 8388608
 net.core.rmem_max = 16777216
 net.core.wmem_max = 16777216
-net.ipv4.tcp_timestamps = 0
+net.ipv4.tcp_timestamps = 1 
+net.ipv4.tcp_fin_timeout = 20
 net.ipv4.tcp_synack_retries = 2
 net.ipv4.tcp_syn_retries = 2
 net.ipv4.tcp_tw_recycle = 1
+net.ipv4.tcp_syncookies = 1
 #net.ipv4.tcp_tw_len = 1
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.tcp_mem = 94500000 915000000 927000000

+ 1 - 0
include/memory.sh

@@ -14,6 +14,7 @@ Swap=`free -m | awk '/Swap:/{print $2}'`
 if [ $Mem -le 640 ]; then
   Mem_level=512M
   Memory_limit=64
+  THREAD=1
 elif [ $Mem -gt 640 -a $Mem -le 1280 ]; then
   Mem_level=1G
   Memory_limit=128

+ 1 - 1
include/nginx.sh

@@ -27,7 +27,7 @@ Install_Nginx() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
   
   [ ! -d "$nginx_install_dir" ] && mkdir -p $nginx_install_dir
-  ./configure --prefix=$nginx_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
+  ./configure --prefix=$nginx_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
   make -j ${THREAD} && make install
   if [ -e "$nginx_install_dir/conf/nginx.conf" ]; then
     popd 

+ 1 - 1
include/openresty.sh

@@ -24,7 +24,7 @@ Install_OpenResty() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-$openresty_version_tmp/auto/cc/gcc # close debug
   
   [ ! -d "$openresty_install_dir" ] && mkdir -p $openresty_install_dir
-  ./configure --prefix=$openresty_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
+  ./configure --prefix=$openresty_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
   make -j ${THREAD} && make install
   if [ -e "$openresty_install_dir/nginx/conf/nginx.conf" ]; then
     popd

+ 2 - 2
include/php-5.3.sh

@@ -99,7 +99,7 @@ Install_PHP53() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf $OpenSSL_args \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -110,7 +110,7 @@ Install_PHP53() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf $OpenSSL_args \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   sed -i '/^BUILD_/ s/\$(CC)/\$(CXX)/g' Makefile
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}

+ 2 - 2
include/php-5.4.sh

@@ -74,7 +74,7 @@ Install_PHP54() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -85,7 +85,7 @@ Install_PHP54() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install

+ 2 - 2
include/php-5.5.sh

@@ -73,7 +73,7 @@ Install_PHP55() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -84,7 +84,7 @@ Install_PHP55() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install

+ 2 - 2
include/php-5.6.sh

@@ -74,7 +74,7 @@ Install_PHP56() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -85,7 +85,7 @@ Install_PHP56() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install

+ 2 - 2
include/php-7.0.sh

@@ -75,7 +75,7 @@ Install_PHP70() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -86,7 +86,7 @@ Install_PHP70() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install

+ 2 - 2
include/php-7.1.sh

@@ -75,7 +75,7 @@ Install_PHP71() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --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 \
@@ -86,7 +86,7 @@ Install_PHP71() {
     --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
-    --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug
+    --with-gettext --enable-zip --enable-soap --disable-debug
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install

+ 1 - 1
include/tengine.sh

@@ -25,7 +25,7 @@ Install_Tengine() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
   
   [ ! -d "$tengine_install_dir" ] && mkdir -p $tengine_install_dir
-  ./configure --prefix=$tengine_install_dir --user=$run_user --group=$run_user --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-jemalloc
+  ./configure --prefix=$tengine_install_dir --user=$run_user --group=$run_user --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-jemalloc
   make -j ${THREAD} && make install
   if [ -e "$tengine_install_dir/conf/nginx.conf" ]; then
     popd

+ 1 - 1
include/upgrade_web.sh

@@ -159,7 +159,7 @@ Upgrade_OpenResty() {
     openresty_version_tmp=${NEW_OpenResty_version%.*}
     sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-$openresty_version_tmp/auto/cc/gcc # close debug
     $openresty_install_dir/nginx/sbin/nginx -V &> $$
-    ./configure --prefix=$openresty_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
+    ./configure --prefix=$openresty_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' 
     make -j ${THREAD}
     if [ -f "build/nginx-$openresty_version_tmp/objs/nginx" ]; then
       /bin/mv $openresty_install_dir/nginx/sbin/nginx{,`date +%m%d`}

+ 2 - 2
init.d/Nginx-init-CentOS

@@ -59,7 +59,7 @@ start() {
 
 stop() {
   echo -n $"Stopping $prog: "
-  killproc $prog -QUIT
+  $nginx -s stop
   retval=$?
   echo
   [ $retval -eq 0 ] && rm -f $lockfile
@@ -76,7 +76,7 @@ restart() {
 reload() {
   configtest || return $?
   echo -n $"Reloading $prog: "
-  killproc $nginx -HUP
+  $nginx -s reload
   RETVAL=$?
   echo
 }

+ 3 - 17
init.d/Pureftpd-init

@@ -24,12 +24,10 @@
 RETVAL=0
 
 # Path to the pure-ftp binaries.
-prog=pure-config.pl
-fullpath=/usr/local/pureftpd/sbin/$prog
-pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho
+prog=pure-ftpd
+fullpath=/usr/local/pureftpd/sbin/pure-config.pl
 pure_config=/usr/local/pureftpd/etc/pure-ftpd.conf
 
-
 start() {
   echo -n $"Starting $prog: "
   $fullpath $pure_config --daemonize
@@ -57,23 +55,11 @@ case "$1" in
     stop
     start
     ;;
-  condrestart)
-    if [ -f /var/lock/subsys/$prog ] ; then
-      stop
-      # avoid race
-      sleep 3
-      start
-    fi
-    ;;
   status)
     status $prog
-    RETVAL=$?
-    if [ -f $pureftpwho ] && [ $RETVAL -eq 0 ] ; then
-      $pureftpwho
-    fi
     ;;
   *)
-    echo $"Usage: $prog {start|stop|restart|condrestart|status}"
+    echo $"Usage: $prog {start|stop|restart|status}"
     RETVAL=1
 esac
 exit $RETVAL

+ 1 - 1
install.sh

@@ -389,7 +389,7 @@ while :; do echo
 done
 
 # check phpMyAdmin
-if [[ $PHP_version =~ ^[1-5]$ ]] || [ -e "$php_install_dir/bin/phpize" ]; then
+if [[ $PHP_version =~ ^[1-6]$ ]] || [ -e "$php_install_dir/bin/phpize" ]; then
   while :; do echo
     read -p "Do you want to install phpMyAdmin? [y/n]: " phpMyAdmin_yn
     if [[ ! $phpMyAdmin_yn =~ ^[y,n]$ ]]; then

+ 12 - 12
versions.txt

@@ -1,7 +1,7 @@
 # newest software version
 # Web
 nginx_version=1.10.2
-tengine_version=2.2.0
+tengine_version=2.1.2
 openresty_version=1.11.2.2
 openssl_version=1.0.2j
 
@@ -16,11 +16,11 @@ apr_version=1.5.2
 apr_util_version=1.5.4
 
 # DB
-mysql57_version=5.7.16
-mysql56_version=5.6.34
-mysql55_version=5.5.53
+mysql57_version=5.7.17
+mysql56_version=5.6.35
+mysql55_version=5.5.54
 
-mariadb101_version=10.1.19
+mariadb101_version=10.1.20
 mariadb100_version=10.0.28
 mariadb55_version=5.5.53
 
@@ -37,8 +37,8 @@ jdk16_version=1.6.0_45
 
 # PHP
 php71_version=7.1.0
-php70_version=7.0.13
-php56_version=5.6.28
+php70_version=7.0.14
+php56_version=5.6.29
 php55_version=5.5.38
 php54_version=5.4.45
 php53_version=5.3.29
@@ -47,7 +47,7 @@ zendopcache_version=7.0.5
 xcache_version=3.2.0
 apcu_version=4.0.11
 apcu_for_php7_version=5.1.7
-ImageMagick_version=6.9.6-6
+ImageMagick_version=6.9.6-8
 imagick_version=3.4.3RC1
 imagick_for_php53_version=3.3.0
 GraphicsMagick_version=1.3.25
@@ -64,8 +64,8 @@ eaccelerator_version=0.9.6.1
 pureftpd_version=1.0.43
 
 # Redis
-redis_version=3.2.5
-redis_pecl_for_php7_version=3.0.0
+redis_version=3.2.6
+redis_pecl_for_php7_version=3.1.0
 redis_pecl_version=2.2.8
 
 # Memcached
@@ -75,7 +75,7 @@ memcached_pecl_version=2.2.0
 memcache_pecl_version=3.0.8
 
 # phpMyadmin
-phpMyAdmin_version=4.4.15.8
+phpMyAdmin_version=4.4.15.9
 
 # jemalloc
 jemalloc_version=4.3.1
@@ -89,5 +89,5 @@ tmux_version=2.2
 htop_version=2.0.2
 bison_version=2.7.1
 python_version=2.7.12
-setuptools_version=30.0.0
+setuptools_version=32.0.0
 pip_version=9.0.1

+ 9 - 9
vhost.sh

@@ -168,8 +168,6 @@ If you enter '.', the field will be left blank.
   [ -z "${SELFSIGNEDSSL_O}U" ] && SELFSIGNEDSSL_OU="IT Dept."
 
   openssl req -new -newkey rsa:2048 -sha256 -nodes -out ${PATH_SSL}/${domain}.csr -keyout ${PATH_SSL}/${domain}.key -subj "/C=${SELFSIGNEDSSL_C}/ST=${SELFSIGNEDSSL_ST}/L=${SELFSIGNEDSSL_L}/O=${SELFSIGNEDSSL_O}/OU=${SELFSIGNEDSSL_OU}/CN=${domain}" > /dev/null 2>&1
-  /bin/cp ${PATH_SSL}/${domain}.csr{,_bk.$(date +%Y-%m-%d_%H%M)}
-  /bin/cp ${PATH_SSL}/${domain}.key{,_bk.$(date +%Y-%m-%d_%H%M)}
   openssl x509 -req -days 36500 -sha256 -in ${PATH_SSL}/${domain}.csr -signkey ${PATH_SSL}/${domain}.key -out ${PATH_SSL}/${domain}.crt > /dev/null 2>&1
 }
 
@@ -364,7 +362,7 @@ Input_Add_domain() {
           break
         fi
       done
-      [ "${redirect_yn}" == 'y' ] && Nginx_redirect=$(echo -e "if (\$host != $domain) {\n    rewrite ^/(.*)\$ \$scheme://$domain/\$1 permanent;\n  }")
+      [ "${redirect_yn}" == 'y' ] && Nginx_redirect="if (\$host != $domain) {  return 301 \$scheme://${domain}\$request_uri;  }"
     fi
   fi
 
@@ -481,9 +479,9 @@ server {
   ${N_log}
   index index.html index.htm index.jsp;
   root ${vhostdir};
+  ${Nginx_redirect}
   #error_page 404 = /404.html;
   #error_page 502 = /502.html;
-  ${Nginx_redirect}
   ${anti_hotlinking}
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
     expires 30d;
@@ -500,7 +498,7 @@ server {
 }
 EOF
 
-  [ "${https_yn}" == 'y' ] && sed -i "s@^root.*;@&\nif (\$ssl_protocol = \"\") { return 301 https://\$host\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
+  [ "${https_yn}" == 'y' ] && sed -i "s@^root.*;@&\nif (\$ssl_protocol = \"\") { return 301 https://\$server_name\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
   cat > ${tomcat_install_dir}/conf/vhost/${domain}.xml << EOF
 <Host name="${domain}" appBase="${vhostdir}" unpackWARs="true" autoDeploy="true"> ${Tomcat_Domain_alias}
@@ -573,9 +571,9 @@ server {
   index index.html index.htm index.php;
   include ${web_install_dir}/conf/rewrite/${rewrite}.conf;
   root ${vhostdir};
+  ${Nginx_redirect}
   #error_page 404 = /404.html;
   #error_page 502 = /502.html;
-  ${Nginx_redirect}
   ${anti_hotlinking}
   ${NGX_CONF}
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
@@ -592,7 +590,7 @@ server {
 }
 EOF
 
-  [ "${https_yn}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$ssl_protocol = \"\") { return 301 https://\$host\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
+  [ "${https_yn}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$ssl_protocol = \"\") { return 301 https://\$server_name\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
   echo
   ${web_install_dir}/sbin/nginx -t
@@ -739,7 +737,7 @@ server {
 }
 EOF
 
-  [ "${https_yn}" == 'y' ] && sed -i "s@^root.*;@&\nif (\$ssl_protocol = \"\") { return 301 https://\$host\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
+  [ "${https_yn}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$ssl_protocol = \"\") { return 301 https://\$server_name\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
   echo
   ${web_install_dir}/sbin/nginx -t
@@ -872,7 +870,9 @@ Del_NGX_Vhost() {
                 char=$(get_char)
                 rm -rf ${Directory}
               fi
-              echo "${CSUCCESS}Domain: ${domain} has been deleted.${CEND}"
+              echo
+              echo "${CMSG}Domain: ${domain} has been deleted.${CEND}"
+              echo
             else
               echo "${CWARNING}Virtualhost: ${domain} was not exist! ${CEND}"
             fi