Login to vps

Sudo apt update

Sudo apt upgrade

————————–

sudo apt install software-properties-common

https://vpsfix.com/14412/install-virtualmin-nginx-php-mysql-on-ubuntu-server/
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/nginx

sudo apt update

sudo apt upgrade

sudo wget http://software.virtualmin.com/gpl/scripts/install.sh

sudo /bin/sh install.sh -b LEMP

 log in as root over SSH and run “sudo service fail2ban stop”

sudo service fail2ban starthttps://trendoceans.com/completely-uninstall-mysql-server-in-ubuntu-20-04/embed/#?secret=qBFe0lwXTb

Remove Mysql

sudo systemctl status mysql

sudo systemctl stop mysql

sudo systemctl status mysql

sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*

sudo mv /var/lib/mysql /var/lib/mysql_bk

sudo mv /etc/mysql /etc/mysql_bk

sudo deluser mysql

Uninstall MySQL 8 on Ubuntu 20.04 LTS

Uninstall MySQL 8 on Ubuntu 20.04 LTS

sudo apt autoremove

sudo apt autoclean

————————–

*Manual installation of latest MariaDB for Ubuntu

https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntu&distro_release=focal–ubuntu_focal&mirror=agdsn&version=10.6
sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirror.wtnet.de/mariadb/repo/10.6/ubuntu focal main'

Once the key is imported and the repository added you can install MariaDB 10.6 from the MariaDB repository with:

sudo apt update
sudo apt install mariadb-server mariadb-client

sudo service mariadb start

sudo systemctl status mysql
——————

CHANGE etc/mysql/mysql.cnf TO etc/mysql/mariadb.cnf !!!!!!!!!!!!

Change the PHP execution to FPM

Secure mariadb installation

sudo mysql_secure_installation (not done)

install php 7.4 and extensions

sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,common,mysqli,xml}

sudo apt-get install nginx php7.4-fpm

sudo apt-get install -y php7.4-{ssh2,imagick}

sudo apt install php-zip (zip for 8)

Make the downgraded version of PHP the default version (replace with 7.1 or 7.2 if needed):
sudo update-alternatives --set php /usr/bin/php7.x

apt-get -y install php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-zip