How To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu
Hello, I'm Harmanjot, a network analyst with a specialization in computer networking. I Love to share the knowledge I've gained through my experience with the Ubuntu. In This guide, I will be going through how To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu.
Prerequisites
Ubuntu v18.04 Or Above
Step 1 — Installing Apache and Updating the Firewall
Update the package manager by using command
sudo apt update
And Then Install Apache with Command
sudo apt install apache2
You’ll be prompted to confirm Apache’s installation. Confirm by pressing Y, then ENTER.
Once the installation is finished, you’ll need to adjust your firewall settings to allow HTTP traffic.To list all currently available UFW application profiles, execute this command:
sudo ufw app list
To only allow traffic on port 80, use the Apache profile:
sudo ufw allow in "Apache"
Verify the change with:
sudo ufw status
Traffic on port 80 is now allowed through the firewall
Verify if it is working or not using this command
http://your_server_ip
Step 2 — Installing MySQL
use apt to acquire and install MySQL software:
sudo apt install mysql-server
Step 3 — Installing PHP
To install these packages, run the following command:
sudo apt install php libapache2-mod-php php-mysql
Once the installation is finished, run the following command to confirm your PHP version:
php -v
In this guide, you have constructed a versatile and reliable foundation for deploying PHP websites and applications, employing Apache as the web server and MySQL as the database management system.
👍🏻Great info.
👍
great explanation