How To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu

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        
Article content


And Then Install Apache with Command

sudo apt install apache2        
Article content


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        
Article content


To only allow traffic on port 80, use the Apache profile:

sudo ufw allow in "Apache"        
Article content


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        
Article content


Step 3 — Installing PHP


To install these packages, run the following command:

sudo apt install php libapache2-mod-php php-mysql        
Article content


Once the installation is finished, run the following command to confirm your PHP version:

php -v        
Article content


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.


To view or add a comment, sign in

More articles by Harmanjot Panesar

  • Java Data Types And Values

    Hello, I'm Harmanjot, a network analyst with a specialization in computer networking. I Love to share the knowledge…

    3 Comments
  • IKEv2 Protocol and VPN Setup Guide

    Hello, I'm Harmanjot, a network analyst with a specialization in computer networking. Today, I'll guide you through the…

    2 Comments
  • How To Setup OpenVPN With Linode

    Hello, I'm Harmanjot, a network analyst with a specialization in computer networking. Today, I'll guide you through the…

    1 Comment
  • Installation and Configuration of VPN on Windows Server

    I'm Harmanjot, and I bring a wealth of expertise in computer networking, having graduated from Canadore College in…

    1 Comment
  • Installing and Configuring DHCP Server On Windows Server

    I Love to share the knowledge I've gained through my experience with the Windows Server. In This Article I'm I Will…

Explore content categories