Parcourir la source

Update vhost.sh

lj2007331@gmail.com il y a 7 ans
Parent
commit
9a2c9efa9e
5 fichiers modifiés avec 16 ajouts et 14 suppressions
  1. 3 3
      README.md
  2. 1 1
      backup_setup.sh
  3. 2 2
      install.sh
  4. 1 1
      versions.txt
  5. 9 7
      vhost.sh

+ 3 - 3
README.md

@@ -6,18 +6,18 @@ Script properties:
 - Continually updated
 - Continually updated
 - Source compiler installation, most stable source is the latest version, and download from the official site
 - Source compiler installation, most stable source is the latest version, and download from the official site
 - Some security optimization
 - 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 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, PostgreSQL)
 - Providing multiple PHP versions (PHP-7.2, PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
 - Providing multiple PHP versions (PHP-7.2, PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
 - Provide Nginx, Tengine, OpenResty
 - Provide Nginx, Tengine, OpenResty
 - Providing a plurality of Tomcat version (Tomcat-8, Tomcat-7, Tomcat-6)
 - 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)
 - Providing a plurality of JDK version (JDK-1.8, JDK-1.7, JDK-1.6)
 - Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
 - Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
-- According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php encryption and decryption tool ionCube, ZendGuardLoader
+- According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php encryption and decryption tool ionCube, ZendGuardLoader, swoole, xdebug
 - Installation Pureftpd, phpMyAdmin according to their needs
 - Installation Pureftpd, phpMyAdmin according to their needs
 - Install memcached, redis according to their needs
 - Install memcached, redis according to their needs
 - Jemalloc optimize MySQL, Nginx
 - Jemalloc optimize MySQL, Nginx
 - Providing add a virtual host script, include Let's Encrypt SSL certificate
 - Providing add a virtual host script, include Let's Encrypt SSL certificate
-- Provide Nginx/Tengine/OpenResty, MySQL/MariaDB/Percona, PHP, Redis, Memcached, phpMyAdmin upgrade script
+- Provide Nginx/Tengine/OpenResty/Apache, MySQL/MariaDB/Percona, PHP, Redis, Memcached, phpMyAdmin upgrade script
 - Provide local backup and remote backup (rsync between servers) script
 - Provide local backup and remote backup (rsync between servers) script
 - Provided under HHVM install CentOS 6,7
 - Provided under HHVM install CentOS 6,7
 
 

+ 1 - 1
backup_setup.sh

@@ -155,7 +155,7 @@ if [[ "$DESC_BK" =~ ^[2,4,6]$ ]]; then
       [ -z "`grep $remote_ip tools/iplist.txt`" ] && echo "$remote_ip $remote_port $remote_user $remote_password" >> tools/iplist.txt || echo "${CWARNING}$remote_ip has been added! ${CEND}"
       [ -z "`grep $remote_ip tools/iplist.txt`" ] && echo "$remote_ip $remote_port $remote_user $remote_password" >> tools/iplist.txt || echo "${CWARNING}$remote_ip has been added! ${CEND}"
       while :; do
       while :; do
         read -p "Do you want to add more host ? [y/n]: " more_host_yn
         read -p "Do you want to add more host ? [y/n]: " more_host_yn
-        if [ "$more_host_yn" != 'y' -a "$more_host_yn" != 'n' ]; then
+        if [[ ! $more_host_yn =~ ^[y,n]$ ]]; then
           echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
           echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
         else
         else
           break
           break

+ 2 - 2
install.sh

@@ -190,7 +190,7 @@ while :; do echo
         echo -e "\t${CMSG}12${CEND}. Install PostgreSQL"
         echo -e "\t${CMSG}12${CEND}. Install PostgreSQL"
         read -p "Please input a number:(Default 2 press Enter) " DB_version
         read -p "Please input a number:(Default 2 press Enter) " DB_version
         [ -z "$DB_version" ] && DB_version=2
         [ -z "$DB_version" ] && DB_version=2
-        if [ ${DB_version} -ge 1 >/dev/null 2>&1 -a ${DB_version} -le 12 >/dev/null 2>&1 ]; then
+        if [[ "${DB_version}" =~ ^[1-9]$|^1[0-2]$ ]]; then 
           while :; do
           while :; do
             if [ "$DB_version" == '12' ]; then
             if [ "$DB_version" == '12' ]; then
               read -p "Please input the postgres password of database: " dbrootpwd
               read -p "Please input the postgres password of database: " dbrootpwd
@@ -207,7 +207,7 @@ while :; do echo
 
 
           done
           done
           # choose install methods
           # choose install methods
-          if [ ${DB_version} -ge 1 >/dev/null 2>&1 -a ${DB_version} -le 10 >/dev/null 2>&1 ]; then
+          if [[ "${DB_version}" =~ ^[1-9]$|^10$ ]]; then 
             while :; do echo
             while :; do echo
               echo "Please choose installation of the database:"
               echo "Please choose installation of the database:"
               echo -e "\t${CMSG}1${CEND}. Install database from binary package."
               echo -e "\t${CMSG}1${CEND}. Install database from binary package."

+ 1 - 1
versions.txt

@@ -27,7 +27,7 @@ mariadb100_version=10.0.33
 mariadb55_version=5.5.58
 mariadb55_version=5.5.58
 
 
 percona57_version=5.7.19-17
 percona57_version=5.7.19-17
-percona56_version=5.6.37-82.2
+percona56_version=5.6.38-83.0
 percona55_version=5.5.58-38.10
 percona55_version=5.5.58-38.10
 
 
 alisql56_version=5.6.32-7
 alisql56_version=5.6.32-7

+ 9 - 7
vhost.sh

@@ -167,13 +167,6 @@ If you enter '.', the field will be left blank.
     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
     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
     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   
     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   
   elif [ "${Domian_Mode}" == '3' ]; then
   elif [ "${Domian_Mode}" == '3' ]; then
-    PUBLIC_IPADDR=$(./include/get_public_ipaddr.py)
-    for D in ${domain} ${moredomainame}
-    do
-      Domain_IPADDR=$(ping ${D} -c1 | sed '1{s/[^(]*(//;s/).*//;q}')
-      [ "${PUBLIC_IPADDR%.*}" != "${Domain_IPADDR%.*}" ] && { echo; echo "${CFAILURE}DNS problem: NXDOMAIN looking up A for ${D}${CEND}"; echo; exit 1; }
-    done
-
     while :; do echo
     while :; do echo
       read -p "Please enter Administrator Email(example: admin@example.com): " Admin_Email
       read -p "Please enter Administrator Email(example: admin@example.com): " Admin_Email
       if [ -z "$(echo ${Admin_Email} | grep '.*@.*\..*')" ]; then
       if [ -z "$(echo ${Admin_Email} | grep '.*@.*\..*')" ]; then
@@ -335,6 +328,15 @@ What Are You Doing?
     Apache_Domain_alias=ServerAlias${moredomainame}
     Apache_Domain_alias=ServerAlias${moredomainame}
     Tomcat_Domain_alias=$(for D in $(echo ${moredomainame}); do echo "<Alias>${D}</Alias>"; done)
     Tomcat_Domain_alias=$(for D in $(echo ${moredomainame}); do echo "<Alias>${D}</Alias>"; done)
 
 
+    if [ "${Domian_Mode}" == '3' ]; then
+      PUBLIC_IPADDR=$(./include/get_public_ipaddr.py)
+      for D in ${domain} ${moredomainame}
+      do
+        Domain_IPADDR=$(ping ${D} -c1 2> /dev/null | sed '1{s/[^(]*(//;s/).*//;q}')
+        [ "${PUBLIC_IPADDR%.*}" != "${Domain_IPADDR%.*}" ] && { echo; echo "${CFAILURE}DNS problem: NXDOMAIN looking up A for ${D}${CEND}"; echo; exit 1; }
+      done
+    fi
+
     if [ -e "${web_install_dir}/sbin/nginx" ]; then
     if [ -e "${web_install_dir}/sbin/nginx" ]; then
       while :; do echo
       while :; do echo
         read -p "Do you want to redirect from ${moredomain} to ${domain}? [y/n]: " redirect_flag
         read -p "Do you want to redirect from ${moredomain} to ${domain}? [y/n]: " redirect_flag