Browse Source

feat: Add openjdk-17

oneinstack 1 year ago
parent
commit
d8186da4db
12 changed files with 124 additions and 38 deletions
  1. 1 1
      README.md
  2. 3 3
      addons.sh
  3. 2 8
      backup_setup.sh
  4. 2 0
      include/check_sw.sh
  5. 2 2
      include/composer.sh
  6. 58 0
      include/openjdk-17.sh
  7. 1 1
      include/pecl_fileinfo.sh
  8. 13 2
      include/pecl_imap.sh
  9. 5 1
      include/pecl_ldap.sh
  10. 1 1
      include/upgrade_oneinstack.sh
  11. 22 5
      install.sh
  12. 14 14
      versions.txt

+ 1 - 1
README.md

@@ -10,7 +10,7 @@ Script properties:
 - Providing multiple PHP versions (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
 - Providing a plurality of Tomcat version (Tomcat-10, Tomcat-9, Tomcat-8, Tomcat-7)
-- Providing a plurality of JDK version (OpenJDK-8, OpenJDK-11)
+- 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
 - Installation Nodejs, Pureftpd, phpMyAdmin according to their needs
 - Install memcached, redis according to their needs

+ 3 - 3
addons.sh

@@ -25,9 +25,6 @@ oneinstack_dir=$(dirname "`readlink -f $0`")
 # shellcheck disable=SC2164
 pushd ${oneinstack_dir} > /dev/null
 
-# get the out ip country
-OUTIP_STATE=$(./include/ois.${ARCH} ip_state)
-
 . ./versions.txt
 . ./options.conf
 . ./include/color.sh
@@ -43,6 +40,9 @@ OUTIP_STATE=$(./include/ois.${ARCH} ip_state)
 
 . ./include/ngx_lua_waf.sh
 
+# get the out ip country
+OUTIP_STATE=$(./include/ois.${ARCH} ip_state)
+
 # shellcheck disable=SC2154
 Show_Help() {
   echo

+ 2 - 8
backup_setup.sh

@@ -321,14 +321,8 @@ if [ -n "`echo ${desc_bk} | grep -w 4`" ]; then
     [ -z "${SECRET_KEY}" ] && continue
     echo
     read -e -p "Please enter the Qcloud COS BUCKET: " COS_BUCKET
-    if [[ ${COS_BUCKET} =~ "-${APPID}"$ ]]; then
-      COS_BUCKET=${COS_BUCKET}
-    else
-      [ -z "${COS_BUCKET}" ] && continue
-      echo
-      COS_BUCKET=${COS_BUCKET}-${APPID}
-    fi
-    ${python_install_dir}/bin/coscmd config -u ${APPID} -a ${SECRET_ID} -s ${SECRET_KEY} -r ${REGION} -b ${COS_BUCKET} > /dev/null 2>&1
+    [ -z "${COS_BUCKET}" ] && continue
+    ${python_install_dir}/bin/coscmd config -a ${SECRET_ID} -s ${SECRET_KEY} -r ${REGION} -b ${COS_BUCKET} > /dev/null 2>&1
     ${python_install_dir}/bin/coscmd list > /dev/null 2>&1
     if [ $? -eq 0 ]; then
       echo "${CMSG}APPID/SECRET_ID/SECRET_KEY/REGION/BUCKET OK${CEND}"

+ 2 - 0
include/check_sw.sh

@@ -85,6 +85,8 @@ installDepsRHEL() {
     yum -y groupremove "Basic Web Server" "MySQL Database server" "MySQL Database client"
   fi
 
+  [ "${RHEL_ver}" == '9' ] && [ ! -e "/usr/lib64/libtinfo.so.5" ] && ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5
+
   echo "${CMSG}Installing dependencies packages...${CEND}"
   # Install needed packages
   pkgList="perl-FindBin deltarpm drpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel libzip libzip-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel ncurses-compat-libs libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel net-tools libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt zip unzip chrony oniguruma-devel rpcgen sqlite-devel sysstat patch bc expect expat-devel perl-devel oniguruma oniguruma-devel libtirpc-devel nss libnsl rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux chkconfig firewalld"

+ 2 - 2
include/composer.sh

@@ -15,10 +15,10 @@ Install_composer() {
     else
       pushd ${oneinstack_dir}/src > /dev/null
       if [ "${OUTIP_STATE}"x == "China"x ]; then
-        wget -c https://mirrors.aliyun.com/composer/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
+        wget --no-check-certificate -c https://mirrors.aliyun.com/composer/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
         ${php_install_dir}/bin/php /usr/local/bin/composer config -g repo.packagist composer https://packagist.phpcomposer.com
       else
-        wget -c https://getcomposer.org/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
+        wget --no-check-certificate -c https://getcomposer.org/composer.phar -O /usr/local/bin/composer > /dev/null 2>&1
       fi
       chmod +x /usr/local/bin/composer
       if [ -e "/usr/local/bin/composer" ]; then

+ 58 - 0
include/openjdk-17.sh

@@ -0,0 +1,58 @@
+#!/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_OpenJDK17() {
+  if [ "${Family}" == 'rhel' ]; then
+    if [[ "${RHEL_ver}" =~ ^7$ ]]; then
+      cat > /etc/yum.repos.d/adoptium.repo << EOF
+[Adoptium]
+name=Adoptium
+baseurl=https://mirrors.tuna.tsinghua.edu.cn/Adoptium/rpm/rhel\$releasever-\$basearch/
+enabled=1
+gpgcheck=0
+EOF
+      JAVA_HOME=/usr/lib/jvm/temurin-17-jdk
+    else
+      yum -y install java-17-openjdk-devel
+      JAVA_HOME=/usr/lib/jvm/java-17-openjdk
+    fi
+  elif [ "${Family}" == 'debian' ]; then
+    if [[ "${Debian_ver}" =~ ^9$|^10$ ]]; then
+      #wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
+      cat ${oneinstack_dir}/src/adoptium.key | sudo apt-key add -
+      apt-add-repository --yes https://mirrors.tuna.tsinghua.edu.cn/Adoptium/deb
+      apt -y update
+      apt-get --no-install-recommends -y install temurin-17-jdk
+      JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-${SYS_ARCH}
+    fi
+  elif [ "${Family}" == 'ubuntu' ]; then
+    if [[ "${Ubuntu_ver}" =~ ^16$ ]]; then
+      cat ${oneinstack_dir}/src/adoptium.key | sudo apt-key add -
+      apt-add-repository --yes https://mirrors.tuna.tsinghua.edu.cn/Adoptium/deb
+      apt -y update
+      apt-get --no-install-recommends -y install temurin-17-jdk
+      JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-${SYS_ARCH}
+    else
+      apt-get --no-install-recommends -y install openjdk-17-jdk
+      JAVA_HOME=/usr/lib/jvm/java-17-openjdk-${SYS_ARCH}
+    fi
+  fi
+  if [ -e "${JAVA_HOME}/bin/java" ]; then
+    cat > /etc/profile.d/openjdk.sh << EOF
+export JAVA_HOME=${JAVA_HOME}
+export CLASSPATH=\$JAVA_HOME/lib/tools.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib
+EOF
+    . /etc/profile.d/openjdk.sh
+    echo "${CSUCCESS}OpenJDK17 installed successfully! ${CEND}"
+  else
+    echo "${CFAILURE}OpenJDK17 install failed, Please contact the author! ${CEND}" && grep -Ew 'NAME|ID|ID_LIKE|VERSION_ID|PRETTY_NAME' /etc/os-release
+    kill -9 $$; exit 1;
+  fi
+}

+ 1 - 1
include/pecl_fileinfo.sh

@@ -18,7 +18,7 @@ Install_pecl_fileinfo() {
     pushd php-${PHP_detail_ver}/ext/fileinfo > /dev/null
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config
-    [[ "${php_option}" =~ ^1[0-1]$ ]] && sed -i 's@^CFLAGS = -g -O2@CFLAGS = -std=c99 -g -O2@' Makefile
+    sed -i 's@^CFLAGS =.*@CFLAGS = -std=c99 -g@' Makefile
     make -j ${THREAD} && make install
     popd > /dev/null
     if [ -f "${phpExtensionDir}/fileinfo.so" ]; then

+ 13 - 2
include/pecl_imap.sh

@@ -12,8 +12,19 @@ Install_pecl_imap() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     if [ "${PM}" == 'yum' ]; then
-      yum -y install libc-client-devel
-      [ ! -e /usr/lib/libc-client.so ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      if [ "${RHEL_ver}" == '9' ]; then
+        cat > /etc/yum.repos.d/remi.repo << EOF
+[remi]
+name=Remi's RPM repository for Enterprise Linux 9 - \$basearch
+mirrorlist=http://cdn.remirepo.net/enterprise/9/remi/\$basearch/mirror
+enabled=0
+gpgcheck=0
+EOF
+        dnf -y --enablerepo=remi install uw-imap-devel
+      else
+        yum -y install libc-client-devel
+        [ ! -e /usr/lib/libc-client.so ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      fi
     else
       apt-get -y install libc-client2007e-dev
     fi

+ 5 - 1
include/pecl_ldap.sh

@@ -24,7 +24,11 @@ Install_pecl_ldap() {
       ln -s /usr/lib/${ARCH}-linux-gnu/liblber.so /usr/lib/
     fi
     ${php_install_dir}/bin/phpize
-    ./configure --with-php-config=${php_install_dir}/bin/php-config --with-ldap --with-libdir=lib64
+    if [ "${PM}" == 'yum' ]; then
+      ./configure --with-php-config=${php_install_dir}/bin/php-config --with-ldap --with-libdir=lib64
+    else
+      ./configure --with-php-config=${php_install_dir}/bin/php-config --with-ldap --with-libdir=lib/x86_64-linux-gnu
+    fi
     make -j ${THREAD} && make install
     popd > /dev/null
     if [ -f "${phpExtensionDir}/ldap.so" ]; then

+ 1 - 1
include/upgrade_oneinstack.sh

@@ -16,7 +16,7 @@ Upgrade_OneinStack() {
     /bin/mv options.conf /tmp
     sed -i '/oneinstack_dir=/d' /tmp/options.conf
     [ -e /tmp/oneinstack.tar.gz ] && rm -rf /tmp/oneinstack.tar.gz
-    wget -qc http://mirrors.linuxeye.com/oneinstack.tar.gz -O /tmp/oneinstack.tar.gz
+    wget --no-check-certificate -qc http://mirrors.linuxeye.com/oneinstack.tar.gz -O /tmp/oneinstack.tar.gz
     if [ -n "`echo ${oneinstack_dir} | grep lnmp`" ]; then
       tar xzf /tmp/oneinstack.tar.gz -C /tmp
       /bin/cp -R /tmp/oneinstack/* ${oneinstack_dir}/

+ 22 - 5
install.sh

@@ -58,7 +58,7 @@ Show_Help() {
                               yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
   --nodejs                    Install Nodejs
   --tomcat_option [1-4]       Install Tomcat version
-  --jdk_option [1-2]          Install JDK version
+  --jdk_option [1-3]          Install JDK version
   --db_option [1-14]          Install DB version
   --dbinstallmethod [1-2]     DB install method, default: 1 binary install
   --dbrootpwd [password]      DB super password
@@ -151,7 +151,7 @@ while :; do
       ;;
     --jdk_option)
       jdk_option=$2; shift 2
-      [[ ! ${jdk_option} =~ ^[1-2]$ ]] && { echo "${CWARNING}jdk_option input error! Please only input number 1~2${CEND}"; exit 1; }
+      [[ ! ${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
@@ -324,14 +324,28 @@ if [ ${ARG_NUM} == 0 ]; 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-3]$ ]]; then
+            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-2]$ ]]; then
+                if [[ ! ${jdk_option} =~ ^[1-3]$ ]]; then
                   echo "${CWARNING}input error! Please only input number 1~3${CEND}"
                 else
                   break
@@ -755,7 +769,6 @@ if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]];
 fi
 
 # Database
-[ "${Family}" == 'rhel' ] && [ "${RHEL_ver}" == '9' ] && dbinstallmethod=2 && checkDownload
 case "${db_option}" in
   1)
     . include/mysql-8.0.sh
@@ -1049,6 +1062,10 @@ case "${jdk_option}" in
     . include/openjdk-11.sh
     Install_OpenJDK11 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
+  3)
+    . include/openjdk-17.sh
+    Install_OpenJDK17 2>&1 | tee -a ${oneinstack_dir}/install.log
+    ;;
 esac
 
 case "${tomcat_option}" in

+ 14 - 14
versions.txt

@@ -3,15 +3,15 @@
 nginx_ver=1.24.0
 tengine_ver=2.4.0
 openresty_ver=1.21.4.1
-openssl11_ver=1.1.1t
+openssl11_ver=1.1.1u
 openssl_ver=1.0.2u
 
-tomcat10_ver=10.1.6
-tomcat9_ver=9.0.72
-tomcat8_ver=8.5.86
+tomcat10_ver=10.1.9
+tomcat9_ver=9.0.75
+tomcat8_ver=8.5.89
 tomcat7_ver=7.0.109
 
-apache_ver=2.4.55
+apache_ver=2.4.57
 pcre_ver=8.45
 apr_ver=1.7.0
 apr_util_ver=1.6.1
@@ -23,13 +23,13 @@ mysql57_ver=5.7.42
 mysql56_ver=5.6.51
 mysql55_ver=5.5.62
 
-mariadb106_ver=10.6.12
-mariadb105_ver=10.5.19
-mariadb104_ver=10.4.28
+mariadb106_ver=10.6.13
+mariadb105_ver=10.5.20
+mariadb104_ver=10.4.29
 mariadb55_ver=5.5.68
 
 percona80_ver=8.0.32-24
-percona57_ver=5.7.41-44
+percona57_ver=5.7.42-45
 percona56_ver=5.6.51-91.0
 percona55_ver=5.5.62-38.14
 
@@ -48,8 +48,8 @@ php72_ver=7.2.34
 php73_ver=7.3.33
 php74_ver=7.4.33
 php80_ver=8.0.28
-php81_ver=8.1.18
-php82_ver=8.2.5
+php81_ver=8.1.20
+php82_ver=8.2.7
 
 # Nodejs
 nodejs_ver=18.14.2
@@ -64,7 +64,7 @@ icu4c_ver=63_1
 libsodium_ver=1.0.18
 libzip_ver=1.2.0
 argon2_ver=20171227
-imagemagick_ver=7.1.1-8
+imagemagick_ver=7.1.1-11
 imagick_ver=3.7.0
 imagick_oldver=3.4.4
 graphicsmagick_ver=1.3.40
@@ -94,7 +94,7 @@ pecl_redis_ver=5.3.7
 pecl_redis_oldver=4.3.0
 
 # Memcached
-memcached_ver=1.6.19
+memcached_ver=1.6.20
 libmemcached_ver=1.0.18
 pecl_memcached_ver=3.2.0
 pecl_memcached_oldver=2.2.0
@@ -120,7 +120,7 @@ boost_oldver=1.59.0
 
 # Others
 lua_nginx_module_ver=0.10.24
-luajit2_ver=2.1-20230119
+luajit2_ver=2.1-20230410
 lua_resty_core_ver=0.1.26
 lua_resty_lrucache_ver=0.13
 lua_cjson_ver=2.1.0.12