YouTube video illustration of how to deploy website to EC2 on AWS

In this tutorial I will clone the codebase of a pre-built website from GitHub into an Elastic Compute Cloud (EC2) instance and serve the website files over the internet.

This tutorial builds on a previous tutorial: How to setup an Amazon Elastic Compute Cloud instance and install Linux, Apache, MariaDB and PHP (LAMP Stack) on Amazon Linux 2023.

Prerequisite

Complete tutorial: How to setup an Amazon Elastic Compute Cloud instance and install Linux, Apache, MariaDB and PHP (LAMP Stack) on Amazon Linux 2023.

Find the link to the YouTube tutorial here. https://youtu.be/UmT87L_AnX4

Steps

i) SSH into the EC2 instance – Log into your AWS Cloud console and SSH into the EC2 instance. 

ii) Change to the Apache web server document root directory:

cd /var/www/html

List files

cd /var/www/html

iii) Install Git tool and clone prebuilt code from https://github.com/ugogineering/computershop2 into the VM with the command:

sudo yum install git -y

git clone https://github.com/ugogineering/computershop2.git

List files:

ls

Change to the cloned directory

cd computershop2

iv) Move cloned files to web server root directory

sudo mv * ..

v) Change directory

cd ..

vi) List files

ls

vi) Visit website file in the virtual machine from a browser over the internet by opening a browser and going to 

http://[EXTERNAL_IP]/index.php

You should see the website home page. Make sure that you don’t use the https protocol specifier because HTTPS is not configured.

END.

What we accomplished in this tutorial

i) We cloned a website code from GitHub into a compute engine virtual machine on Google Cloud Platform (GCP);

ii) We viewed a web page from the virtual machine from a browser over the internet.

NB: With the skills you learned in this blog and accompanying video you have skills to clone code from a repository into a compute engine virtual machine.

If you have comments or corrections about this blog post please write them in the comments section below and I will respond. Thank you.

References

  1. How to setup an Amazon Elastic Compute Cloud instance and install Linux, Apache, MariaDB and PHP (LAMP Stack) on Amazon Linux 2023 – YouTube Video.
  2. How to setup an Amazon Elastic Compute Cloud instance and install Linux, Apache, MariaDB and PHP (LAMP Stack) on Amazon Linux 2023 – blog post.
  3. My (Ugochukwu Ukwuegbu’s) YouTube channel.

2 replies on “How to deploy a pre-built website from a code source into an EC2 web server on AWS”

Comments are closed.