xxxxxxxxxx
Full article here
https://www.digitalocean.com/community/tutorials/how-to-install-lamp-stack-on-ubuntu
//install apache
sudo apt install apache2
// Install PHP
// In addition to the php package, you’ll need php-mysql to connect with mysql and libapache2-mod-php to enable Apache to handle PHP files
sudo apt install php libapache2-mod-php php-mysql
// confirm installed php version
php -v
// install mysql
sudo apt install mysql-server
// SECURE YOUR MYSQL Installation
// set password for user root
a. sudo mysql
// In the interactive mysql shell run the code below to set password for user root
b. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
// exit shell
c. exit
// Run Security script
sudo mysql_secure_installation and click yes or no when neccessary, enabling "VALIDATE PASSWORD PLUGIN" means you will have to change to a stronger password
// Check if you can access mysql command line
sudo mysql -p //then enter passord as prompted