LAMP Server on AWS | Task - 2

LAMP Server on AWS | Task - 2

Cloud Maestro
·Jul 27, 2021·

3 min read

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article


In this task, I have to deploy a LAMP(Linux Apache MySQL PHP) server on AWS. I am using Ubuntu Server 20.04 LTS. I am going to

  1. Launch a New AWS EC2 Instance
  2. Connect to the Instance using SSH
  3. Install Apache2 and verify the installation
  4. Install MySQL
  5. Install PHP and verify the installation

Launching AWS EC2 Instance

  • I opened the AWS Management console and started the EC2 Launch. I chose the Ubuntu 20.04 LTS image.png

  • Following that, I chose the t2.micro type which is Free Tier eligible image.png

  • After that , Left the Configure Instance, Add Storage, Add Tags as default

  • In the Configure Security Group Section, I added HTTP protocol to verify the progress of the installation. image.png

  • After Review Process, I created and downloaded the keypair to access the EC2 instance image.png

Connecting to the Instance:

  • Now, the EC2 instance is running and I am connecting to the instance using the command
    ssh -i "test-lamp-stack.pem"

Install Apache2

  • I updated and upgraded the instance. image.png

  • Now, its time to install the apache2 using the command

    sudo apt-get install apache2


  • Verified the installation by using the Public IP address [] image.png

Install MySQL

  • Installed MySQL using the command

    sudo apt-get install mysql-server


  • To strength the Database, I am using the command

    sudo mysql_secure_installation


  • To verify the installation of MySQL, I used the command:

    sudo mysql -u root -p


Install PHP

  • To install the PHP and its common extensions, I used the command:

    sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-json php-zip


  • I restarted the apache using the command:

    sudo service apache2 restart
  • Then verified the installation using the command:

    php -v


Clearing Up

  • After the Verification of all the installations, I successfully installed Apache, MySQL and PHP on a Linux Server.
  • I ended up the session in the PowerShell and closed the Powershell
  • After that, terminated the instance in the Management Console. image.png


I did these things more than 10 times, so I just went next, next, next... If you are reading this, make sure that every command works well and fine and then move on to the next command. Have any doubt, just Join the Discord and Fire up your question. I will try my best to answer the question. I did these things during the beginning of my learning and I was scared. This feels like refresh course for me and its good! Lets see How the next challenge goes....

Share this