This tutorial will describe the installation of a traditional LAMP stack (Linux, Apache2, MySQL and PHP) on Ubuntu 20.04 using PHP FPM (FastCGI Process Manager), which is an alternative implementation of PHP that offers additional features like Adaptive process spawning.
SERVER-IP - Replace this with the ip number of your server
MYDB - Replace this with the name the database you will create in this tutorial
MYDBUSER - Replace this with the name the non-root username you will create for your database
MYDBROOTPASS - Replace this with the password you will use for the database root account.
MYDBUSERPASS - Replace this with a unique password you will create for MYDBUSER
MYAPPDATABASE - Replace this with a a name you will use for a sample database in this tutorial
MYAPPUSER - Replace this with a a username you will use to access the sample database in this tutorial
MYAPPPASS - Replace this with a unique password you will create for MYAPPUSER
Apache web server debian packages are available under the default repositories. Login to your Ubuntu system with sudo privileges account. Open a terminal and execute the following commands:
$ sudo apt update & sudo apt upgrade -y
$ sudo apt install apache2 libapache2-mod-fcgid -y
Now we need to open ports for our web server in our UFW firewall. Port 80 for insecure traffic, and 443 for SSL traffic. We can do this by simply allowing "Apache Full"
$ sudo ufw allow "Apache Full"
Now open a web browser and see if Apache is working:
You should now see the default Apache Welcome Page: