Просмотр исходного кода

Merge pull request #807 from hestiacp/core-ubuntu-20.04

Add support for Ubuntu Server 20.04
Raphael Schneeberger 5 лет назад
Родитель
Сommit
4cbdb81dcb
4 измененных файлов с 41 добавлено и 28 удалено
  1. 1 1
      README.md
  2. 36 23
      install/hst-install-ubuntu.sh
  3. 3 3
      install/hst-install.sh
  4. 1 1
      src/hst_autocompile.sh

+ 1 - 1
README.md

@@ -43,7 +43,7 @@ What does Hestia Control Panel support?
 Supported operating systems:
 ----------------------------
 * Debian 8, 9, 10
-* Ubuntu 16.04 LTS or Ubuntu 18.04 LTS (the latest LTS release is recommended)
+* Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, or Ubuntu 20.04 LTS (the latest LTS release is generally recommended)
 * **NOTE:** Hestia Control Panel must be installed on top of a fresh operating system installation to ensure proper functionality.
 
 Installing Hestia Control Panel

+ 36 - 23
install/hst-install-ubuntu.sh

@@ -41,7 +41,8 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
     php$fpm_v-mbstring php$fpm_v-opcache php$fpm_v-pspell php$fpm_v-readline
     php$fpm_v-xml postgresql postgresql-contrib proftpd-basic quota
     roundcube-core roundcube-mysql roundcube-plugins rrdtool rssh spamassassin
-    sudo hestia hestia-nginx hestia-php vim-common vsftpd whois zip acl sysstat setpriv"
+    sudo hestia hestia-nginx hestia-php vim-common vsftpd whois zip acl sysstat
+    setpriv libonig5"
 
 # Defining help function
 help() {
@@ -561,9 +562,6 @@ echo
 # Installing Nginx repo
 if [ "$nginx" = 'yes' ]; then
     echo "(*) NGINX"
-    if [ -e $apt/nginx.list ]; then
-        rm $apt/nginx.list
-    fi
     echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" \
     > $apt/nginx.list
     wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
@@ -581,7 +579,7 @@ if [ "$apache" = 'yes' ]; then
 fi
 
 # Installing MariaDB repo
-if [ "$mysql" = 'yes' ]; then
+if [ "$mysql" = 'yes' ] && [ "$release" != "20.04" ]; then
     echo "(*) MariaDB"
     echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
     APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
@@ -793,10 +791,15 @@ if [ -d "$withdebs" ]; then
     software=$(echo "$software" | sed -e "s/hestia-php//")
     software=$(echo "$software" | sed -e "s/hestia//")
 fi
-
-if [ "$release" = '16.04' ]; then
+if [ "$release" = '16.04' ] || [ "$release" = '20.04' ]; then
     software=$(echo "$software" | sed -e "s/setpriv/util-linux/")
 fi
+if [ "$release" = '20.04' ]; then
+    software=$(echo "$software" | sed -e "s/rssh//")
+fi
+if [ "$release" != '20.04' ]; then
+    software=$(echo "$software" | sed -e "s/libonig5//")
+fi
 
 #----------------------------------------------------------#
 #                 Disable Apparmor on LXC                  #
@@ -906,13 +909,15 @@ chmod 755 /etc/cron.daily/ntpdate
 ntpdate -s pool.ntp.org
 
 # Setup rssh
-if [ -z "$(grep /usr/bin/rssh /etc/shells)" ]; then
-    echo /usr/bin/rssh >> /etc/shells
+if [ "$release" != '20.04' ]; then
+    if [ -z "$(grep /usr/bin/rssh /etc/shells)" ]; then
+        echo /usr/bin/rssh >> /etc/shells
+    fi
+    sed -i 's/#allowscp/allowscp/' /etc/rssh.conf
+    sed -i 's/#allowsftp/allowsftp/' /etc/rssh.conf
+    sed -i 's/#allowrsync/allowrsync/' /etc/rssh.conf
+    chmod 755 /usr/bin/rssh
 fi
-sed -i 's/#allowscp/allowscp/' /etc/rssh.conf
-sed -i 's/#allowsftp/allowsftp/' /etc/rssh.conf
-sed -i 's/#allowrsync/allowrsync/' /etc/rssh.conf
-chmod 755 /usr/bin/rssh
 
 
 #----------------------------------------------------------#
@@ -1171,9 +1176,11 @@ if [ "$apache" = 'yes' ]; then
     chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
     chmod 751 /var/log/apache2/domains
 
-    update-rc.d apache2 defaults > /dev/null 2>&1
-    systemctl start apache2 >> $LOG
-    check_result $? "apache2 start failed"
+    if [ "$release" != '20.04' ]; then
+        update-rc.d apache2 defaults > /dev/null 2>&1
+        systemctl start apache2 >> $LOG
+        check_result $? "apache2 start failed"
+    fi
 else
     update-rc.d apache2 disable > /dev/null 2>&1
     systemctl stop apache2 > /dev/null 2>&1
@@ -1318,8 +1325,9 @@ if [ "$mysql" = 'yes' ]; then
     # Unpack files
     tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
 
-    # Delete file to prevent error
+    # Delete files to prevent error
     rm -fr /usr/share/phpmyadmin/doc/html
+    rm -fr /usr/share/phpmyadmin/js/vendor/openlayers
 
     # Overwrite old files
     cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
@@ -1329,7 +1337,7 @@ if [ "$mysql" = 'yes' ]; then
     sed -i "s|define('TEMP_DIR', ROOT_PATH . 'tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
 
     # Create temporary folder and change permission
-    mkdir /usr/share/phpmyadmin/tmp
+    [ ! -d "/usr/share/phpmyadmin/tmp" ] && mkdir /usr/share/phpmyadmin/tmp
     chmod 777 /usr/share/phpmyadmin/tmp
 
     # Clear Up
@@ -1362,7 +1370,7 @@ fi
 #----------------------------------------------------------#
 
 if [ "$named" = 'yes' ]; then
-    echo "(*) Configuring Bind DNS server..."
+    echo "(*) Configuring Bind DNS server..."    
     cp -f $HESTIA_INSTALL_DIR/bind/named.conf /etc/bind/
     cp -f $HESTIA_INSTALL_DIR/bind/named.conf.options /etc/bind/
     chown root:bind /etc/bind/named.conf
@@ -1378,8 +1386,13 @@ if [ "$named" = 'yes' ]; then
             systemctl restart apparmor >> $LOG
         fi
     fi
-    update-rc.d bind9 defaults
-    systemctl start bind9
+    if [ "$release" = '20.04' ]; then
+        update-rc.d named defaults
+        systemctl start named
+    else
+        update-rc.d bind9 defaults
+        systemctl start bind9
+    fi
     check_result $? "bind9 start failed"
 
     # Workaround for OpenVZ/Virtuozzo
@@ -1434,7 +1447,7 @@ if [ "$dovecot" = 'yes' ]; then
     gpasswd -a dovecot mail > /dev/null 2>&1
     cp -rf $HESTIA_INSTALL_DIR/dovecot /etc/
     cp -f $HESTIA_INSTALL_DIR/logrotate/dovecot /etc/logrotate.d/
-    if [ "$release" = '18.04' ]; then
+    if [ "$release" = '18.04' ] || [ "$release" = '20.04' ]; then
         rm -f /etc/dovecot/conf.d/15-mailboxes.conf
     fi
     chown -R root:root /etc/dovecot*
@@ -1664,7 +1677,7 @@ if [ "$apache" = 'yes' ] && [ "$nginx"  = 'yes' ] ; then
     echo "</IfModule>" >> remoteip.conf
     sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/apache2/apache2.conf
     a2enmod remoteip >> $LOG
-    systemctl restart apache2
+    systemctl start apache2
 fi
 
 # Configuring MariaDB host

+ 3 - 3
install/hst-install.sh

@@ -6,7 +6,7 @@
 # Currently Supported Operating Systems:
 #
 #   Debian 8, 9, 10
-#   Ubuntu 16.04, 18.04
+#   Ubuntu 16.04, 18.04, 20.04
 #
 
 # Am I root?
@@ -62,7 +62,7 @@ no_support_message(){
     echo "Hestia Control Panel. Officially supported releases:"
     echo "****************************************************"
     echo "  Debian 8, 9, 10"
-    echo "  Ubuntu 16.04 LTS, 18.04 LTS"
+    echo "  Ubuntu 16.04 LTS, 18.04, 20.04 LTS"
     echo ""
     exit 1;
 }
@@ -99,7 +99,7 @@ check_wget_curl(){
 
 # Check for supported operating system before proceeding with download
 # of OS-specific installer, and throw error message if unsupported OS detected.
-if [[ "$release" =~ ^(8|9|10|16.04|18.04)$ ]]; then
+if [[ "$release" =~ ^(8|9|10|16.04|18.04|20.04)$ ]]; then
     check_wget_curl $*
 else
     no_support_message

+ 1 - 1
src/hst_autocompile.sh

@@ -98,7 +98,7 @@ mkdir -p $DEB_DIR
 mkdir -p $ARCHIVE_DIR
 
 # Set package dependencies for compiling
-SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
+SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config libsqlite3-dev libonig-dev'
 
 # Define a timestamp function
 timestamp() {