In this lab, you will host your first website on an EC2 instance. You will be using all the notions from previous labs to complete this lab successfully.
Prerequisite: Having a valid AWS Account (Follow the step in this link to create an AWS Account) How to Sign Up for a new Amazon Web Services Account
Open the page: https://aws.amazon.com/account/
Create a security group to allow only port 80 and 22 to your EC2 instance
Type VPC in the search box

Select Security groups under Security menu

Click on Create Security Group

Enter the Security group name
Add the rule for SSH and HTTP in the inbound rules / Click Create security group
SSH allowed only from my IP address and HTTP from anywhere

Launch our EC2 instance
Type EC2 in the search box

Click on Launch instance

Enter your instance name / Select Amazon Machine Image / Instance type / Key pair / Security group and storage / review and click on Launch instance

Confirm that the instance is up and running
Note the public IPv4 address, you will need it for the next task

Connect to your EC2 instance with SSH client PuTTY
ec2-user@X.X.X.X(your IP v4 address)
Enter the IP and Key pair in PuTTY client / Click Open

Click on Yes to add the key to PuTTY’s cache and trust the host

Confirm you are connected to the EC2 instance with SSH

Install all the software needed by our website
Run the commands bellow
sudo su
yum update -y
yum install -y httpd
cd /var/www/html
wget https://github.com/marcelin-ndjila/webtemplate/archive/refs/heads/main.zip
unzip main.zip
cp -r webtemplate-main/* /var/www/html
rm -rf webtemplate-main main.zip
systemctl enable httpd
systemctl start httpd
Confirm your have access to the new website by entering the public IP address of your EC2 instance in a browser

Clean up your lab and terminate your EC2 instance
Type and select EC2 in the search bar

Select Instances in the menu

Select the instance and click on terminate instance

Click on Terminate

Confirm the instance is terminated

Credit: Azeez
symposium
I am genuineⅼy thankful to the holder of this web sitе who has shareⅾ this great piece of writing at аt
this time.