@@ -25,8 +25,8 @@ if [ "$release" -eq 9 ]; then
2525 php-common php-cgi php-mysql php-curl php-pgsql awstats webalizer
2626 vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy clamav-daemon
2727 spamassassin dovecot-imapd dovecot-pop3d roundcube-core net-tools
28- roundcube-mysql roundcube-plugins mysql-server mysql -common
29- mysql-client postgresql postgresql-contrib phppgadmin phpmyadmin mc
28+ roundcube-mysql roundcube-plugins mariadb-client mariadb -common
29+ mariadb-server postgresql postgresql-contrib phppgadmin phpmyadmin mc
3030 flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
3131 e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
3232 bsdmainutils cron hestia hestia-nginx hestia-php expect libmail-dkim-perl
3838 php5-mysql php5-curl php5-pgsql awstats webalizer vsftpd net-tools
3939 proftpd-basic bind9 exim4 exim4-daemon-heavy clamav-daemon
4040 spamassassin dovecot-imapd dovecot-pop3d roundcube-core
41- roundcube-mysql roundcube-plugins mysql-server mysql -common
42- mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
41+ roundcube-mysql roundcube-plugins mariadb-client mariadb -common
42+ mariadb-server postgresql postgresql-contrib phppgadmin phpMyAdmin mc
4343 flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
4444 e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
4545 bsdmainutils cron hestia hestia-nginx hestia-php expect libmail-dkim-perl
@@ -56,7 +56,7 @@ help() {
5656 -v, --vsftpd Install Vsftpd [yes|no] default: yes
5757 -j, --proftpd Install ProFTPD [yes|no] default: no
5858 -k, --named Install Bind [yes|no] default: yes
59- -m, --mysql Install MySQL [yes|no] default: yes
59+ -m, --mysql Install MariaDB [yes|no] default: yes
6060 -g, --postgresql Install PostgreSQL [yes|no] default: no
6161 -x, --exim Install Exim [yes|no] default: yes
6262 -z, --dovecot Install Dovecot [yes|no] default: yes
@@ -186,7 +186,7 @@ while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:fh" Option; do
186186 v) vsftpd=$OPTARG ;; # Vsftpd
187187 j) proftpd=$OPTARG ;; # Proftpd
188188 k) named=$OPTARG ;; # Named
189- m) mysql=$OPTARG ;; # MySQL
189+ m) mysql=$OPTARG ;; # MariaDB
190190 g) postgresql=$OPTARG ;; # PostgreSQL
191191 x) exim=$OPTARG ;; # Exim
192192 z) dovecot=$OPTARG ;; # Dovecot
380380
381381# DB stack
382382if [ " $mysql " = ' yes' ]; then
383- echo ' - MySQL Database Server'
383+ echo ' - MariaDB Database Server'
384384fi
385385if [ " $postgresql " = ' yes' ]; then
386386 echo ' - PostgreSQL Database Server'
479479apt-get -y upgrade
480480check_result $? ' apt-get upgrade failed'
481481
482+ # Define apt conf location
483+ apt=/etc/apt/sources.list.d
484+
482485# Installing nginx repo
483486apt=/etc/apt/sources.list.d
484487echo " deb http://nginx.org/packages/debian/ $codename nginx" > $apt /nginx.list
@@ -492,6 +495,10 @@ if [ "$multiphp" = 'yes' ] || [ "$phpfpm" = 'yes' ]; then
492495 apt-key add /tmp/php_signing.key
493496fi
494497
498+ # Installing MariaDB repo
499+ echo " deb http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu $codename main" > $apt /mariadb.list
500+ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 > /dev/null 2>&1
501+
495502# Installing hestia repo
496503echo " deb https://$RHOST / $codename main" > $apt /hestia.list
497504wget https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
@@ -555,7 +562,7 @@ service dovecot stop > /dev/null 2>&1
555562cp /etc/dovecot.conf $hst_backups /dovecot > /dev/null 2>&1
556563cp -r /etc/dovecot/* $hst_backups /dovecot > /dev/null 2>&1
557564
558- # Backing up MySQL/MariaDB configuration and data
565+ # Backup MySQL/MariaDB configuration and data
559566service mysql stop > /dev/null 2>&1
560567killall -9 mysqld > /dev/null 2>&1
561568mv /var/lib/mysql $hst_backups /mysql/mysql_datadir > /dev/null 2>&1
@@ -618,9 +625,9 @@ if [ "$dovecot" = 'no' ]; then
618625 software=$( echo " $software " | sed -e " s/dovecot-pop3d//" )
619626fi
620627if [ " $mysql " = ' no' ]; then
621- software=$( echo " $software " | sed -e ' s/mysql -server//' )
622- software=$( echo " $software " | sed -e ' s/mysql -client//' )
623- software=$( echo " $software " | sed -e ' s/mysql -common//' )
628+ software=$( echo " $software " | sed -e ' s/mariadb -server//' )
629+ software=$( echo " $software " | sed -e ' s/mariadb -client//' )
630+ software=$( echo " $software " | sed -e ' s/mariadb -common//' )
624631 software=$( echo " $software " | sed -e ' s/php5-mysql//' )
625632 software=$( echo " $software " | sed -e ' s/php-mysql//' )
626633 software=$( echo " $software " | sed -e ' s/phpMyAdmin//' )
@@ -1054,33 +1061,25 @@ if [ "$mysql" = 'yes' ]; then
10541061 mycnf=" my-large.cnf"
10551062 fi
10561063
1057- # MySQL configuration
1064+ # Configuring MariaDB
10581065 cp -f $hestiacp /mysql/$mycnf /etc/mysql/my.cnf
1059- mysql_install_db
1066+ mysql_install_db > /dev/null 2>&1
1067+
10601068 update-rc.d mysql defaults
10611069 service mysql start
1062- check_result $? " mysql start failed"
1070+ check_result $? " mariadb start failed"
10631071
1064- # Securing MySQL installation
1072+ # Securing MariaDB installation
10651073 mpass=$( gen_pass)
1066- mysqladmin -u root password $mpass
1074+ mysqladmin -u root password $mpass > /dev/null 2>&1
10671075 echo -e " [client]\npassword='$mpass '\n" > /root/.my.cnf
10681076 chmod 600 /root/.my.cnf
1069- if [ " $release " = ' 8' ]; then
1070- mysql -e " DELETE FROM mysql.user WHERE User=''"
1071- mysql -e " DROP DATABASE test" > /dev/null 2>&1
1072- mysql -e " DELETE FROM mysql.db WHERE Db='test' OR Db='test\\ _%'"
1073- mysql -e " DELETE FROM mysql.user WHERE user='' or password='';"
1074- mysql -e " FLUSH PRIVILEGES"
1075- fi
1076- if [ " $release " = ' 9' ]; then
1077- mysql -e " DELETE FROM mysql.user WHERE User=''"
1078- mysql -e " DROP DATABASE test" > /dev/null 2>&1
1079- mysql -e " DELETE FROM mysql.db WHERE Db='test' OR Db='test\\ _%'"
1080- mysql -e " DELETE FROM mysql.user WHERE user='';"
1081- mysql -e " ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$mpass ';"
1082- mysql -e " FLUSH PRIVILEGES"
1083- fi
1077+
1078+ # Clear MariaDB Test Users and Databases
1079+ mysql -e " DELETE FROM mysql.user WHERE User=''"
1080+ mysql -e " DROP DATABASE test" > /dev/null 2>&1
1081+ mysql -e " DELETE FROM mysql.db WHERE Db='test' OR Db='test\\ _%'"
1082+ mysql -e " DELETE FROM mysql.user WHERE user='';"
10841083
10851084 # Configuring phpMyAdmin
10861085 if [ " $apache " = ' yes' ]; then
0 commit comments