Sitemap

How to create a web page in Linux ec2 by copying content from S3

2 min readMar 17, 2024

In this article, we will be going to discuss how to create the web page in the Linux ec2 instance by copying the files from the s3 bucket.

Steps:

  1. Upload the content of the HTML file in your bucket.
Press enter or click to view image in full size

2. create the role to get Amazon s3 full access using AWS IAM.

Press enter or click to view image in full size

3. create the Amazon Linux EC2 free tier instance. Give the necessary settings like VPC, subnet, security group, key-pair, etc. In advanced settings give the IAM role S3FullAccess.

Press enter or click to view image in full size

4. Then connect your ec2 instance through instance connect.

Press enter or click to view image in full size

5. Run the following commands in the “instance connect” window

sudo su
yum update -y
yum install httpd -y
service httpd start
cd /var/www/html
aws s3 cp s3://abiabi0707.com/server1.html /var/www/html

Press enter or click to view image in full size

6. copy your IPv4 address from the instance and paste it to the browser window.

Press enter or click to view image in full size
Press enter or click to view image in full size

Note: You can also use SSH clients like Putty and run the same commands in instance connect to run the HTML page

--

--

No responses yet