Quellcode durchsuchen

feat:add caddy and LCNM stack

oneinstack vor 1 Jahr
Ursprung
Commit
2d813853b0
9 geänderte Dateien mit 512 neuen und 254 gelöschten Zeilen
  1. 1 1
      README.md
  2. 26 0
      config/Caddyfile
  3. 55 0
      include/caddy.sh
  4. 16 12
      include/check_download.sh
  5. 19 0
      init.d/caddy.service
  6. 386 239
      install.sh
  7. 1 0
      options.conf
  8. 7 2
      uninstall.sh
  9. 1 0
      versions.txt

+ 1 - 1
README.md

@@ -6,7 +6,7 @@ Script properties:
 - Some security optimization
 - Providing a plurality of database versions (MySQL-8.0, MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.11, MariaDB-10.5, MariaDB-10.4, MariaDB-5.5, Percona-8.0, Percona-5.7, Percona-5.6, Percona-5.5, PostgreSQL, MongoDB)
 - Providing multiple PHP versions (PHP-8.3, PHP-8.2, PHP-8.1, PHP-8.0, PHP-7.4, PHP-7.3, 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, Apache and ngx_lua_waf
+- Provide Nginx, Tengine, OpenResty, Caddy, Apache and ngx_lua_waf
 - Providing a plurality of Tomcat version (Tomcat-10, Tomcat-9, Tomcat-8, Tomcat-7)
 - Providing a plurality of JDK version (OpenJDK-8, OpenJDK-11, OpenJDK-17)
 - According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php extensions,include ZendGuardLoader,ionCube,SourceGuardian,imagick,gmagick,fileinfo,imap,ldap,calendar,phalcon,yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug

+ 26 - 0
config/Caddyfile

@@ -0,0 +1,26 @@
+# The Caddyfile is an easy way to configure your Caddy web server.
+#
+# Unless the file starts with a global options block, the first
+# uncommented line is always the address of your site.
+#
+# To use your own domain name (with automatic HTTPS), first make
+# sure your domain's A/AAAA DNS records are properly pointed to
+# this machine's public IP, then replace ":80" below with your
+# domain name.
+
+:80 {
+	# Set this path to your site's directory.
+	root * /data/wwwroot/default
+
+	# Enable the static file server.
+	file_server
+
+	# Another common task is to set up a reverse proxy:
+	# reverse_proxy localhost:8080
+
+	# Or serve a PHP site through php-fpm:
+	# php_fastcgi localhost:9000
+}
+
+# Refer to the Caddy docs for more information:
+# https://caddyserver.com/docs/caddyfile

+ 55 - 0
include/caddy.sh

@@ -0,0 +1,55 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://linuxeye.com
+#
+# Notes: OneinStack for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/oneinstack/oneinstack
+
+Install_Caddy() {
+
+  pushd ${oneinstack_dir}/src > /dev/null
+  id -g ${run_group} >/dev/null 2>&1
+  [ $? -ne 0 ] && groupadd ${run_group}
+  id -u ${run_user} >/dev/null 2>&1
+  [ $? -ne 0 ] && useradd -g ${run_group} -M -s /sbin/nologin ${run_user}
+
+  #unzip caddy_${caddy_ver}_linux_amd64.zip
+  tar xzf caddy-${caddy_ver}.tar.gz
+
+  #move caddy to /usr/local/caddy/bin
+  [ ! -d "${caddy_install_dir}/bin" ] && mkdir -p ${caddy_install_dir}/bin
+  /bin/cp caddy ${caddy_install_dir}/bin
+
+  chmod +x ${caddy_install_dir}/bin/caddy
+
+  [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${caddy_install_dir}/bin:\$PATH" >> /etc/profile
+  [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${caddy_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${caddy_install_dir}/bin:\1@" /etc/profile
+  . /etc/profile
+
+  #make soft link
+  # [ ! -L "/usr/local/bin/caddy" ] && ln -s ${caddy_install_dir}/bin/caddy /usr/local/bin/caddy
+
+  #move caddyfile to /usr/local/caddy/conf
+  [ ! -d "${caddy_install_dir}/conf" ] && mkdir -p ${caddy_install_dir}/conf
+  /bin/cp ../config/Caddyfile ${caddy_install_dir}/conf/
+
+  #move caddy.service to /lib/systemd/system
+  /bin/cp ../init.d/caddy.service /lib/systemd/system/
+
+  #modify caddy.service
+  sed -i "s@/usr/local/caddy@${caddy_install_dir}@g" /lib/systemd/system/caddy.service
+
+  #设置caddy开机启动
+  systemctl enable caddy
+
+  #reload systemd
+  systemctl daemon-reload
+
+  #start caddy service
+  systemctl start caddy
+
+   echo "${CSUCCESS}Caddy installed successfully! ${CEND}"
+}

+ 16 - 12
include/check_download.sh

@@ -58,6 +58,18 @@ checkDownload() {
     src_url=https://downloads.sourceforge.net/project/pcre/pcre/${pcre_ver}/pcre-${pcre_ver}.tar.gz && Download_src
   fi
 
+  # if nginx_option=4 download caddy
+  if [ "${nginx_option}" == '4' ]; then
+    echo "Download caddy ${caddy_ver}"
+    src_url=${mirror_link}/caddy/v${caddy_ver}/caddy-${caddy_ver}.tar.gz  && Download_src
+  fi
+
+  # caddy
+  if [ "${caddy_flag}" == 'y' ]; then
+    echo "Download caddy ${caddy_ver}"
+    src_url=${mirror_link}/caddy/v${caddy_ver}/caddy-${caddy_ver}.tar.gz  && Download_src
+  fi
+
   # apache
   if [ "${apache_flag}" == 'y' ]; then
     echo "Download apache 2.4..."
@@ -481,7 +493,7 @@ checkDownload() {
   fi
 
   # PHP
-  if [[ "${php_option}" =~ ^[1-9]$|^1[0-3]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-3]$ ]]; then
+  if [[ "${php_option}" =~ ^[1-9]$|^1[0-2]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-2]$ ]]; then
     echo "PHP common..."
     src_url=${mirror_link}/oneinstack/src/libiconv-${libiconv_ver}.tar.gz && Download_src
     src_url=https://curl.haxx.se/download/curl-${curl_ver}.tar.gz && Download_src
@@ -536,11 +548,6 @@ checkDownload() {
     src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
     src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
     src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
-  elif [ "${php_option}" == '13' ] || [ "${mphp_ver}" == '83' ]; then
-    src_url=https://secure.php.net/distributions/php-${php83_ver}.tar.gz && Download_src
-    src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
-    src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
-    src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
   fi
 
   # PHP OPCache
@@ -647,13 +654,10 @@ checkDownload() {
   # pecl_redis
   if [ "${pecl_redis}" == '1' ]; then
     if [[ "${php_option}" =~ ^[1-4]$ ]]; then
-      echo "Download pecl_redis for php 5.x..."
-      src_url=https://pecl.php.net/get/redis-4.3.0.tgz && Download_src
-    elif [[ "${php_option}" =~ ^[5-6]$ ]]; then
-      echo "Download pecl_redis for php 7.0~7.1..."
-      src_url=https://pecl.php.net/get/redis-5.3.7.tgz && Download_src
+      echo "Download pecl_redis for php..."
+      src_url=https://pecl.php.net/get/redis-${pecl_redis_oldver}.tgz && Download_src
     else
-      echo "Download pecl_redis for php 7.2+..."
+      echo "Download pecl_redis for php 7.x..."
       src_url=https://pecl.php.net/get/redis-${pecl_redis_ver}.tgz && Download_src
     fi
   fi

+ 19 - 0
init.d/caddy.service

@@ -0,0 +1,19 @@
+[Unit]
+Description=Caddy
+After=network.target network-online.target
+Requires=network-online.target
+
+[Service]
+Type=notify
+User=caddy
+Group=caddy
+ExecStart=/usr/local/caddy/bin/caddy run --environ --config /usr/local/caddy/conf/Caddyfile
+ExecReload=/usr/local/caddy/bin/caddy reload --config /usr/local/caddy/conf/Caddyfile --force
+TimeoutStopSec=5s
+LimitNOFILE=1048576
+PrivateTmp=true
+ProtectSystem=full
+AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
+
+[Install]
+WantedBy=multi-user.target

+ 386 - 239
install.sh

@@ -45,7 +45,7 @@ Show_Help() {
   echo "Usage: $0  command ...[parameters]....
   --help, -h                  Show this help message, More: https://oneinstack.com/auto
   --version, -v               Show version info
-  --nginx_option [1-3]        Install Nginx server version
+  --nginx_option [1-4]        Install Nginx server version
   --apache                    Install Apache
   --apache_mode_option [1-2]  Apache2.4 mode, 1(default): php-fpm, 2: mod_php
   --apache_mpm_option [1-3]   Apache2.4 MPM, 1(default): event, 2: prefork, 3: worker
@@ -79,136 +79,231 @@ eval set -- "${TEMP}"
 while :; do
   [ -z "$1" ] && break;
   case "$1" in
-    -h|--help)
-      Show_Help; exit 0
-      ;;
-    -v|-V|--version)
-      version; exit 0
-      ;;
-    --nginx_option)
-      nginx_option=$2; shift 2
-      [[ ! ${nginx_option} =~ ^[1-3]$ ]] && { echo "${CWARNING}nginx_option input error! Please only input number 1~3${CEND}"; exit 1; }
-      [ -e "${nginx_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Nginx already installed! ${CEND}"; unset nginx_option; }
-      [ -e "${tengine_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Tengine already installed! ${CEND}"; unset nginx_option; }
-      [ -e "${openresty_install_dir}/nginx/sbin/nginx" ] && { echo "${CWARNING}OpenResty already installed! ${CEND}"; unset nginx_option; }
-      ;;
-    --apache)
-      apache_flag=y; shift 1
-      [ -e "${apache_install_dir}/bin/httpd" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; unset apache_flag; }
-      ;;
-    --apache_mode_option)
-      apache_mode_option=$2; shift 2
-      [[ ! ${apache_mode_option} =~ ^[1-2]$ ]] && { echo "${CWARNING}apache_mode_option input error! Please only input number 1~2${CEND}"; exit 1; }
-      ;;
-    --apache_mpm_option)
-      apache_mpm_option=$2; shift 2
-      [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]] && { echo "${CWARNING}apache_mpm_option input error! Please only input number 1~3${CEND}"; exit 1; }
-      ;;
-    --php_option)
-      php_option=$2; shift 2
-      [[ ! ${php_option} =~ ^[1-9]$|^1[0-3]$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~13${CEND}"; exit 1; }
-      [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; }
-      ;;
-    --mphp_ver)
-      mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-3]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~83${CEND}"; exit 1; }
-      ;;
-    --mphp_addons)
-      mphp_addons_flag=y; shift 1
-      ;;
-    --phpcache_option)
-      phpcache_option=$2; shift 2
-      ;;
-    --php_extensions)
-      php_extensions=$2; shift 2
-      [ -n "`echo ${php_extensions} | grep -w zendguardloader`" ] && pecl_zendguardloader=1
-      [ -n "`echo ${php_extensions} | grep -w ioncube`" ] && pecl_ioncube=1
-      [ -n "`echo ${php_extensions} | grep -w sourceguardian`" ] && pecl_sourceguardian=1
-      [ -n "`echo ${php_extensions} | grep -w imagick`" ] && pecl_imagick=1
-      [ -n "`echo ${php_extensions} | grep -w gmagick`" ] && pecl_gmagick=1
-      [ -n "`echo ${php_extensions} | grep -w fileinfo`" ] && pecl_fileinfo=1
-      [ -n "`echo ${php_extensions} | grep -w imap`" ] && pecl_imap=1
-      [ -n "`echo ${php_extensions} | grep -w ldap`" ] && pecl_ldap=1
-      [ -n "`echo ${php_extensions} | grep -w calendar`" ] && pecl_calendar=1
-      [ -n "`echo ${php_extensions} | grep -w phalcon`" ] && pecl_phalcon=1
-      [ -n "`echo ${php_extensions} | grep -w yaf`" ] && pecl_yaf=1
-      [ -n "`echo ${php_extensions} | grep -w yar`" ] && pecl_yar=1
-      [ -n "`echo ${php_extensions} | grep -w redis`" ] && pecl_redis=1
-      [ -n "`echo ${php_extensions} | grep -w memcached`" ] && pecl_memcached=1
-      [ -n "`echo ${php_extensions} | grep -w memcache`" ] && pecl_memcache=1
-      [ -n "`echo ${php_extensions} | grep -w mongodb`" ] && pecl_mongodb=1
-      [ -n "`echo ${php_extensions} | grep -w swoole`" ] && pecl_swoole=1
-      [ -n "`echo ${php_extensions} | grep -w xdebug`" ] && pecl_xdebug=1
-      ;;
-    --nodejs)
-      nodejs_flag=y; shift 1
-      [ -e "${nodejs_install_dir}/bin/node" ] && { echo "${CWARNING}Nodejs already installed! ${CEND}"; unset nodejs_flag; }
-      ;;
-    --tomcat_option)
-      tomcat_option=$2; shift 2
-      [[ ! ${tomcat_option} =~ ^[1-4]$ ]] && { echo "${CWARNING}tomcat_option input error! Please only input number 1~4${CEND}"; exit 1; }
-      [ -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; unset tomcat_option; }
-      ;;
-    --jdk_option)
-      jdk_option=$2; shift 2
-      [[ ! ${jdk_option} =~ ^[1-3]$ ]] && { echo "${CWARNING}jdk_option input error! Please only input number 1~3${CEND}"; exit 1; }
-      ;;
-    --db_option)
-      db_option=$2; shift 2
-      if [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]]; then
-        [ -d "${db_install_dir}/support-files" ] && { echo "${CWARNING}MySQL already installed! ${CEND}"; unset db_option; }
-      elif [ "${db_option}" == '13' ]; then
-        [ -e "${pgsql_install_dir}/bin/psql" ] && { echo "${CWARNING}PostgreSQL already installed! ${CEND}"; unset db_option; }
-      elif [ "${db_option}" == '14' ]; then
-        [ -e "${mongo_install_dir}/bin/mongo" ] && { echo "${CWARNING}MongoDB already installed! ${CEND}"; unset db_option; }
-      else
-        echo "${CWARNING}db_option input error! Please only input number 1~14${CEND}"
-        exit 1
-      fi
-      ;;
-    --dbrootpwd)
-      dbrootpwd=$2; shift 2
-      dbpostgrespwd="${dbrootpwd}"
-      dbmongopwd="${dbrootpwd}"
-      ;;
-    --dbinstallmethod)
-      dbinstallmethod=$2; shift 2
-      [[ ! ${dbinstallmethod} =~ ^[1-2]$ ]] && { echo "${CWARNING}dbinstallmethod input error! Please only input number 1~2${CEND}"; exit 1; }
-      ;;
-    --pureftpd)
-      pureftpd_flag=y; shift 1
-      [ -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && { echo "${CWARNING}Pure-FTPd already installed! ${CEND}"; unset pureftpd_flag; }
-      ;;
-    --redis)
-      redis_flag=y; shift 1
-      [ -e "${redis_install_dir}/bin/redis-server" ] && { echo "${CWARNING}redis-server already installed! ${CEND}"; unset redis_flag; }
-      ;;
-    --memcached)
-      memcached_flag=y; shift 1
-      [ -e "${memcached_install_dir}/bin/memcached" ] && { echo "${CWARNING}memcached-server already installed! ${CEND}"; unset memcached_flag; }
-      ;;
-    --phpmyadmin)
-      phpmyadmin_flag=y; shift 1
-      [ -d "${wwwroot_dir}/default/phpMyAdmin" ] && { echo "${CWARNING}phpMyAdmin already installed! ${CEND}"; unset phpmyadmin_flag; }
-      ;;
-    --ssh_port)
-      ssh_port=$2; shift 2
-      ;;
-    --firewall)
-      firewall_flag=y; shift 1
-      ;;
+  -h | --help)
+    Show_Help
+    exit 0
+    ;;
+  -v | -V | --version)
+    version
+    exit 0
+    ;;
+  --nginx_option)
+    nginx_option=$2
+    shift 2
+    [[ ! ${nginx_option} =~ ^[1-4]$ ]] && {
+      echo "${CWARNING}nginx_option input error! Please only input number 1~5${CEND}"
+      exit 1
+    }
+    [ -e "${nginx_install_dir}/sbin/nginx" ] && {
+      echo "${CWARNING}Nginx already installed! ${CEND}"
+      unset nginx_option
+    }
+    [ -e "${tengine_install_dir}/sbin/nginx" ] && {
+      echo "${CWARNING}Tengine already installed! ${CEND}"
+      unset nginx_option
+    }
+    [ -e "${openresty_install_dir}/nginx/sbin/nginx" ] && {
+      echo "${CWARNING}OpenResty already installed! ${CEND}"
+      unset nginx_option
+    }
+    [ -e "${caddy_install_dir}/bin/caddy" ] && {
+      echo "${CWARNING}Caddy already installed! ${CEND}"
+      unset nginx_option
+    }
+    ;;
+  --apache)
+    apache_flag=y
+    shift 1
+    [ -e "${apache_install_dir}/bin/httpd" ] && {
+      echo "${CWARNING}Aapche already installed! ${CEND}"
+      unset apache_flag
+    }
+    ;;
+  --apache_mode_option)
+    apache_mode_option=$2
+    shift 2
+    [[ ! ${apache_mode_option} =~ ^[1-2]$ ]] && {
+      echo "${CWARNING}apache_mode_option input error! Please only input number 1~2${CEND}"
+      exit 1
+    }
+    ;;
+  --apache_mpm_option)
+    apache_mpm_option=$2
+    shift 2
+    [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]] && {
+      echo "${CWARNING}apache_mpm_option input error! Please only input number 1~3${CEND}"
+      exit 1
+    }
+    ;;
+  --php_option)
+    php_option=$2
+    shift 2
+    [[ ! ${php_option} =~ ^[1-9]$|^1[0-3]$ ]] && {
+      echo "${CWARNING}php_option input error! Please only input number 1~12${CEND}"
+      exit 1
+    }
+    [ -e "${php_install_dir}/bin/phpize" ] && {
+      echo "${CWARNING}PHP already installed! ${CEND}"
+      unset php_option
+    }
+    ;;
+  --mphp_ver)
+    mphp_ver=$2
+    mphp_flag=y
+    shift 2
+    [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-3]$ ]] && {
+      echo "${CWARNING}mphp_ver input error! Please only input number 53~82${CEND}"
+      exit 1
+    }
+    ;;
+  --mphp_addons)
+    mphp_addons_flag=y
+    shift 1
+    ;;
+  --phpcache_option)
+    phpcache_option=$2
+    shift 2
+    ;;
+  --php_extensions)
+    php_extensions=$2
+    shift 2
+    [ -n "$(echo ${php_extensions} | grep -w zendguardloader)" ] && pecl_zendguardloader=1
+    [ -n "$(echo ${php_extensions} | grep -w ioncube)" ] && pecl_ioncube=1
+    [ -n "$(echo ${php_extensions} | grep -w sourceguardian)" ] && pecl_sourceguardian=1
+    [ -n "$(echo ${php_extensions} | grep -w imagick)" ] && pecl_imagick=1
+    [ -n "$(echo ${php_extensions} | grep -w gmagick)" ] && pecl_gmagick=1
+    [ -n "$(echo ${php_extensions} | grep -w fileinfo)" ] && pecl_fileinfo=1
+    [ -n "$(echo ${php_extensions} | grep -w imap)" ] && pecl_imap=1
+    [ -n "$(echo ${php_extensions} | grep -w ldap)" ] && pecl_ldap=1
+    [ -n "$(echo ${php_extensions} | grep -w calendar)" ] && pecl_calendar=1
+    [ -n "$(echo ${php_extensions} | grep -w phalcon)" ] && pecl_phalcon=1
+    [ -n "$(echo ${php_extensions} | grep -w yaf)" ] && pecl_yaf=1
+    [ -n "$(echo ${php_extensions} | grep -w yar)" ] && pecl_yar=1
+    [ -n "$(echo ${php_extensions} | grep -w redis)" ] && pecl_redis=1
+    [ -n "$(echo ${php_extensions} | grep -w memcached)" ] && pecl_memcached=1
+    [ -n "$(echo ${php_extensions} | grep -w memcache)" ] && pecl_memcache=1
+    [ -n "$(echo ${php_extensions} | grep -w mongodb)" ] && pecl_mongodb=1
+    [ -n "$(echo ${php_extensions} | grep -w swoole)" ] && pecl_swoole=1
+    [ -n "$(echo ${php_extensions} | grep -w xdebug)" ] && pecl_xdebug=1
+    ;;
+  --nodejs)
+    nodejs_flag=y
+    shift 1
+    [ -e "${nodejs_install_dir}/bin/node" ] && {
+      echo "${CWARNING}Nodejs already installed! ${CEND}"
+      unset nodejs_flag
+    }
+    ;;
+  --tomcat_option)
+    tomcat_option=$2
+    shift 2
+    [[ ! ${tomcat_option} =~ ^[1-4]$ ]] && {
+      echo "${CWARNING}tomcat_option input error! Please only input number 1~4${CEND}"
+      exit 1
+    }
+    [ -e "$tomcat_install_dir/conf/server.xml" ] && {
+      echo "${CWARNING}Tomcat already installed! ${CEND}"
+      unset tomcat_option
+    }
+    ;;
+  --jdk_option)
+    jdk_option=$2
+    shift 2
+    [[ ! ${jdk_option} =~ ^[1-3]$ ]] && {
+      echo "${CWARNING}jdk_option input error! Please only input number 1~3${CEND}"
+      exit 1
+    }
+    ;;
+  --db_option)
+    db_option=$2
+    shift 2
+    if [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]]; then
+      [ -d "${db_install_dir}/support-files" ] && {
+        echo "${CWARNING}MySQL already installed! ${CEND}"
+        unset db_option
+      }
+    elif [ "${db_option}" == '13' ]; then
+      [ -e "${pgsql_install_dir}/bin/psql" ] && {
+        echo "${CWARNING}PostgreSQL already installed! ${CEND}"
+        unset db_option
+      }
+    elif [ "${db_option}" == '14' ]; then
+      [ -e "${mongo_install_dir}/bin/mongo" ] && {
+        echo "${CWARNING}MongoDB already installed! ${CEND}"
+        unset db_option
+      }
+    else
+      echo "${CWARNING}db_option input error! Please only input number 1~14${CEND}"
+      exit 1
+    fi
+    ;;
+  --dbrootpwd)
+    dbrootpwd=$2
+    shift 2
+    dbpostgrespwd="${dbrootpwd}"
+    dbmongopwd="${dbrootpwd}"
+    ;;
+  --dbinstallmethod)
+    dbinstallmethod=$2
+    shift 2
+    [[ ! ${dbinstallmethod} =~ ^[1-2]$ ]] && {
+      echo "${CWARNING}dbinstallmethod input error! Please only input number 1~2${CEND}"
+      exit 1
+    }
+    ;;
+  --pureftpd)
+    pureftpd_flag=y
+    shift 1
+    [ -e "${pureftpd_install_dir}/sbin/pure-ftpwho" ] && {
+      echo "${CWARNING}Pure-FTPd already installed! ${CEND}"
+      unset pureftpd_flag
+    }
+    ;;
+  --redis)
+    redis_flag=y
+    shift 1
+    [ -e "${redis_install_dir}/bin/redis-server" ] && {
+      echo "${CWARNING}redis-server already installed! ${CEND}"
+      unset redis_flag
+    }
+    ;;
+  --memcached)
+    memcached_flag=y
+    shift 1
+    [ -e "${memcached_install_dir}/bin/memcached" ] && {
+      echo "${CWARNING}memcached-server already installed! ${CEND}"
+      unset memcached_flag
+    }
+    ;;
+  --phpmyadmin)
+    phpmyadmin_flag=y
+    shift 1
+    [ -d "${wwwroot_dir}/default/phpMyAdmin" ] && {
+      echo "${CWARNING}phpMyAdmin already installed! ${CEND}"
+      unset phpmyadmin_flag
+    }
+    ;;
+  --ssh_port)
+    ssh_port=$2
+    shift 2
+    ;;
+  --firewall)
+    firewall_flag=y
+    shift 1
+    ;;
     --md5sum)
       md5sum_flag=y; shift 1
-      ;;
-    --reboot)
-      reboot_flag=y; shift 1
-      ;;
-    --)
-      shift
-      ;;
-    *)
-      echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
-      ;;
+	;;
+  --reboot)
+    reboot_flag=y
+    shift 1
+    ;;
+  --)
+    shift
+    ;;
+  *)
+    echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
+    ;;
   esac
 done
 
@@ -283,132 +378,178 @@ if [ ${ARG_NUM} == 0 ]; then
     else
       if [ "${web_flag}" == 'y' ]; then
         # Nginx/Tegine/OpenResty
-        while :; do echo
-          echo 'Please select Nginx server:'
+        while :; do
+          echo
+          echo 'Please select Web server type:'
           echo -e "\t${CMSG}1${CEND}. Install Nginx"
           echo -e "\t${CMSG}2${CEND}. Install Tengine"
           echo -e "\t${CMSG}3${CEND}. Install OpenResty"
-          echo -e "\t${CMSG}4${CEND}. Do not install"
+          echo -e "\t${CMSG}4${CEND}. Install Caddy"
+          echo -e "\t${CMSG}5${CEND}. Do not install"
           read -e -p "Please input a number:(Default 1 press Enter) " nginx_option
           nginx_option=${nginx_option:-1}
-          if [[ ! ${nginx_option} =~ ^[1-4]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1~4${CEND}"
+          if [[ ! ${nginx_option} =~ ^[1-5]$ ]]; then
+            echo "${CWARNING}input error! Please only input number 1~5${CEND}"
           else
-            [ "${nginx_option}" != '4' -a -e "${nginx_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Nginx already installed! ${CEND}"; unset nginx_option; }
-            [ "${nginx_option}" != '4' -a -e "${tengine_install_dir}/sbin/nginx" ] && { echo "${CWARNING}Tengine already installed! ${CEND}"; unset nginx_option; }
-            [ "${nginx_option}" != '4' -a -e "${openresty_install_dir}/nginx/sbin/nginx" ] && { echo "${CWARNING}OpenResty already installed! ${CEND}"; unset nginx_option; }
+            [ "${nginx_option}" != '5' -a -e "${nginx_install_dir}/sbin/nginx" ] && {
+              echo "${CWARNING}Nginx already installed! ${CEND}"
+              unset nginx_option
+            }
+            [ "${nginx_option}" != '5' -a -e "${tengine_install_dir}/sbin/nginx" ] && {
+              echo "${CWARNING}Tengine already installed! ${CEND}"
+              unset nginx_option
+            }
+            [ "${nginx_option}" != '5' -a -e "${openresty_install_dir}/nginx/sbin/nginx" ] && {
+              echo "${CWARNING}OpenResty already installed! ${CEND}"
+              unset nginx_option
+            }
+            [ "${nginx_option}" != '5' -a -e "${caddy_install_dir}/nginx/sbin/nginx" ] && {
+              echo "${CWARNING}Caddy already installed! ${CEND}"
+              unset nginx_option
+            }
             break
           fi
         done
-
-        # Apache
-        while :; do echo
-          read -e -p "Do you want to install Apache? [y/n]: " apache_flag
-          if [[ ! ${apache_flag} =~ ^[y,n]$ ]]; then
-            echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
-          else
-            [ "${apache_flag}" == 'y' -a -e "${apache_install_dir}/bin/httpd" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; unset apache_flag; }
-            break
+        if [[ ${nginx_option} =~ ^[1-3]$ ]]; then
+          # Apache
+          while :; do
+            echo
+            read -e -p "Do you want to install Apache? [y/n]: " apache_flag
+            if [[ ! ${apache_flag} =~ ^[y,n]$ ]]; then
+              echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
+            else
+              [ "${apache_flag}" == 'y' -a -e "${apache_install_dir}/bin/httpd" ] && {
+                echo "${CWARNING}Aapche already installed! ${CEND}"
+                unset apache_flag
+              }
+              break
+            fi
+          done
+          # Apache2.4 mode and Apache2.4 MPM
+          if [ "${apache_flag}" == 'y' -o -e "${apache_install_dir}/bin/httpd" ]; then
+            while :; do
+              echo
+              echo 'Please select Apache mode:'
+              echo -e "\t${CMSG}1${CEND}. php-fpm"
+              echo -e "\t${CMSG}2${CEND}. mod_php"
+              read -e -p "Please input a number:(Default 1 press Enter) " apache_mode_option
+              apache_mode_option=${apache_mode_option:-1}
+              if [[ ! ${apache_mode_option} =~ ^[1-2]$ ]]; then
+                echo "${CWARNING}input error! Please only input number 1~2${CEND}"
+              else
+                break
+              fi
+            done
+            while :; do
+              echo
+              echo 'Please select Apache MPM:'
+              echo -e "\t${CMSG}1${CEND}. event"
+              echo -e "\t${CMSG}2${CEND}. prefork"
+              echo -e "\t${CMSG}3${CEND}. worker"
+              read -e -p "Please input a number:(Default 1 press Enter) " apache_mpm_option
+              apache_mpm_option=${apache_mpm_option:-1}
+              if [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]]; then
+                echo "${CWARNING}input error! Please only input number 1~3${CEND}"
+              else
+                break
+              fi
+            done
           fi
-        done
-        # Apache2.4 mode and Apache2.4 MPM
-        if [ "${apache_flag}" == 'y' -o -e "${apache_install_dir}/bin/httpd" ]; then
-          while :; do echo
-            echo 'Please select Apache mode:'
-            echo -e "\t${CMSG}1${CEND}. php-fpm"
-            echo -e "\t${CMSG}2${CEND}. mod_php"
-            read -e -p "Please input a number:(Default 1 press Enter) " apache_mode_option
-            apache_mode_option=${apache_mode_option:-1}
-            if [[ ! ${apache_mode_option} =~ ^[1-2]$ ]]; then
-              echo "${CWARNING}input error! Please only input number 1~2${CEND}"
+          # Tomcat
+          while :; do
+            echo
+            echo 'Please select tomcat server:'
+            echo -e "\t${CMSG}1${CEND}. Install Tomcat-10"
+            echo -e "\t${CMSG}2${CEND}. Install Tomcat-9"
+            echo -e "\t${CMSG}3${CEND}. Install Tomcat-8"
+            echo -e "\t${CMSG}4${CEND}. Install Tomcat-7"
+            echo -e "\t${CMSG}5${CEND}. Do not install"
+            read -e -p "Please input a number:(Default 5 press Enter) " tomcat_option
+            tomcat_option=${tomcat_option:-5}
+            if [[ ! ${tomcat_option} =~ ^[1-5]$ ]]; then
+              echo "${CWARNING}input error! Please only input number 1~5${CEND}"
             else
+              [ "${tomcat_option}" != '5' -a -e "$tomcat_install_dir/conf/server.xml" ] && {
+                echo "${CWARNING}Tomcat already installed! ${CEND}"
+                unset tomcat_option
+              }
+              if [[ "${tomcat_option}" =~ ^1$ ]]; then
+                while :; do
+                  echo
+                  echo 'Please select JDK version:'
+                  echo -e "\t${CMSG}2${CEND}. Install openjdk-11-jdk"
+                  echo -e "\t${CMSG}3${CEND}. Install openjdk-17-jdk"
+                  read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
+                  jdk_option=${jdk_option:-2}
+                  if [[ ! ${jdk_option} =~ ^[2-3]$ ]]; then
+                    echo "${CWARNING}input error! Please only input number 2~3${CEND}"
+                  else
+                    break
+                  fi
+                done
+              elif [[ "${tomcat_option}" =~ ^[2-3]$ ]]; then
+                while :; do
+                  echo
+                  echo 'Please select JDK version:'
+                  echo -e "\t${CMSG}1${CEND}. Install openjdk-8-jdk"
+                  echo -e "\t${CMSG}2${CEND}. Install openjdk-11-jdk"
+                  echo -e "\t${CMSG}3${CEND}. Install openjdk-17-jdk"
+                  read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
+                  jdk_option=${jdk_option:-1}
+                  if [[ ! ${jdk_option} =~ ^[1-3]$ ]]; then
+                    echo "${CWARNING}input error! Please only input number 1~3${CEND}"
+                  else
+                    break
+                  fi
+                done
+              elif [ "${tomcat_option}" == '4' ]; then
+                while :; do
+                  echo
+                  echo 'Please select JDK version:'
+                  echo -e "\t${CMSG}1${CEND}. Install openjdk-8-jdk"
+                  read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
+                  jdk_option=${jdk_option:-1}
+                  if [[ ! ${jdk_option} =~ ^1$ ]]; then
+                    echo "${CWARNING}input error! Please only input number 1${CEND}"
+                  else
+                    break
+                  fi
+                done
+              fi
               break
             fi
           done
-          while :; do echo
-            echo 'Please select Apache MPM:'
-            echo -e "\t${CMSG}1${CEND}. event"
-            echo -e "\t${CMSG}2${CEND}. prefork"
-            echo -e "\t${CMSG}3${CEND}. worker"
-            read -e -p "Please input a number:(Default 1 press Enter) " apache_mpm_option
-            apache_mpm_option=${apache_mpm_option:-1}
-            if [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]]; then
-              echo "${CWARNING}input error! Please only input number 1~3${CEND}"
+        elif [ "${nginx_option}" == '4' ]; then
+          # Caddy
+          while :; do
+            echo
+            read -e -p "Do you want to install Caddy? [y/n]: " caddy_flag
+            if [[ ! ${caddy_flag} =~ ^[y,n]$ ]]; then
+              echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
             else
+              [ "${caddy_flag}" == 'y' -a -e "${caddy_install_dir}/bin/caddy" ] && {
+                echo "${CWARNING}Caddy already installed! ${CEND}"
+                unset caddy_flag
+              }
               break
             fi
           done
         fi
-        # Tomcat
-        while :; do echo
-          echo 'Please select tomcat server:'
-          echo -e "\t${CMSG}1${CEND}. Install Tomcat-10"
-          echo -e "\t${CMSG}2${CEND}. Install Tomcat-9"
-          echo -e "\t${CMSG}3${CEND}. Install Tomcat-8"
-          echo -e "\t${CMSG}4${CEND}. Install Tomcat-7"
-          echo -e "\t${CMSG}5${CEND}. Do not install"
-          read -e -p "Please input a number:(Default 5 press Enter) " tomcat_option
-          tomcat_option=${tomcat_option:-5}
-          if [[ ! ${tomcat_option} =~ ^[1-5]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1~5${CEND}"
-          else
-            [ "${tomcat_option}" != '5' -a -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; unset tomcat_option; }
-            if [[ "${tomcat_option}" =~ ^1$ ]]; then
-              while :; do echo
-                echo 'Please select JDK version:'
-                echo -e "\t${CMSG}2${CEND}. Install openjdk-11-jdk"
-                echo -e "\t${CMSG}3${CEND}. Install openjdk-17-jdk"
-                read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
-                jdk_option=${jdk_option:-2}
-                if [[ ! ${jdk_option} =~ ^[2-3]$ ]]; then
-                  echo "${CWARNING}input error! Please only input number 2~3${CEND}"
-                else
-                  break
-                fi
-              done
-            elif [[ "${tomcat_option}" =~ ^[2-3]$ ]]; then
-              while :; do echo
-                echo 'Please select JDK version:'
-                echo -e "\t${CMSG}1${CEND}. Install openjdk-8-jdk"
-                echo -e "\t${CMSG}2${CEND}. Install openjdk-11-jdk"
-                echo -e "\t${CMSG}3${CEND}. Install openjdk-17-jdk"
-                read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
-                jdk_option=${jdk_option:-1}
-                if [[ ! ${jdk_option} =~ ^[1-3]$ ]]; then
-                  echo "${CWARNING}input error! Please only input number 1~3${CEND}"
-                else
-                  break
-                fi
-              done
-            elif [ "${tomcat_option}" == '4' ]; then
-              while :; do echo
-                echo 'Please select JDK version:'
-                echo -e "\t${CMSG}1${CEND}. Install openjdk-8-jdk"
-                read -e -p "Please input a number:(Default 1 press Enter) " jdk_option
-                jdk_option=${jdk_option:-1}
-                if [[ ! ${jdk_option} =~ ^1$ ]]; then
-                  echo "${CWARNING}input error! Please only input number 1${CEND}"
-                else
-                  break
-                fi
-              done
-            fi
-            break
-          fi
-        done
       fi
       break
     fi
   done
 
   # choice database
-  while :; do echo
+  while :; do
+    echo
     read -e -p "Do you want to install Database? [y/n]: " db_flag
     if [[ ! ${db_flag} =~ ^[y,n]$ ]]; then
       echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
     else
       if [ "${db_flag}" == 'y' ]; then
-        while :; do echo
+        while :; do
+          echo
           echo 'Please select a version of the Database:'
           echo -e "\t${CMSG} 1${CEND}. Install MySQL-8.0"
           echo -e "\t${CMSG} 2${CEND}. Install MySQL-5.7"
@@ -735,7 +876,7 @@ if [ ${ARG_NUM} == 0 ]; then
   done
 fi
 
-if [[ ${nginx_option} =~ ^[1-3]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
+if [[ ${nginx_option} =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [ "${caddy_flag}" == 'y' ] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
   [ ! -d ${wwwroot_dir}/default ] && mkdir -p ${wwwroot_dir}/default
   [ ! -d ${wwwlogs_dir} ] && mkdir -p ${wwwlogs_dir}
 fi
@@ -861,18 +1002,23 @@ esac
 
 # Nginx server
 case "${nginx_option}" in
-  1)
-    . include/nginx.sh
-    Install_Nginx 2>&1 | tee -a ${oneinstack_dir}/install.log
-    ;;
-  2)
-    . include/tengine.sh
-    Install_Tengine 2>&1 | tee -a ${oneinstack_dir}/install.log
-    ;;
-  3)
-    . include/openresty.sh
-    Install_OpenResty 2>&1 | tee -a ${oneinstack_dir}/install.log
-    ;;
+1)
+  . include/nginx.sh
+  Install_Nginx 2>&1 | tee -a ${oneinstack_dir}/install.log
+  ;;
+2)
+  . include/tengine.sh
+  Install_Tengine 2>&1 | tee -a ${oneinstack_dir}/install.log
+  ;;
+3)
+  . include/openresty.sh
+  Install_OpenResty 2>&1 | tee -a ${oneinstack_dir}/install.log
+  ;;
+4)
+  . include/caddy.sh
+  Install_Caddy 2>&1 | tee -a ${oneinstack_dir}/install.log
+  caddy_flag='y'
+  ;;
 esac
 
 # Apache
@@ -1175,6 +1321,7 @@ echo "####################Congratulations########################"
 echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [[ "${nginx_option}" =~ ^[1-3]$ ]] && echo -e "\n$(printf "%-32s" "Nginx install dir":)${CMSG}${web_install_dir}${CEND}"
 [ "${apache_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "Apache install dir":)${CMSG}${apache_install_dir}${CEND}"
+[ "${caddy_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "Caddy install dir":)${CMSG}${caddy_install_dir}${CEND}"
 [[ "${tomcat_option}" =~ ^[1-4]$ ]] && echo -e "\n$(printf "%-32s" "Tomcat install dir":)${CMSG}${tomcat_install_dir}${CEND}"
 [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]] && echo -e "\n$(printf "%-32s" "Database install dir:")${CMSG}${db_install_dir}${CEND}"
 [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]] && echo "$(printf "%-32s" "Database data dir:")${CMSG}${db_data_dir}${CEND}"
@@ -1203,7 +1350,7 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${phpmyadmin_flag}" == 'y' ] && echo "$(printf "%-32s" "phpMyAdmin Control Panel URL:")${CMSG}http://${IPADDR}/phpMyAdmin${CEND}"
 [ "${redis_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "redis install dir:")${CMSG}${redis_install_dir}${CEND}"
 [ "${memcached_flag}" == 'y' ] && echo -e "\n$(printf "%-32s" "memcached install dir:")${CMSG}${memcached_install_dir}${CEND}"
-if [[ ${nginx_option} =~ ^[1-3]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
+if [[ ${nginx_option} =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${tomcat_option} =~ ^[1-4]$ ]]; then
   echo -e "\n$(printf "%-32s" "Index URL:")${CMSG}http://${IPADDR}/${CEND}"
 fi
 if [ ${ARG_NUM} == 0 ]; then

+ 1 - 0
options.conf

@@ -13,6 +13,7 @@ run_group=www
 nginx_install_dir=/usr/local/nginx
 tengine_install_dir=/usr/local/tengine
 openresty_install_dir=/usr/local/openresty
+caddy_install_dir=/usr/local/caddy
 apache_install_dir=/usr/local/apache
 tomcat_install_dir=/usr/local/tomcat
 

+ 7 - 2
uninstall.sh

@@ -33,7 +33,7 @@ Show_Help() {
   --help, -h                    Show this help message, More: https://oneinstack.com
   --quiet, -q                   quiet operation
   --all                         Uninstall All
-  --web                         Uninstall Nginx/Tengine/OpenResty/Apache/Tomcat
+  --web                         Uninstall Nginx/Tengine/OpenResty/Apache/Tomcat/Caddy
   --mysql                       Uninstall MySQL/MariaDB/Percona
   --postgresql                  Uninstall PostgreSQL
   --mongodb                     Uninstall MongoDB
@@ -177,6 +177,9 @@ Print_web() {
   [ -e "/lib/systemd/system/nginx.service" ] && echo /lib/systemd/system/nginx.service
   [ -e "/etc/logrotate.d/nginx" ] && echo /etc/logrotate.d/nginx
 
+  [ -d "${caddy_install_dir}" ] && echo ${caddy_install_dir}
+  [ -e "/lib/systemd/system/caddy.service" ] && echo /lib/systemd/system/caddy.service
+
   [ -d "${apache_install_dir}" ] && echo ${apache_install_dir}
   [ -e "/lib/systemd/system/httpd.service" ] && echo /lib/systemd/system/httpd.service
   [ -e "/etc/init.d/httpd" ] && echo /etc/init.d/httpd
@@ -193,7 +196,9 @@ Uninstall_Web() {
   [ -d "${nginx_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${nginx_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${nginx_install_dir}/sbin:@@" /etc/profile; echo "${CMSG}Nginx uninstall completed! ${CEND}"; }
   [ -d "${tengine_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${tengine_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${tengine_install_dir}/sbin:@@" /etc/profile; echo "${CMSG}Tengine uninstall completed! ${CEND}"; }
   [ -d "${openresty_install_dir}" ] && { killall nginx > /dev/null 2>&1; rm -rf ${openresty_install_dir} /etc/init.d/nginx /etc/logrotate.d/nginx; sed -i "s@${openresty_install_dir}/nginx/sbin:@@" /etc/profile; echo "${CMSG}OpenResty uninstall completed! ${CEND}"; }
+  [ -d "${caddy_install_dir}" ] && { killall caddy > /dev/null 2>&1; rm -rf ${caddy_install_dir} /etc/init.d/caddy /etc/logrotate.d/caddy; sed -i "s@${caddy_install_dir}/bin:@@" /etc/profile; echo "${CMSG}Caddy uninstall completed! ${CEND}"; }
   [ -e "/lib/systemd/system/nginx.service" ] && { systemctl disable nginx > /dev/null 2>&1; rm -f /lib/systemd/system/nginx.service; }
+  [ -e "/lib/systemd/system/caddy.service" ] && { systemctl disable caddy > /dev/null 2>&1; rm -f /lib/systemd/system/caddy.service; }
   [ -d "${apache_install_dir}" ] && { service httpd stop > /dev/null 2>&1; rm -rf ${apache_install_dir} /etc/init.d/httpd /etc/logrotate.d/apache; sed -i "s@${apache_install_dir}/bin:@@" /etc/profile; echo "${CMSG}Apache uninstall completed! ${CEND}"; }
   [ -e "/lib/systemd/system/httpd.service" ] && { systemctl disable httpd > /dev/null 2>&1; rm -f /lib/systemd/system/httpd.service; }
   [ -d "${tomcat_install_dir}" ] && { killall java > /dev/null 2>&1; rm -rf ${tomcat_install_dir} /etc/init.d/tomcat /etc/logrotate.d/tomcat; echo "${CMSG}Tomcat uninstall completed! ${CEND}"; }
@@ -568,7 +573,7 @@ while :; do
   printf "
 What Are You Doing?
 \t${CMSG} 0${CEND}. Uninstall All
-\t${CMSG} 1${CEND}. Uninstall Nginx/Tengine/OpenResty/Apache/Tomcat
+\t${CMSG} 1${CEND}. Uninstall Nginx/Tengine/OpenResty/Apache/Tomcat/Caddy
 \t${CMSG} 2${CEND}. Uninstall MySQL/MariaDB/Percona
 \t${CMSG} 3${CEND}. Uninstall PostgreSQL
 \t${CMSG} 4${CEND}. Uninstall MongoDB

+ 1 - 0
versions.txt

@@ -1,6 +1,7 @@
 # newest software version
 # Web
 nginx_ver=1.24.0
+caddy_ver=2.7.6
 tengine_ver=3.1.0
 openresty_ver=1.21.4.3
 openssl11_ver=1.1.1w