→ You should know how to launch instance on AWS and attach EBS volume to the instance.
→ You can refer link given below for above requisite.
→ Firstly, we will install Apache httpd webserver on our Instance launched on AWS.
yum install httpd
→ Mount The Partition at Root directory of Httpd (/var/www/html)
mount /dev/xvdf1 /var/www/html
→ We can check mount point by following command and spot our partition.
→ Now we will create S3 bucket.
aws s3 mb s3://<name of bucket> — region <name of region>
→ We can check bucket from AWS Console.
→After creation of bucket we will upload static data to it and set permissions to public.
aws s3 cp <location of object>/<name of object> s3://arpitbisane/helloworld.png — acl public-read
→Since our image is uploaded to bucket, now we create CloudFront Distribution for S3 bucket.
aws cloudfront create-distribution — origin-domain-name awsexamplebucket.s3.amazonaws.com — default-root-object index.html
Our Cloudfront Distribution for S3 bucket is created, We will recieve all the information about distribution.
→ Now configure Httpd web-server and start it.
Create a html file under /var/www/html/ folder.
→Now start the Httpd
→ Now check from the web portal.
https://<ip of your instance>/<name of file>
Our webserver is successfully launched, this static image is stored Cloudfront .
Thanks for reading this!!
for any queries regarding this article ping me on Linkedin.