Skip to content

Commit 89a441f

Browse files
Replace MySQL with MariaDB 10.3
1 parent 98cb616 commit 89a441f

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

install/hst-install-ubuntu.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
2525
cron curl dnsutils dovecot-imapd dovecot-pop3d e2fslibs e2fsprogs exim4
2626
exim4-daemon-heavy expect fail2ban flex ftp git idn imagemagick
2727
libapache2-mod-fcgid libapache2-mod-php libapache2-mod-rpaf
28-
libapache2-mod-ruid2 lsof mc mysql-client mysql-common mysql-server nginx
28+
libapache2-mod-ruid2 lsof mc mariadb-client mariadb-common mariadb-server nginx
2929
ntpdate php-cgi php-common php-curl phpmyadmin php-mysql phppgadmin
3030
php-pgsql postgresql postgresql-contrib proftpd-basic quota roundcube-core
3131
roundcube-mysql roundcube-plugins rrdtool rssh spamassassin sudo hestia
@@ -41,7 +41,7 @@ help() {
4141
-v, --vsftpd Install Vsftpd [yes|no] default: yes
4242
-j, --proftpd Install ProFTPD [yes|no] default: no
4343
-k, --named Install Bind [yes|no] default: yes
44-
-m, --mysql Install MySQL [yes|no] default: yes
44+
-m, --mysql Install MariaDB [yes|no] default: yes
4545
-g, --postgresql Install PostgreSQL [yes|no] default: no
4646
-x, --exim Install Exim [yes|no] default: yes
4747
-z, --dovecot Install Dovecot [yes|no] default: yes
@@ -170,7 +170,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
170170
v) vsftpd=$OPTARG ;; # Vsftpd
171171
j) proftpd=$OPTARG ;; # Proftpd
172172
k) named=$OPTARG ;; # Named
173-
m) mysql=$OPTARG ;; # MySQL
173+
m) mysql=$OPTARG ;; # MariaDB
174174
g) postgresql=$OPTARG ;; # PostgreSQL
175175
x) exim=$OPTARG ;; # Exim
176176
z) dovecot=$OPTARG ;; # Dovecot
@@ -284,7 +284,7 @@ check_result $? "No access to Hestia repository"
284284
# Checking installed packages
285285
tmpfile=$(mktemp -p /tmp)
286286
dpkg --get-selections > $tmpfile
287-
for pkg in exim4 mysql-server apache2 nginx hestia; do
287+
for pkg in exim4 mariadb-server apache2 nginx hestia; do
288288
if [ ! -z "$(grep $pkg $tmpfile)" ]; then
289289
conflicts="$pkg $conflicts"
290290
fi
@@ -366,7 +366,7 @@ fi
366366

367367
# Database stack
368368
if [ "$mysql" = 'yes' ]; then
369-
echo ' - MySQL Database Server'
369+
echo ' - MariaDB Database Server'
370370
fi
371371
if [ "$postgresql" = 'yes' ]; then
372372
echo ' - PostgreSQL Database Server'
@@ -478,6 +478,11 @@ if [ "$multiphp" = 'yes' ] || [ "$phpfpm" = 'yes' ]; then
478478
add-apt-repository -y ppa:ondrej/php > /dev/null 2>&1
479479
fi
480480

481+
# Installing MariaDB repo
482+
apt=/etc/apt/sources.list.d
483+
echo "deb http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu $codename main" > $apt/mariadb.list
484+
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
485+
481486
# Installing hestia repo
482487
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
483488
wget --quiet https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
@@ -603,9 +608,9 @@ if [ "$dovecot" = 'no' ]; then
603608
software=$(echo "$software" | sed -e "s/dovecot-pop3d//")
604609
fi
605610
if [ "$mysql" = 'no' ]; then
606-
software=$(echo "$software" | sed -e 's/mysql-server//')
607-
software=$(echo "$software" | sed -e 's/mysql-client//')
608-
software=$(echo "$software" | sed -e 's/mysql-common//')
611+
software=$(echo "$software" | sed -e 's/mariadb-server//')
612+
software=$(echo "$software" | sed -e 's/mariadb-client//')
613+
software=$(echo "$software" | sed -e 's/mariadb-common//')
609614
software=$(echo "$software" | sed -e 's/php7.0-mysql//')
610615
software=$(echo "$software" | sed -e 's/php5-mysql//')
611616
software=$(echo "$software" | sed -e 's/php-mysql//')
@@ -1030,7 +1035,7 @@ fi
10301035

10311036

10321037
#----------------------------------------------------------#
1033-
# Configure MySQL/MariaDB #
1038+
# Configure MariaDB #
10341039
#----------------------------------------------------------#
10351040

10361041
if [ "$mysql" = 'yes' ]; then
@@ -1042,7 +1047,7 @@ if [ "$mysql" = 'yes' ]; then
10421047
mycnf="my-large.cnf"
10431048
fi
10441049

1045-
# Configuring MySQL/MariaDB
1050+
# Configuring MariaDB
10461051
cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
10471052
if [ "$release" = '14.04' ]; then
10481053
mysql_install_db > /dev/null 2>&1
@@ -1061,9 +1066,9 @@ if [ "$mysql" = 'yes' ]; then
10611066
fi
10621067
update-rc.d mysql defaults
10631068
service mysql start
1064-
check_result $? "mysql start failed"
1069+
check_result $? "mariadb start failed"
10651070

1066-
# Securing MySQL/MariaDB installation
1071+
# Securing MariaDB installation
10671072
mpass=$(gen_pass)
10681073
mysqladmin -u root password $mpass > /dev/null 2>&1
10691074
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
@@ -1393,7 +1398,7 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
13931398
ip=$pub_ip
13941399
fi
13951400

1396-
# Configuring MySQL/MariaDB host
1401+
# Configuring MariaDB host
13971402
if [ "$mysql" = 'yes' ]; then
13981403
$HESTIA/bin/v-add-database-host mysql localhost root $mpass
13991404
fi

0 commit comments

Comments
 (0)