Web server configuration and creating cloudfront using AWS CLI

🔶 Webserver configured on EC2 Instance

Starting aws instance:

AWS instance in stopped state
Starting AWS instance using CLI

Installing and starting httpd service on AWS instance:

command to installing httpd service
command to start httpd service

🔶 Document Root(/var/www/html) made persistent by mounting on EBS Block Device.

lanching new EBS volume:

EBS volume is created using cli

Attaching EBS volume to instance:

command to attach ebs volume
volume attached to instance

Creating new partition:

new partition of ebs storage is created and saved

Formatting the partition:

partition is formated

Mounting this partition with /var/www/html floder:

command to mount the folder

🔶 Static objects used in code such as pictures stored in S3

Creating a new bucket:

No bucket available
new bucket is created

Copying static image to s3 bucket:

image is copy from local machine to s3 storage with public read option
discription of copied image
opening image using url given by s3 bucket

🔶 Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.

Creating new cloudfront:

no cloudfront distribution
Cloudfront is created with s3 bucket as domain name
Cloud front is created as seen in webUI

🔶 Finally place the Cloud Front URL on the webapp code for security and low latency.

Cloudfront URL

cloud front URL
Opening image using url given by cloudfront

🔶Thank You🔶