Now that we’re sufficiently protected from all the bad h4x0r5 in the world, it’s time to install Apache, MySQL, and PHP for our upcoming (and obviously already completed) WordPress install.
sudo apt install apache2 -y
sudo ufw allow in “Apache Full”
Be sure, at this point, to create a firewall rule in Azure> Networking to enable inbound communication on 80 and 443.
Once Apache is installed and allowed to communicate, it is time to install MySQL.
sudo apt install mysql-server -y
VALIDATE PASSWORD PLUGIN=Y
Create applicable password as prompted.
Press Y and <enter> for remaining prompts.
mysql> ALTER user ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘<new very secure password>’
mysql> FLUSH PRIVILEGES
Last but not least, time to install PHP.
sudo apt install php libapache2-mod-php php-mysql
Move index.php to the first position after DirectoryIndex within /etc/apache2/mods-enabled/dir.conf
index.html index.cgi index.pl index.xhtml index.htm
sudo systemctl restart apache2
FIN. I love LAMP.