Browse Source

Update uninstall.sh

lj2007331@gmail.com 7 years ago
parent
commit
6ba10a1520
10 changed files with 79 additions and 37 deletions
  1. 0 1
      addons.sh
  2. 2 2
      include/apache-2.2.sh
  3. 2 1
      include/apache-2.4.sh
  4. 1 1
      include/init_CentOS.sh
  5. 4 4
      include/init_Debian.sh
  6. 4 4
      include/init_Ubuntu.sh
  7. 1 1
      include/openssl.sh
  8. 63 21
      uninstall.sh
  9. 1 1
      versions.txt
  10. 1 1
      vhost.sh

+ 0 - 1
addons.sh

@@ -225,7 +225,6 @@ What Are You Doing?
   else
     case "${Number}" in
       1)
-        [ "$"]
         ACTION_FUN
         while :; do echo
           echo "Please select a opcode cache of the PHP:"

+ 2 - 2
include/apache-2.2.sh

@@ -32,7 +32,7 @@ Install_Apache22() {
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${apache_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${apache_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${apache_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+  sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
   /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd
@@ -77,7 +77,7 @@ EOF
   cat > ${apache_install_dir}/conf/vhost/0.conf << EOF
 NameVirtualHost *:$TMP_PORT
 <VirtualHost *:$TMP_PORT>
-  ServerAdmin admin@linuxeye.com
+  ServerAdmin admin@example.com
   DocumentRoot "$wwwroot_dir/default"
   ServerName 127.0.0.1
   ErrorLog "$wwwlogs_dir/error_apache.log"

+ 2 - 1
include/apache-2.4.sh

@@ -53,6 +53,7 @@ Install_Apache24() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${apache_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${apache_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
   
+  sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
   /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd
@@ -103,7 +104,7 @@ EOF
   mkdir ${apache_install_dir}/conf/vhost
   cat > ${apache_install_dir}/conf/vhost/0.conf << EOF
 <VirtualHost *:$TMP_PORT>
-  ServerAdmin admin@linuxeye.com
+  ServerAdmin admin@example.com
   DocumentRoot "$wwwroot_dir/default"
   ServerName 127.0.0.1 
   ErrorLog "$wwwlogs_dir/error_apache.log"

+ 1 - 1
include/init_CentOS.sh

@@ -77,7 +77,7 @@ net.ipv4.tcp_sack = 1
 net.ipv4.tcp_window_scaling = 1
 net.ipv4.tcp_rmem = 4096 87380 4194304
 net.ipv4.tcp_wmem = 4096 16384 4194304
-net.ipv4.tcp_max_syn_backlog = 65536
+net.ipv4.tcp_max_syn_backlog = 16384 
 net.core.netdev_max_backlog = 32768
 net.core.somaxconn = 32768
 net.core.wmem_default = 8388608

+ 4 - 4
include/init_Debian.sh

@@ -68,15 +68,15 @@ net.ipv4.tcp_syncookies = 1
 net.ipv4.tcp_fin_timeout = 30
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_max_syn_backlog = 65536
+net.ipv4.tcp_max_syn_backlog = 16384 
 net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
-net.core.somaxconn = 65535
-net.core.netdev_max_backlog = 262144
+net.core.somaxconn = 32768 
+net.core.netdev_max_backlog = 32768 
 net.ipv4.tcp_timestamps = 0
-net.ipv4.tcp_max_orphans = 262144
+net.ipv4.tcp_max_orphans = 32768
 EOF
 sysctl -p
 

+ 4 - 4
include/init_Ubuntu.sh

@@ -70,15 +70,15 @@ net.ipv4.tcp_syncookies = 1
 net.ipv4.tcp_fin_timeout = 30
 net.ipv4.tcp_tw_reuse = 1
 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_max_syn_backlog = 65536
+net.ipv4.tcp_max_syn_backlog = 16384 
 net.ipv4.tcp_max_tw_buckets = 6000
 net.ipv4.route.gc_timeout = 100
 net.ipv4.tcp_syn_retries = 1
 net.ipv4.tcp_synack_retries = 1
-net.core.somaxconn = 65535
-net.core.netdev_max_backlog = 262144
+net.core.somaxconn = 32768 
+net.core.netdev_max_backlog = 32768 
 net.ipv4.tcp_timestamps = 0
-net.ipv4.tcp_max_orphans = 262144
+net.ipv4.tcp_max_orphans = 32768 
 EOF
 sysctl -p
 

+ 1 - 1
include/openssl.sh

@@ -24,7 +24,7 @@ Install_openSSL102() {
     if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
       echo "${CSUCCESS}openssl-1.0.2 module installed successfully! ${CEND}"
       /bin/cp cacert.pem ${openssl_install_dir}/ssl/cert.pem
-      echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/z.openssl.conf
+      echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/openssl.conf
       ldconfig
       rm -rf openssl-${openssl_version}
     else

+ 63 - 21
uninstall.sh

@@ -29,10 +29,12 @@ printf "
 
 Usage(){
   printf "
-Usage: $0 [  ${CMSG}all${CEND} | ${CMSG}web${CEND} | ${CMSG}db${CEND} | ${CMSG}php${CEND} | ${CMSG}hhvm${CEND} | ${CMSG}pureftpd${CEND} | ${CMSG}redis${CEND} | ${CMSG}memcached${CEND} ]
+Usage: $0 [  ${CMSG}all${CEND} | ${CMSG}web${CEND} | ${CMSG}mysql${CEND} | ${CMSG}postgresql${CEND} | ${CMSG}mongodb${CEND} | ${CMSG}php${CEND} | ${CMSG}hhvm${CEND} | ${CMSG}pureftpd${CEND} | ${CMSG}redis${CEND} | ${CMSG}memcached${CEND} ]
 ${CMSG}all${CEND}            --->Uninstall All
 ${CMSG}web${CEND}            --->Uninstall Nginx/Tengine/Apache/Tomcat
-${CMSG}db${CEND}             --->Uninstall MySQL/MariaDB/Percona/AliSQL/PostgreSQL/MongoDB
+${CMSG}mysql${CEND}          --->Uninstall MySQL/MariaDB/Percona/AliSQL
+${CMSG}postgresql${CEND}     --->Uninstall PostgreSQL
+${CMSG}mongodb${CEND}        --->Uninstall MongoDB
 ${CMSG}php${CEND}            --->Uninstall PHP
 ${CMSG}hhvm${CEND}           --->Uninstall HHVM
 ${CMSG}pureftpd${CEND}       --->Uninstall PureFtpd
@@ -101,7 +103,7 @@ Print_DB() {
   [ -e "/etc/init.d/mongod" ] && echo "/etc/init.d/mongod"
 }
 
-Uninstall_DB() {
+Uninstall_MySQL() {
   # uninstall mysql,mariadb,percona,alisql 
   if [ -d "${db_install_dir}/support-files" ];then
     service mysqld stop > /dev/null 2>&1
@@ -110,7 +112,12 @@ Uninstall_DB() {
     [ -e "${db_data_dir}" ] && /bin/mv ${db_data_dir}{,$(date +%Y%m%d%H)}
     sed -i 's@^dbrootpwd=.*@dbrootpwd=@' ./options.conf
     sed -i "s@${db_install_dir}/bin:@@" /etc/profile
+  else
+    echo "${CWARNING}MySQL already uninstalled! ${CEND}"
   fi
+}
+
+Uninstall_PostgreSQL() {
   # uninstall postgresql
   if [ -e "${pgsql_install_dir}/bin/psql" ]; then
     service postgresql stop > /dev/null 2>&1
@@ -120,7 +127,12 @@ Uninstall_DB() {
     sed -i 's@^dbpostgrespwd=.*@dbpostgrespwd=@' ./options.conf
     sed -i "s@${pgsql_install_dir}/bin:@@" /etc/profile
     echo "${CMSG}PostgreSQL uninstall completed${CEND}"
+  else
+    echo "${CWARNING}PostgreSQL already uninstalled! ${CEND}"
   fi
+}
+
+Uninstall_MongoDB() {
   # uninstall mongodb 
   if [ -e "${mongo_install_dir}/bin/mongo" ]; then
     service mongod stop > /dev/null 2>&1
@@ -130,6 +142,8 @@ Uninstall_DB() {
     sed -i 's@^dbmongopwd=.*@dbmongopwd=@' ./options.conf
     sed -i "s@${mongo_install_dir}/bin:@@" /etc/profile
     echo "${CMSG}MongoDB uninstall completed${CEND}"
+  else
+    echo "${CWARNING}MongoDB already uninstalled! ${CEND}"
   fi
 }
 
@@ -204,7 +218,7 @@ Print_curlopenssl() {
 
 Uninstall_curlopenssl() {
   [ -e "/usr/local/bin/curl" ] && rm -rf /usr/local/lib/libcurl* /usr/local/bin/curl
-  [ -d "${openssl_install_dir}" ] && { rm -rf ${openssl_install_dir} /etc/ld.so.conf.d/z.openssl.conf; ldconfig; }
+  [ -d "${openssl_install_dir}" ] && { rm -rf ${openssl_install_dir} /etc/ld.so.conf.d/openssl.conf; ldconfig; }
 }
 
 Menu(){
@@ -213,18 +227,20 @@ while :; do
 What Are You Doing?
 \t${CMSG}0${CEND}. Uninstall All
 \t${CMSG}1${CEND}. Uninstall Nginx/Tengine/Apache/Tomcat
-\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona/AliSQL/PostgreSQL/MongoDB
-\t${CMSG}3${CEND}. Uninstall PHP
-\t${CMSG}4${CEND}. Uninstall HHVM
-\t${CMSG}5${CEND}. Uninstall PureFtpd
-\t${CMSG}6${CEND}. Uninstall Redis
-\t${CMSG}7${CEND}. Uninstall Memcached
+\t${CMSG}2${CEND}. Uninstall MySQL/MariaDB/Percona/AliSQL
+\t${CMSG}3${CEND}. Uninstall PostgreSQL 
+\t${CMSG}4${CEND}. Uninstall MongoDB 
+\t${CMSG}5${CEND}. Uninstall PHP
+\t${CMSG}6${CEND}. Uninstall HHVM
+\t${CMSG}7${CEND}. Uninstall PureFtpd
+\t${CMSG}8${CEND}. Uninstall Redis
+\t${CMSG}9${CEND}. Uninstall Memcached
 \t${CMSG}q${CEND}. Exit
 "
   echo
   read -p "Please input the correct option: " Number
-  if [[ ! $Number =~ ^[0-7,q]$ ]]; then
-    echo "${CWARNING}input error! Please only input 0~7 and q${CEND}"
+  if [[ ! $Number =~ ^[0-9,q]$ ]]; then
+    echo "${CWARNING}input error! Please only input 0~9 and q${CEND}"
   else
     case "$Number" in
     0)
@@ -241,7 +257,9 @@ What Are You Doing?
       Uninstall_status
       if [ "${uninstall_yn}" == 'y' ]; then
         Uninstall_Web
-        Uninstall_DB
+        Uninstall_MySQL
+        Uninstall_PostgreSQL
+        Uninstall_MongoDB 
         Uninstall_PHP
         Uninstall_HHVM
         Uninstall_PureFtpd
@@ -262,29 +280,41 @@ What Are You Doing?
       Print_Warn
       Print_DB
       Uninstall_status
-      [ "${uninstall_yn}" == 'y' ] && Uninstall_DB || exit
+      [ "${uninstall_yn}" == 'y' ] && Uninstall_MySQL || exit
       ;;
     3)
+      Print_Warn
+      Print_DB
+      Uninstall_status
+      [ "${uninstall_yn}" == 'y' ] && Uninstall_PostgreSQL || exit
+      ;;
+    4)
+      Print_Warn
+      Print_DB
+      Uninstall_status
+      [ "${uninstall_yn}" == 'y' ] && Uninstall_MongoDB || exit
+      ;;
+    5)
       Print_PHP
       Uninstall_status
       [ "${uninstall_yn}" == 'y' ] && Uninstall_PHP || exit
       ;;
-    4)
+    6)
       Print_HHVM
       Uninstall_status
       [ "${uninstall_yn}" == 'y' ] && Uninstall_HHVM || exit
       ;;
-    5)
+    7)
       Print_PureFtpd
       Uninstall_status
       [ "${uninstall_yn}" == 'y' ] && Uninstall_PureFtpd || exit
       ;;
-    6)
+    8)
       Print_Redis
       Uninstall_status
       [ "${uninstall_yn}" == 'y' ] && Uninstall_Redis || exit
       ;;
-    7)
+    9)
       Print_Memcached
       Uninstall_status
       [ "${uninstall_yn}" == 'y' ] && Uninstall_Memcached || exit
@@ -315,7 +345,7 @@ elif [ $# == 1 ]; then
     Uninstall_status
     if [ "${uninstall_yn}" == 'y' ]; then
       Uninstall_Web
-      Uninstall_DB
+      Uninstall_MySQL
       Uninstall_PHP
       Uninstall_HHVM
       Uninstall_PureFtpd
@@ -332,11 +362,23 @@ elif [ $# == 1 ]; then
     Uninstall_status
     [ "${uninstall_yn}" == 'y' ] && Uninstall_Web || exit
     ;;
-  db)
+  mysql)
+    Print_Warn
+    Print_DB
+    Uninstall_status
+    [ "${uninstall_yn}" == 'y' ] && Uninstall_MySQL || exit
+    ;;
+  postgresql)
+    Print_Warn
+    Print_DB
+    Uninstall_status
+    [ "${uninstall_yn}" == 'y' ] && Uninstall_PostgreSQL || exit
+    ;;
+  mongodb)
     Print_Warn
     Print_DB
     Uninstall_status
-    [ "${uninstall_yn}" == 'y' ] && Uninstall_DB || exit
+    [ "${uninstall_yn}" == 'y' ] && Uninstall_MongoDB || exit
     ;;
   php)
     Print_PHP

+ 1 - 1
versions.txt

@@ -55,7 +55,7 @@ curl_version=7.57.0
 libmcrypt_version=2.5.8
 mcrypt_version=2.6.8
 mhash_version=0.9.9.9
-ImageMagick_version=6.9.9-26
+ImageMagick_version=6.9.9-27
 imagick_version=3.4.3
 GraphicsMagick_version=1.3.26
 gmagick_for_php7_version=2.0.4RC1

+ 1 - 1
vhost.sh

@@ -400,7 +400,7 @@ Nginx_anti_hotlinking() {
     else
       domain_allow_all=${domain_allow}
     fi
-    anti_hotlinking=$(echo -e "location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv|mp4)$ {\n    valid_referers none blocked ${domain_allow_all};\n    if (\$invalid_referer) {\n        rewrite ^/ http://www.linuxeye.com/403.html;\n        return 403;\n    }\n  }")
+    anti_hotlinking=$(echo -e "location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv|mp4)$ {\n    valid_referers none blocked ${domain_allow_all};\n    if (\$invalid_referer) {\n        return 403;\n    }\n  }")
   else
     anti_hotlinking=
   fi