Browse Source

[fix] Update vhost.sh

lj2007331@gmail.com 3 years ago
parent
commit
dc828d84db
5 changed files with 43 additions and 59 deletions
  1. 7 8
      include/check_download.sh
  2. 2 2
      include/demo.sh
  3. 18 18
      install.sh
  4. 12 12
      versions.txt
  5. 4 19
      vhost.sh

+ 7 - 8
include/check_download.sh

@@ -563,14 +563,6 @@ checkDownload() {
       fi
       ;;
     2)
-      if [[ "${php_option}" =~ ^[1-4]$ ]]; then
-        # php 5.3 5.4 5.5 5.6
-        echo "Download xcache..."
-        src_url=http://xcache.lighttpd.net/pub/Releases/${xcache_ver}/xcache-${xcache_ver}.tar.gz && Download_src
-      fi
-      ;;
-    3)
-      # php 5.3 ~ 7.4
       echo "Download apcu..."
       if [[ "${php_option}" =~ ^[1-4]$ ]]; then
         src_url=https://pecl.php.net/get/apcu-${apcu_oldver}.tgz && Download_src
@@ -578,6 +570,13 @@ checkDownload() {
         src_url=https://pecl.php.net/get/apcu-${apcu_ver}.tgz && Download_src
       fi
       ;;
+    3)
+      if [[ "${php_option}" =~ ^[1-4]$ ]]; then
+        # php 5.3 5.4 5.5 5.6
+        echo "Download xcache..."
+        src_url=http://xcache.lighttpd.net/pub/Releases/${xcache_ver}/xcache-${xcache_ver}.tar.gz && Download_src
+      fi
+      ;;
     4)
       # php 5.3 5.4
       if [ "${php_option}" == '1' ]; then

+ 2 - 2
include/demo.sh

@@ -25,10 +25,10 @@ DEMO() {
         /bin/cp ocp.php ${wwwroot_dir}/default
         ;;
       2)
-        sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/xcache" target="_blank" class="links">xcache</a>@' ${wwwroot_dir}/default/index.html
+        sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/apc.php" target="_blank" class="links">APC</a>@' ${wwwroot_dir}/default/index.html
         ;;
       3)
-        sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/apc.php" target="_blank" class="links">APC</a>@' ${wwwroot_dir}/default/index.html
+        sed -i 's@<a href="/ocp.php" target="_blank" class="links">Opcache</a>@<a href="/xcache" target="_blank" class="links">xcache</a>@' ${wwwroot_dir}/default/index.html
         ;;
       4)
         /bin/cp eaccelerator-*/control.php ${wwwroot_dir}/default

+ 18 - 18
install.sh

@@ -510,8 +510,8 @@ if [ ${ARG_NUM} == 0 ]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
-              echo -e "\t${CMSG}2${CEND}. Install XCache"
-              echo -e "\t${CMSG}3${CEND}. Install APCU"
+              echo -e "\t${CMSG}2${CEND}. Install APCU"
+              echo -e "\t${CMSG}3${CEND}. Install XCache"
               echo -e "\t${CMSG}4${CEND}. Install eAccelerator-0.9"
               read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
               phpcache_option=${phpcache_option:-1}
@@ -526,8 +526,8 @@ if [ ${ARG_NUM} == 0 ]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
-              echo -e "\t${CMSG}2${CEND}. Install XCache"
-              echo -e "\t${CMSG}3${CEND}. Install APCU"
+              echo -e "\t${CMSG}2${CEND}. Install APCU"
+              echo -e "\t${CMSG}3${CEND}. Install XCache"
               echo -e "\t${CMSG}4${CEND}. Install eAccelerator-1.0-dev"
               read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
               phpcache_option=${phpcache_option:-1}
@@ -542,8 +542,8 @@ if [ ${ARG_NUM} == 0 ]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
-              echo -e "\t${CMSG}2${CEND}. Install XCache"
-              echo -e "\t${CMSG}3${CEND}. Install APCU"
+              echo -e "\t${CMSG}2${CEND}. Install APCU"
+              echo -e "\t${CMSG}3${CEND}. Install XCache"
               read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
               phpcache_option=${phpcache_option:-1}
               if [[ ! ${phpcache_option} =~ ^[1-3]$ ]]; then
@@ -572,11 +572,11 @@ if [ ${ARG_NUM} == 0 ]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
-              echo -e "\t${CMSG}3${CEND}. Install APCU"
+              echo -e "\t${CMSG}2${CEND}. Install APCU"
               read -e -p "Please input a number:(Default 1 press Enter) " phpcache_option
               phpcache_option=${phpcache_option:-1}
-              if [[ ! ${phpcache_option} =~ ^[1,3]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 1,3${CEND}"
+              if [[ ! ${phpcache_option} =~ ^[1-2]$ ]]; then
+                echo "${CWARNING}input error! Please only input number 1~2${CEND}"
               else
                 break
               fi
@@ -587,7 +587,7 @@ if [ ${ARG_NUM} == 0 ]; then
       fi
     done
     # set xcache passwd
-    if [ "${phpcache_option}" == '2' ]; then
+    if [ "${phpcache_option}" == '3' ]; then
       while :; do
         read -e -p "Please input xcache admin password: " xcachepwd
         (( ${#xcachepwd} >= 5 )) && { xcachepwd_md5=$(echo -n "${xcachepwd}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
@@ -919,13 +919,13 @@ PHP_addons() {
       Install_ZendOPcache 2>&1 | tee -a ${oneinstack_dir}/install.log
       ;;
     2)
-      . include/xcache.sh
-      Install_XCache 2>&1 | tee -a ${oneinstack_dir}/install.log
-      ;;
-    3)
       . include/apcu.sh
       Install_APCU 2>&1 | tee -a ${oneinstack_dir}/install.log
       ;;
+    3)
+      . include/xcache.sh
+      Install_XCache 2>&1 | tee -a ${oneinstack_dir}/install.log
+      ;;
     4)
       . include/eaccelerator.sh
       Install_eAccelerator 2>&1 | tee -a ${oneinstack_dir}/install.log
@@ -1172,10 +1172,10 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${db_option}" == '14' ] && echo "$(printf "%-32s" "MongoDB password:")${CMSG}${dbmongopwd}${CEND}"
 [[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
 [ "${phpcache_option}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel URL:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
-[ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache Control Panel URL:")${CMSG}http://${IPADDR}/xcache${CEND}"
-[ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache user:")${CMSG}admin${CEND}"
-[ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache password:")${CMSG}${xcachepwd}${CEND}"
-[ "${phpcache_option}" == '3' ] && echo "$(printf "%-32s" "APC Control Panel URL:")${CMSG}http://${IPADDR}/apc.php${CEND}"
+[ "${phpcache_option}" == '2' ] && echo "$(printf "%-32s" "APC Control Panel URL:")${CMSG}http://${IPADDR}/apc.php${CEND}"
+[ "${phpcache_option}" == '3' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache Control Panel URL:")${CMSG}http://${IPADDR}/xcache${CEND}"
+[ "${phpcache_option}" == '3' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache user:")${CMSG}admin${CEND}"
+[ "${phpcache_option}" == '3' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache password:")${CMSG}${xcachepwd}${CEND}"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator Control Panel URL:")${CMSG}http://${IPADDR}/control.php${CEND}"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator user:")${CMSG}admin${CEND}"
 [ "${phpcache_option}" == '4' -a -e "${php_install_dir}/etc/php.d/02-eaccelerator.ini" ] && echo "$(printf "%-32s" "eAccelerator password:")${CMSG}eAccelerator${CEND}"

+ 12 - 12
versions.txt

@@ -6,12 +6,12 @@ openresty_ver=1.19.9.1
 openssl11_ver=1.1.1k
 openssl_ver=1.0.2u
 
-tomcat10_ver=10.0.11
-tomcat9_ver=9.0.53
-tomcat8_ver=8.5.71
+tomcat10_ver=10.0.12
+tomcat9_ver=9.0.54
+tomcat8_ver=8.5.72
 tomcat7_ver=7.0.109
 
-apache_ver=2.4.49
+apache_ver=2.4.51
 pcre_ver=8.45
 apr_ver=1.7.0
 apr_util_ver=1.6.1
@@ -54,10 +54,10 @@ php72_ver=7.2.34
 php73_ver=7.3.31
 php74_ver=7.4.24
 php80_ver=8.0.11
-php81_ver=8.1.0RC3
+php81_ver=8.1.0RC4
 
 # Nodejs
-node_ver=14.17.6
+node_ver=14.18.1
 
 libiconv_ver=1.16
 curl_ver=7.79.1
@@ -69,16 +69,16 @@ icu4c_ver=63_1
 libsodium_ver=1.0.18
 libzip_ver=1.2.0
 argon2_ver=20171227
-imagemagick_ver=7.1.0-8
+imagemagick_ver=7.1.0-10
 imagick_ver=3.5.1
 imagick_oldver=3.4.4
 graphicsmagick_ver=1.3.36
 gmagick_ver=2.0.6RC1
 gmagick_oldver=1.1.7RC3
 zendopcache_ver=7.0.5
-xcache_ver=3.2.0
-apcu_ver=5.1.20
+apcu_ver=5.1.21
 apcu_oldver=4.0.11
+xcache_ver=3.2.0
 eaccelerator_ver=0.9.6.1
 phalcon_ver=4.1.2
 phalcon_oldver=3.4.5
@@ -93,13 +93,13 @@ xdebug_oldver=2.9.8
 pureftpd_ver=1.0.49
 
 # Redis
-redis_ver=6.2.5
-redis_oldver=5.0.9
+redis_ver=6.2.6
+redis_oldver=5.0.14
 pecl_redis_ver=5.3.4
 pecl_redis_oldver=4.3.0
 
 # Memcached
-memcached_ver=1.6.10
+memcached_ver=1.6.12
 libmemcached_ver=1.0.18
 pecl_memcached_ver=3.1.5
 pecl_memcached_oldver=2.2.0

+ 4 - 19
vhost.sh

@@ -111,7 +111,7 @@ Choose_ENV() {
     [ "$(${apache_install_dir}/bin/apachectl -v | awk -F'.' /version/'{print $2}')" == '4' ] && { Apache_main_ver=24; Apache_grant='Require all granted'; }
     [ "$(${apache_install_dir}/bin/apachectl -v | awk -F'.' /version/'{print $2}')" == '2' ] && Apache_main_ver=22
   fi
-  if [ -e "${php_install_dir}/bin/phpize" -a -e "${tomcat_install_dir}/conf/server.xml" ]; then
+  if [ -e "${php_install_dir}/bin/phpize" -a -e "${tomcat_install_dir}/conf/server.xml" ] && [[ -z ${proxy_flag} || "${proxy_flag}" != 'y' ]]; then
     Number=11
     while :; do echo
       echo "Please choose to use environment:"
@@ -486,7 +486,7 @@ What Are You Doing?
       Nginx_conf=$(echo -e "listen 80;\n  listen ${LISTENOPT};\n  ssl_certificate ${PATH_SSL}/${domain}.crt;\n  ssl_certificate_key ${PATH_SSL}/${domain}.key;\n  ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;\n  ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;\n  ssl_prefer_server_ciphers on;\n  ssl_session_timeout 10m;\n  ssl_session_cache builtin:1000 shared:SSL:10m;\n  ssl_buffer_size 1400;\n  add_header Strict-Transport-Security max-age=15768000;\n  ssl_stapling on;\n  ssl_stapling_verify on;\n")
     fi
     Apache_SSL=$(echo -e "SSLEngine on\n  SSLCertificateFile \"${PATH_SSL}/${domain}.crt\"\n  SSLCertificateKeyFile \"${PATH_SSL}/${domain}.key\"")
-  elif [ "$apache_ssl_flag" == 'y' ]; then
+  elif [ "${apache_ssl_flag}" == 'y' ]; then
     Create_SSL
     Apache_SSL=$(echo -e "SSLEngine on\n  SSLCertificateFile \"${PATH_SSL}/${domain}.crt\"\n  SSLCertificateKeyFile \"${PATH_SSL}/${domain}.key\"")
     [ -z "$(grep 'Listen 443' ${apache_install_dir}/conf/httpd.conf)" ] && sed -i "s@Listen 80@&\nListen 443@" ${apache_install_dir}/conf/httpd.conf
@@ -804,21 +804,6 @@ EOF
 
   [ "${redirect_flag}" == 'y' ] && sed -i "s@^  root.*;@&\n  if (\$host != ${domain}) {  return 301 \$scheme://${domain}\$request_uri;  }@" ${web_install_dir}/conf/vhost/${domain}.conf
 
-  if [ "${nginx_ssl_flag}" == 'y' ]; then
-    sed -i "s@^  listen 80;@&\n  listen ${LISTENOPT};@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_stapling_verify on;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_stapling on;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  add_header Strict-Transport-Security max-age=15768000;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_buffer_size 1400;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_session_cache builtin:1000 shared:SSL:10m;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_session_timeout 10m;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_prefer_server_ciphers on;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:\!MD5;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_certificate_key ${PATH_SSL}/${domain}.key;@" ${web_install_dir}/conf/vhost/${domain}.conf
-    sed -i "s@^  server_name.*;@&\n  ssl_certificate ${PATH_SSL}/${domain}.crt;@" ${web_install_dir}/conf/vhost/${domain}.conf
-  fi
-
   if [ "${anti_hotlinking_flag}" == 'y' ]; then
       sed -i "s@^  root.*;@&\n  }@" ${web_install_dir}/conf/vhost/${domain}.conf
       sed -i "s@^  root.*;@&\n    }@" ${web_install_dir}/conf/vhost/${domain}.conf
@@ -850,7 +835,7 @@ EOF
 "
   echo "$(printf "%-30s" "Your domain:")${CMSG}${domain}${CEND}"
   echo "$(printf "%-30s" "Virtualhost conf:")${CMSG}${web_install_dir}/conf/vhost/${domain}.conf${CEND}"
-  echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
+  #echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
   [ "${rewrite_flag}" == 'y' -a "${rewrite}" != 'magento2' -a "${rewrite}" != 'pathinfo' ] && echo "$(printf "%-30s" "Rewrite rule:")${CMSG}${web_install_dir}/conf/rewrite/${rewrite}.conf${CEND}"
   Print_SSL
 }
@@ -900,7 +885,7 @@ Create_apache_conf() {
 </Directory>
 </VirtualHost>
 EOF
-  [ "$apache_ssl_flag" == 'y' ] && cat >> ${apache_install_dir}/conf/vhost/${domain}.conf << EOF
+  [ "${apache_ssl_flag}" == 'y' ] && cat >> ${apache_install_dir}/conf/vhost/${domain}.conf << EOF
 <VirtualHost *:443>
   ServerAdmin admin@example.com
   DocumentRoot "${vhostdir}"