Browse Source

Update versions.txt

lj2007331@gmail.com 7 years ago
parent
commit
c4708a2053
13 changed files with 114 additions and 112 deletions
  1. 1 0
      addons.sh
  2. 11 15
      backup.sh
  3. 4 1
      backup_setup.sh
  4. 1 1
      config/magento2.conf
  5. 25 24
      config/nginx.conf
  6. 28 27
      config/nginx_apache.conf
  7. 23 22
      config/nginx_tomcat.conf
  8. 1 2
      include/apache-2.4.sh
  9. 1 1
      include/check_download.sh
  10. 3 3
      include/check_os.sh
  11. 1 1
      include/redis.sh
  12. 8 8
      versions.txt
  13. 7 7
      vhost.sh

+ 1 - 0
addons.sh

@@ -128,6 +128,7 @@ Install_fail2ban() {
     LOGPATH=/var/log/secure
     /bin/cp files/redhat-initd /etc/init.d/fail2ban 
     sed -i "s@^FAIL2BAN=.*@FAIL2BAN=${python_install_dir}/bin/fail2ban-client@" /etc/init.d/fail2ban
+    sed -i 's@Starting fail2ban.*@&\n    [ ! -e "/var/run/fail2ban" ] \&\& mkdir /var/run/fail2ban@' /etc/init.d/fail2ban
     chmod +x /etc/init.d/fail2ban
     chkconfig --add fail2ban
     chkconfig fail2ban on

+ 11 - 15
backup.sh

@@ -69,45 +69,41 @@ WEB_COS_BK() {
   for W in `echo $website_name | tr ',' ' '`
   do
     [ ! -e "$wwwroot_dir/$WebSite" ] && { echo "[$wwwroot_dir/$WebSite] not exist"; break; }
-    Web_FILE="Web_${W}_$(date +%Y%m%d_%H).tgz"
-    if [ ! -e "$backup_dir/$Web_FILE" ];then
+    PUSH_FILE="$backup_dir/Web_${W}_$(date +%Y%m%d_%H).tgz"
+    if [ ! -e "$PUSH_FILE" ]; then
       pushd $wwwroot_dir
-      tar czf $Web_FILE ./$W
+      tar czf $PUSH_FILE ./$W
       popd
-      PUSH_FILE="$wwwroot_dir/$Web_FILE"
-    else
-      PUSH_FILE="$backup_dir/$Web_FILE"
     fi
-
-    ${python_install_dir}/bin/python ./coscmd put $PUSH_FILE /`date +%F`/$Web_FILE
-    [ $? -eq 0 ] && { [ -e "$wwwroot_dir/$Web_FILE" ] && rm -rf $wwwroot_dir/$Web_FILE; ${python_install_dir}/bin/python ./coscmd rm /`date +%F --date="$expired_days days ago"`/ > /dev/null 2>&1; }
+    ${python_install_dir}/bin/python ./coscmd put $PUSH_FILE /`date +%F`/Web_${W}_$(date +%Y%m%d_%H).tgz
+    [ $? -eq 0 ] && { [ -e "$PUSH_FILE" ] && rm -rf $PUSH_FILE; ${python_install_dir}/bin/python ./coscmd rm /`date +%F --date="$expired_days days ago"`/ > /dev/null 2>&1; }
   done
 }
 
-if [ "$backup_destination" == 'local' ];then
+if [ "$backup_destination" == 'local' ]; then
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Local_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Local_BK
-elif [ "$backup_destination" == 'remote' ];then
+elif [ "$backup_destination" == 'remote' ]; then
   echo "com:::[ ! -e "$backup_dir" ] && mkdir -p $backup_dir" > config_bakcup.txt
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Remote_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Remote_BK
   ./mabs.sh -c config_bakcup.txt -T -1 | tee mabs.log
-elif [ "$backup_destination" == 'cos' ];then
+elif [ "$backup_destination" == 'cos' ]; then
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_COS_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_COS_BK
-elif [ "$backup_destination" == 'local,remote' ];then
+elif [ "$backup_destination" == 'local,remote' ]; then
   echo "com:::[ ! -e "$backup_dir" ] && mkdir -p $backup_dir" > config_bakcup.txt
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Local_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Local_BK
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Remote_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Remote_BK
   ./mabs.sh -c config_bakcup.txt -T -1 | tee mabs.log	
-elif [ "$backup_destination" == 'local,cos' ];then
+elif [ "$backup_destination" == 'local,cos' ]; then
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Local_BK
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_COS_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Local_BK
   [ -n "`echo $backup_content | grep -ow web`" ] && WEB_COS_BK
-elif [ "$backup_destination" == 'remote,cos' ];then
+elif [ "$backup_destination" == 'remote,cos' ]; then
   echo "com:::[ ! -e "$backup_dir" ] && mkdir -p $backup_dir" > config_bakcup.txt
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_Remote_BK 
   [ -n "`echo $backup_content | grep -ow db`" ] && DB_COS_BK

+ 4 - 1
backup_setup.sh

@@ -17,11 +17,14 @@ printf "
 #       For more information please visit https://oneinstack.com      #
 #######################################################################
 "
+# get pwd
+sed -i "s@^oneinstack_dir.*@oneinstack_dir=$(pwd)@" ./options.conf
 
 . ./options.conf
 . ./versions.txt
 . ./include/color.sh
 . ./include/check_dir.sh
+. ./include/download.sh
 . ./include/python.sh
 
 # Check if user is root
@@ -108,7 +111,7 @@ if [ "$CONTENT_BK" != '2' ]; then
   sed -i "s@^db_name=.*@db_name=$db_name@" ./options.conf
 fi
 
-if [ "$CONTENT_BK" != '1' ];then
+if [ "$CONTENT_BK" != '1' ]; then
   websites=`ls $wwwroot_dir | grep -vw default`
   while :; do echo
     echo "Please enter one or more name for website, separate multiple website names with commas: "

+ 1 - 1
config/magento2.conf

@@ -6,7 +6,7 @@ server {
   index index.php;
   autoindex off;
   charset UTF-8;
-  error_page 404 403 = /errors/404.php;
+  error_page 404 403 /errors/404.php;
   #add_header "X-UA-Compatible" "IE=Edge";
   
   # PHP entry point for setup application

+ 25 - 24
config/nginx.conf

@@ -59,36 +59,37 @@ http {
 
 ######################## default ############################
   server {
-  listen 80;
-  server_name _;
-  access_log /data/wwwlogs/access_nginx.log combined;
-  root /data/wwwroot/default;
-  index index.html index.htm index.php;
-  location /nginx_status {
-    stub_status on;
-    access_log off;
-    allow 127.0.0.1;
-    deny all;
+    listen 80;
+    server_name _;
+    access_log /data/wwwlogs/access_nginx.log combined;
+    root /data/wwwroot/default;
+    index index.html index.htm index.php;
+    #error_page 404 /404.html;
+    #error_page 502 /502.html;
+    location /nginx_status {
+      stub_status on;
+      access_log off;
+      allow 127.0.0.1;
+      deny all;
     }
-  location ~ [^/]\.php(/|$) {
-    #fastcgi_pass remote_php_ip:9000;
-    fastcgi_pass unix:/dev/shm/php-cgi.sock;
-    fastcgi_index index.php;
-    include fastcgi.conf;
+    location ~ [^/]\.php(/|$) {
+      #fastcgi_pass remote_php_ip:9000;
+      fastcgi_pass unix:/dev/shm/php-cgi.sock;
+      fastcgi_index index.php;
+      include fastcgi.conf;
     }
-  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-    expires 30d;
-    access_log off;
+    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+      expires 30d;
+      access_log off;
     }
-  location ~ .*\.(js|css)?$ {
-    expires 7d;
-    access_log off;
+    location ~ .*\.(js|css)?$ {
+      expires 7d;
+      access_log off;
     }
-  location ~ /\.ht {
-    deny all;
+    location ~ /\.ht {
+      deny all;
     }
   }
-
 ########################## vhost #############################
   include vhost/*.conf;
 }

+ 28 - 27
config/nginx_apache.conf

@@ -59,41 +59,42 @@ http {
 
 ######################## default ############################
   server {
-  listen 80;
-  server_name _;
-  access_log /data/wwwlogs/access_nginx.log combined;
-  root /data/wwwroot/default;
-  index index.html index.htm index.php;
-  location /nginx_status {
-    stub_status on;
-    access_log off;
-    allow 127.0.0.1;
-    deny all;
+    listen 80;
+    server_name _;
+    access_log /data/wwwlogs/access_nginx.log combined;
+    root /data/wwwroot/default;
+    index index.html index.htm index.php;
+    #error_page 404 /404.html;
+    #error_page 502 /502.html;
+    location /nginx_status {
+      stub_status on;
+      access_log off;
+      allow 127.0.0.1;
+      deny all;
     }
-  location / {
-    try_files $uri @apache;
+    location / {
+      try_files $uri @apache;
     }
-  location @apache {
-    proxy_pass http://127.0.0.1:88;
-    include proxy.conf;
+    location @apache {
+      proxy_pass http://127.0.0.1:88;
+      include proxy.conf;
     }
-  location ~ [^/]\.php(/|$) {
-    proxy_pass http://127.0.0.1:88;
-    include proxy.conf;
+    location ~ [^/]\.php(/|$) {
+      proxy_pass http://127.0.0.1:88;
+      include proxy.conf;
     }
-  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-    expires 30d;
-    access_log off;
+    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+      expires 30d;
+      access_log off;
     }
-  location ~ .*\.(js|css)?$ {
-    expires 7d;
-    access_log off;
+    location ~ .*\.(js|css)?$ {
+      expires 7d;
+      access_log off;
     }
-  location ~ /\.ht {
-    deny all;
+    location ~ /\.ht {
+      deny all;
     }
   }
-
 ########################## vhost #############################
   include vhost/*.conf;
 }

+ 23 - 22
config/nginx_tomcat.conf

@@ -59,34 +59,35 @@ http {
 
 ######################## default ############################
   server {
-  listen 80;
-  server_name _;
-  access_log /data/wwwlogs/access_nginx.log combined;
-  root /data/wwwroot/default;
-  index index.html index.htm index.jsp;
-  location /nginx_status {
-    stub_status on;
-    access_log off;
-    allow 127.0.0.1;
-    deny all;
+    listen 80;
+    server_name _;
+    access_log /data/wwwlogs/access_nginx.log combined;
+    root /data/wwwroot/default;
+    index index.html index.htm index.jsp;
+    #error_page 404 /404.html;
+    #error_page 502 /502.html;
+    location /nginx_status {
+      stub_status on;
+      access_log off;
+      allow 127.0.0.1;
+      deny all;
     }
-  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-    expires 30d;
-    access_log off;
+    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+      expires 30d;
+      access_log off;
     }
-  location ~ .*\.(js|css)?$ {
-    expires 7d;
-    access_log off;
+    location ~ .*\.(js|css)?$ {
+      expires 7d;
+      access_log off;
     }
-  location ~ {
-    proxy_pass http://127.0.0.1:8080;
-    include proxy.conf;
+    location ~ {
+      proxy_pass http://127.0.0.1:8080;
+      include proxy.conf;
     }
-  location ~ /\.ht {
-    deny all;
+    location ~ /\.ht {
+      deny all;
     }
   }
-
 ########################## vhost #############################
   include vhost/*.conf;
 }

+ 1 - 2
include/apache-2.4.sh

@@ -140,13 +140,12 @@ EOF
 </IfModule>
 
 ProtocolsHonorOrder On
-Protocols h2 http/1.1
 PidFile /var/run/httpd.pid
 ServerTokens ProductOnly
 ServerSignature Off
 Include conf/vhost/*.conf
 EOF
-
+  [ "${Nginx_version}" == '4' -a ! -e "${web_install_dir}/sbin/nginx" ] && echo 'Protocols h2 http/1.1' >> ${apache_install_dir}/conf/httpd.conf
   if [ "${Nginx_version}" != '4' -o -e "${web_install_dir}/sbin/nginx" ]; then
     cat > ${apache_install_dir}/conf/extra/httpd-remoteip.conf << EOF
 LoadModule remoteip_module modules/mod_remoteip.so

+ 1 - 1
include/check_download.sh

@@ -216,7 +216,7 @@ checkDownload() {
         fi
         if [ "${dbInstallMethods}" == '1' ]; then
           echo "Download MySQL 5.5 binary package..."
-          FILE_NAME=mysql-${mysql55_version}-linux2.6-${SYS_BIT_b}.tar.gz
+          FILE_NAME=mysql-${mysql55_version}-linux-glibc2.5-${SYS_BIT_b}.tar.gz
         elif [ "${dbInstallMethods}" == '2' ]; then
           echo "Download MySQL 5.5 source package..."
           FILE_NAME=mysql-${mysql55_version}.tar.gz

+ 3 - 3
include/check_os.sh

@@ -10,9 +10,9 @@
 
 if [ -n "$(grep 'Aliyun Linux release' /etc/issue)" -o -e /etc/redhat-release ]; then
   OS=CentOS
-  [ -n "$(grep ' 7\.' /etc/redhat-release)" ] && CentOS_RHEL_version=7
-  [ -n "$(grep ' 6\.' /etc/redhat-release)" -o -n "$(grep 'Aliyun Linux release6 15' /etc/issue)" ] && CentOS_RHEL_version=6
-  [ -n "$(grep ' 5\.' /etc/redhat-release)" -o -n "$(grep 'Aliyun Linux release5' /etc/issue)" ] && CentOS_RHEL_version=5
+  [ -n "$(grep ' 7\.' /etc/redhat-release 2> /dev/null)" ] && CentOS_RHEL_version=7
+  [ -n "$(grep ' 6\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release6 15' /etc/issue)" ] && CentOS_RHEL_version=6
+  [ -n "$(grep ' 5\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release5' /etc/issue)" ] && CentOS_RHEL_version=5
 elif [ -n "$(grep 'Amazon Linux AMI release' /etc/issue)" -o -e /etc/system-release ]; then
   OS=CentOS
   CentOS_RHEL_version=6

+ 1 - 1
include/redis.sh

@@ -34,7 +34,7 @@ Install_redis-server() {
     rm -rf redis-${redis_version}
     id -u redis >/dev/null 2>&1
     [ $? -ne 0 ] && useradd -M -s /sbin/nologin redis
-    chown -R redis:redis ${redis_install_dir}/var
+    chown -R redis:redis ${redis_install_dir}/{var,etc}
     /bin/cp ../init.d/Redis-server-init /etc/init.d/redis-server
     if [ "$OS" == 'CentOS' ]; then
       cc start-stop-daemon.c -o /sbin/start-stop-daemon

+ 8 - 8
versions.txt

@@ -2,7 +2,7 @@
 # Web
 nginx_version=1.12.0
 tengine_version=2.1.2
-openresty_version=1.11.2.2
+openresty_version=1.11.2.3
 openssl_version=1.0.2k
 
 tomcat8_version=8.5.14
@@ -21,13 +21,13 @@ mysql57_version=5.7.18
 mysql56_version=5.6.36
 mysql55_version=5.5.55
 
-mariadb101_version=10.1.22
+mariadb101_version=10.1.23
 mariadb100_version=10.0.30
-mariadb55_version=5.5.54
+mariadb55_version=5.5.56
 
 percona57_version=5.7.17-13
 percona56_version=5.6.35-81.0
-percona55_version=5.5.54-38.7
+percona55_version=5.5.58-38.8
 
 alisql56_version=5.6.32-4
 
@@ -37,8 +37,8 @@ jdk17_version=1.7.0_80
 jdk16_version=1.6.0_45
 
 # PHP
-php71_version=7.1.4
-php70_version=7.0.18
+php71_version=7.1.5
+php70_version=7.0.19
 php56_version=5.6.30
 php55_version=5.5.38
 php54_version=5.4.45
@@ -48,14 +48,14 @@ zendopcache_version=7.0.5
 xcache_version=3.2.0
 apcu_version=4.0.11
 apcu_for_php7_version=5.1.8
-ImageMagick_version=6.9.8-3
+ImageMagick_version=6.9.8-4
 imagick_version=3.4.3
 imagick_for_php53_version=3.3.0
 GraphicsMagick_version=1.3.25
 gmagick_for_php7_version=2.0.4RC1
 gmagick_version=1.1.7RC3
 libiconv_version=1.15
-curl_version=7.53.1
+curl_version=7.54.0
 libmcrypt_version=2.5.8
 mcrypt_version=2.6.8
 mhash_version=0.9.9.9

+ 7 - 7
vhost.sh

@@ -482,8 +482,8 @@ server {
   index index.html index.htm index.jsp;
   root ${vhostdir};
   ${Nginx_redirect}
-  #error_page 404 = /404.html;
-  #error_page 502 = /502.html;
+  #error_page 404 /404.html;
+  #error_page 502 /502.html;
   ${anti_hotlinking}
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
     expires 30d;
@@ -500,7 +500,7 @@ server {
 }
 EOF
 
-  [ "${https_yn}" == 'y' ] && sed -i "s@^root.*;@&\nif (\$ssl_protocol = \"\") { return 301 https://\$server_name\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
+  [ "${https_yn}" == 'y' ] && sed -i "s@^root.*;@&\nif (\$ssl_protocol = \"\") { return 301 https://\$host\$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}
@@ -574,8 +574,8 @@ server {
   root ${vhostdir};
   ${Nginx_redirect}
   include ${web_install_dir}/conf/rewrite/${rewrite}.conf;
-  #error_page 404 = /404.html;
-  #error_page 502 = /502.html;
+  #error_page 404 /404.html;
+  #error_page 502 /502.html;
   ${anti_hotlinking}
   ${NGX_CONF}
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
@@ -626,7 +626,7 @@ EOF
     fi
   fi
 
-  [ "${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
+  [ "${https_yn}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$ssl_protocol = \"\") { return 301 https://\$host\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
   echo
   ${web_install_dir}/sbin/nginx -t
@@ -773,7 +773,7 @@ server {
 }
 EOF
 
-  [ "${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
+  [ "${https_yn}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$ssl_protocol = \"\") { return 301 https://\$host\$request_uri; }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
   echo
   ${web_install_dir}/sbin/nginx -t