LAMP is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.(https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04)
Step 1- Installing Apache and Updating the Firewall
sudo apt update
sudo apt install apache2
Adjust the Firewall to Allow Web Traffic
$ sudo ufw app list
Output
Available applications:
Apache
Apache Full
Apache Secure
OpenSSH
$ sudo ufw app info "Apache Full"
Output
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.
Ports:
80,443/tcp
$ sudo ufw allow in "Apache Full"
http://your_server_ip
Find your Server’s Public IP Address
$ ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
$ sudo apt install curl
$ curl http://icanhazip.com
Step 2- Installing MySQL
$ sudo apt install mysql-server
$ sudo mysql_secure_installation
$ sudo mysql
$ SELECT user,authentication_string,plugin,host FROM mysql.user;
$ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
$ FLUSH PRIVILEGES;
$ SELECT user,authentication_string,plugin,host FROM mysql.user;