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

Abimuktheeswaran Chidambaram
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.

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

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.

4. Then connect your ec2 instance through instance connect.

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

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

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

--

--