#!/bin/bash # Update package lists apt update # Install Apache apt install apache2 -y # Install MySQL apt install mysql-server -y # Secure MySQL installation mysql_secure_installation # Install PHP and its extensions apt install php libapache2-mod-php php-mysql -y # Restart Apache to load PHP module systemctl restart apache2 # Allow Apache through the firewall ufw allow in "Apache Full" echo "LAMP stack installation complete."
chmod +x scriptname.sh
./scriptname.sh
Alternativ ubuntu 22.04 to wordpress: https://linuxhint.com/install-wordpress-ubuntu-server/