Browse Source

Update apps.conf and bugs

lj2007331 9 years ago
parent
commit
4d5a957198

+ 6 - 6
apps.conf

@@ -3,12 +3,12 @@
 nginx_version=1.9.9
 tengine_version=2.1.1
 
-tomcat_7_version=7.0.65
+tomcat_7_version=7.0.67
 tomcat_8_version=8.0.30
 
 apache_2_version=2.2.31
-apache_4_version=2.4.17
-pcre_version=8.37
+apache_4_version=2.4.18
+pcre_version=8.38
 apr_version=1.5.2
 apr_util_version=1.5.4
 
@@ -18,7 +18,7 @@ mysql_5_6_version=5.6.28
 mysql_5_5_version=5.5.47
 
 mariadb_10_1_version=10.1.9
-mariadb_10_0_version=10.0.22
+mariadb_10_0_version=10.0.23
 mariadb_5_5_version=5.5.47
 
 percona_5_6_version=5.6.27-76.0
@@ -34,7 +34,7 @@ php_3_version=5.3.29
 php_4_version=5.4.45
 php_5_version=5.5.30
 php_6_version=5.6.16
-php_7_version=7.0.0
+php_7_version=7.0.1
 
 zendopcache_version=7.0.5
 xcache_version=3.2.0
@@ -52,7 +52,7 @@ mhash_version=0.9.9.9
 pureftpd_version=1.0.42
 
 # Redis
-redis_version=3.0.5
+redis_version=3.0.6
 redis_pecl_version=2.2.7
 
 # Memcached

+ 9 - 1
backup.sh

@@ -39,7 +39,15 @@ WEB_Local_BK() {
 WEB_Remote_BK() {
     for W in `echo $website_name | tr ',' ' '`
     do
-        echo "file:::$wwwroot_dir/$W $backup_dir push" >> config_bakcup.txt
+        if [ `du -sm "$wwwroot_dir/$WebSite" | awk '{print $1}'` -lt 1024 ];then
+            ./website_bk.sh $W
+            Web_GREP="Web_${W}_`date +%Y`"
+            Web_FILE=`ls -lrt $backup_dir | grep ${Web_GREP} | tail -1 | awk '{print $NF}'`
+            echo "file:::$backup_dir/$Web_FILE $backup_dir push" >> config_bakcup.txt
+            echo "com:::[ -e "$backup_dir/$Web_FILE" ] && rm -rf $backup_dir/Web_${W}_$(date +%Y%m%d --date="$expired_days days ago")_*.tgz" >> config_bakcup.txt
+        else
+            echo "file:::$wwwroot_dir/$W $backup_dir push" >> config_bakcup.txt
+        fi
     done
 }
 

+ 3 - 3
include/ImageMagick.sh

@@ -25,9 +25,9 @@ Install_php-imagick() {
 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/imagick-3.4.0RC2.tgz && Download_src
-        tar xzf imagick-3.4.0RC2.tgz
-        cd imagick-3.4.0RC2
+        src_url=https://pecl.php.net/get/imagick-3.4.0RC3.tgz && Download_src
+        tar xzf imagick-3.4.0RC3.tgz
+        cd imagick-3.4.0RC3
     else
         src_url=http://pecl.php.net/get/imagick-$imagick_version.tgz && Download_src
         tar xzf imagick-$imagick_version.tgz

+ 1 - 1
include/apache-2.4.sh

@@ -11,7 +11,7 @@
 Install_Apache-2-4()
 {
 cd $oneinstack_dir/src
-src_url=http://downloads.sourceforge.net/project/pcre/pcre/$pcre_version/pcre-$pcre_version.tar.gz && Download_src
+src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz && Download_src
 src_url=http://archive.apache.org/dist/apr/apr-$apr_version.tar.gz && Download_src 
 src_url=http://archive.apache.org/dist/apr/apr-util-$apr_util_version.tar.gz && Download_src 
 src_url=http://mirrors.linuxeye.com/apache/httpd/httpd-$apache_4_version.tar.gz && Download_src 

+ 1 - 1
include/init_Debian.sh

@@ -20,7 +20,7 @@ apt-get -y update
 [ "$upgrade_yn" == 'y' ] && apt-get -y upgrade 
 
 # Install needed packages
-for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libjpeg-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev bison re2c libsasl2-dev libxslt1-dev locales libcloog-ppl0 patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz
+for Package in gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libjpeg-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev libreadline-dev curl libcurl3 libcurl4-openssl-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev bison re2c libsasl2-dev libxslt1-dev locales libcloog-ppl0 patch vim zip unzip tmux htop wget bc expect rsync git lsof lrzsz cron logrotate
 do
     apt-get -y install $Package
 done

+ 1 - 1
include/init_Ubuntu.sh

@@ -25,7 +25,7 @@ do
     apt-get -y install $Package
 done
 
-if [ "$Ubuntu_version" == '14' ];then
+if [ "$Ubuntu_version" == '14' -o "$Ubuntu_version" == '15' ];then
     apt-get -y install libcloog-ppl1
     apt-get -y remove bison
     cd src

+ 1 - 0
include/mysql-5.5.sh

@@ -65,6 +65,7 @@ cd ..
 
 # my.cf
 [ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
+[ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
 cat > /etc/my.cnf << EOF
 [client]
 port = 3306

+ 1 - 0
include/mysql-5.6.sh

@@ -63,6 +63,7 @@ cd ..
 
 # my.cf
 [ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
+[ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
 cat > /etc/my.cnf << EOF
 [client]
 port = 3306

+ 1 - 0
include/mysql-5.7.sh

@@ -77,6 +77,7 @@ cd ..
 
 # my.cf
 [ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
+[ -e "$mysql_install_dir/my.cnf" ] && rm -rf $mysql_install_dir/my.cnf
 cat > /etc/my.cnf << EOF
 [client]
 port = 3306

+ 1 - 1
include/nginx.sh

@@ -11,7 +11,7 @@
 Install_Nginx()
 {
 cd $oneinstack_dir/src
-src_url=http://downloads.sourceforge.net/project/pcre/pcre/$pcre_version/pcre-$pcre_version.tar.gz && Download_src
+src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz && Download_src
 src_url=http://nginx.org/download/nginx-$nginx_version.tar.gz && Download_src
 
 tar xzf pcre-$pcre_version.tar.gz

+ 3 - 4
include/php-5.3.sh

@@ -20,10 +20,9 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/fpm-race-condition.patch && D
 src_url=http://www.php.net/distributions/php-$php_3_version.tar.gz && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
+patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
 cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
-[ -n "`cat /etc/issue | grep 'Ubuntu 13'`" ] && sed -i 's@_GL_WARN_ON_USE (gets@//_GL_WARN_ON_USE (gets@' srclib/stdio.h 
-[ -n "`cat /etc/issue | grep 'Ubuntu 14'`" ] && sed -i 's@gets is a security@@' srclib/stdio.h 
 make && make install
 cd ..
 rm -rf libiconv-$libiconv_version
@@ -56,6 +55,8 @@ else \n
 fi'
 OS_command
 
+[ ! -e '/usr/include/freetype2/freetype' ] &&  ln -s /usr/include/freetype2 /usr/include/freetype2/freetype
+
 tar xzf mcrypt-$mcrypt_version.tar.gz
 cd mcrypt-$mcrypt_version
 ldconfig
@@ -129,8 +130,6 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $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
-[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session; }
-[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [[ ! $Apache_version =~ ^[1-2]$ ]];then
     # php-fpm Init Script

+ 1 - 4
include/php-5.4.sh

@@ -20,10 +20,9 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/fpm-race-condition.patch && D
 src_url=http://www.php.net/distributions/php-$php_4_version.tar.gz && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
+patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
 cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
-[ "$Ubuntu_version" == '13' ] && sed -i 's@_GL_WARN_ON_USE (gets@//_GL_WARN_ON_USE (gets@' srclib/stdio.h 
-[ "$Ubuntu_version" == '14' ] && sed -i 's@gets is a security@@' srclib/stdio.h 
 make && make install
 cd ..
 rm -rf libiconv-$libiconv_version 
@@ -128,8 +127,6 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $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
-[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session; }
-[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [[ ! $Apache_version =~ ^[1-2]$ ]];then
     # php-fpm Init Script

+ 1 - 4
include/php-5.5.sh

@@ -19,10 +19,9 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/fpm-race-condition.patch && D
 src_url=http://www.php.net/distributions/php-$php_5_version.tar.gz && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
+patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
 cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
-[ "$Ubuntu_version" == '13' ] && sed -i 's@_GL_WARN_ON_USE (gets@//_GL_WARN_ON_USE (gets@' srclib/stdio.h 
-[ "$Ubuntu_version" == '14' ] && sed -i 's@gets is a security@@' srclib/stdio.h 
 make && make install
 cd ..
 rm -rf libiconv-$libiconv_version
@@ -127,8 +126,6 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $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
-[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session; }
-[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $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

+ 1 - 4
include/php-5.6.sh

@@ -19,10 +19,9 @@ src_url=http://mirrors.linuxeye.com/oneinstack/src/fpm-race-condition.patch && D
 src_url=http://www.php.net/distributions/php-$php_6_version.tar.gz && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
+patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
 cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
-[ "$Ubuntu_version" == '13' ] && sed -i 's@_GL_WARN_ON_USE (gets@//_GL_WARN_ON_USE (gets@' srclib/stdio.h 
-[ "$Ubuntu_version" == '14' ] && sed -i 's@gets is a security@@' srclib/stdio.h 
 make && make install
 cd ..
 rm -rf libiconv-$libiconv_version
@@ -128,8 +127,6 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $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
-[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session; }
-[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $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

+ 1 - 4
include/php-7.sh

@@ -18,10 +18,9 @@ src_url=http://downloads.sourceforge.net/project/mcrypt/MCrypt/$mcrypt_version/m
 src_url=http://www.php.net/distributions/php-$php_7_version.tar.gz && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
+patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
 cd libiconv-$libiconv_version
 ./configure --prefix=/usr/local
-[ "$Ubuntu_version" == '13' ] && sed -i 's@_GL_WARN_ON_USE (gets@//_GL_WARN_ON_USE (gets@' srclib/stdio.h 
-[ "$Ubuntu_version" == '14' ] && sed -i 's@gets is a security@@' srclib/stdio.h 
 make && make install
 cd ..
 rm -rf libiconv-$libiconv_version
@@ -128,8 +127,6 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $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
-[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session; }
-[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $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

+ 2 - 2
include/tengine.sh

@@ -11,7 +11,7 @@
 Install_Tengine()
 {
 cd $oneinstack_dir/src
-src_url=http://downloads.sourceforge.net/project/pcre/pcre/$pcre_version/pcre-$pcre_version.tar.gz && Download_src
+src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_version.tar.gz && Download_src
 src_url=http://tengine.taobao.org/download/tengine-$tengine_version.tar.gz && Download_src
 
 tar xzf pcre-$pcre_version.tar.gz
@@ -95,7 +95,7 @@ sed -i "s@/data/wwwroot/default@$wwwroot_dir/default@" $tengine_install_dir/conf
 sed -i "s@/data/wwwlogs@$wwwlogs_dir@g" $tengine_install_dir/conf/nginx.conf
 sed -i "s@^user www www@user $run_user $run_user@" $tengine_install_dir/conf/nginx.conf
 [ "$je_tc_malloc" == '2' ] && sed -i 's@^pid\(.*\)@pid\1\ngoogle_perftools_profiles /tmp/tcmalloc;@' $tengine_install_dir/conf/nginx.conf 
-[ -z "`grep 'reuse_port on;' $tengine_install_dir/conf/nginx.conf`" ] && sed -i "s@worker_connections 51200;@worker_connections 51200;\n    reuse_port on;@" $tengine_install_dir/conf/nginx.conf
+uname -r | awk -F'.' '{if ($1$2>=39)S=0;else S=1}{exit S}' && [ -z "`grep 'reuse_port on;' $tengine_install_dir/conf/nginx.conf`" ] && sed -i "s@worker_connections 51200;@worker_connections 51200;\n    reuse_port on;@" $tengine_install_dir/conf/nginx.conf
 
 # worker_cpu_affinity
 sed -i "s@^worker_processes.*@worker_processes auto;\nworker_cpu_affinity auto;\ndso {\n\tload ngx_http_concat_module.so;\n\tload ngx_http_sysguard_module.so;\n}@" $tengine_install_dir/conf/nginx.conf

+ 11 - 0
src/libiconv-glibc-2.16.patch

@@ -0,0 +1,11 @@
+--- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300
++++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200
+@@ -695,7 +695,9 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
++ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ #endif

+ 2 - 2
tools/db_bk.sh

@@ -22,7 +22,7 @@ OldFile=$backup_dir/DB_${DBname}_$(date +%Y%m%d --date="$expired_days days ago")
 DB_tmp=`$db_install_dir/bin/mysql -uroot -p$dbrootpwd -e "show databases\G" | grep $DBname`
 [ -z "$DB_tmp" ] && { echo "[$DBname] not exist" >> $LogFile ;  exit 1 ; }
 
-if [ -e "$OldFile" ];then
+if [ -n "`ls $OldFile 2>/dev/null`" ];then
     /bin/rm -f $OldFile
     echo "[$OldFile] Delete Old File Success" >> $LogFile
 else
@@ -30,7 +30,7 @@ else
 fi
 
 if [ -e "$NewFile" ];then
-    echo "[$NewFile] The Backup File is exists,Can't Backup" >> $LogFile
+    echo "[$NewFile] The Backup File is exists, Can't Backup" >> $LogFile
 else
     $db_install_dir/bin/mysqldump -uroot -p$dbrootpwd --opt --databases $DBname > $DumpFile 
     cd $backup_dir

+ 23 - 4
tools/website_bk.sh

@@ -11,9 +11,28 @@
 . ../options.conf
 
 WebSite=$1
-LogFile=$backup_dir/website.log
-[ ! -e "$wwwroot_dir/$WebSite" ] && { echo "[$wwwroot_dir/$WebSite] not exist" >> $LogFile ;  exit 1 ; }
-
+LogFile=$backup_dir/web.log
+NewFile=$backup_dir/Web_${WebSite}_$(date +%Y%m%d_%H).tgz
+OldFile=$backup_dir/Web_${WebSite}_$(date +%Y%m%d --date="$expired_days days ago")*.tgz
 [ ! -e "$backup_dir" ] && mkdir -p $backup_dir
+[ ! -e "$wwwroot_dir/$WebSite" ] && { echo "[$wwwroot_dir/$WebSite] not exist" >> $LogFile ;  exit 1 ; }
 
-rsync -crazP --delete $wwwroot_dir/$WebSite $backup_dir
+if [ `du -sm "$wwwroot_dir/$WebSite" | awk '{print $1}'` -lt 1024 ];then
+    if [ -n "`ls $OldFile 2>/dev/null`" ];then
+        /bin/rm -f $OldFile
+        echo "[$OldFile] Delete Old File Success" >> $LogFile
+    else
+        echo "[$OldFile] Delete Old Backup File" >> $LogFile
+    fi
+    
+    if [ -e "$NewFile" ];then
+        echo "[$NewFile] The Backup File is exists, Can't Backup" >> $LogFile
+    else
+        cd $wwwroot_dir
+        tar czf $NewFile ./${WebSite} >> $LogFile 2>&1
+        echo "[$NewFile] Backup success ">> $LogFile
+        cd -
+    fi
+else
+    rsync -crazP --delete $wwwroot_dir/$WebSite $backup_dir
+fi