Skip to main content

Setup AWS Cloudfront




Amazon CloudFront  is used to improve the performance of your website. CloudFront makes your website's files (such as HTML, images, and video) available from data centers around the world (called edge locations). When a visitor requests a file from your website, the request is automatically redirected to a copy of the file at the nearest edge location, which results in faster download times than if the visitor had requested the content from a data center farther away.

This Guide shows you how to setup cloudfront to help you website performance .

Cloudfront distribution  - We need to create cloudfront distribution first to make our website available from data centers around the world.

Today we will create cloudfront for our website which is hosted in an ec2 instance behind aws elb. 

  Origin Setting  

              Origin Domain Name - click on box and select your elb 
              Origin Path - leave this blank
              Origin ID - It will automatically assigned.
              Origin SSL Protocols -  Select as per your need ( preferred select all).
              Origin Protocol Policy - Select in which mode you want to serve you visitors or select match viewer.

HTTP Port -  80
HTTPS Port -  443 
Origin Custom Headers - leave this blank.

 Default Cache Behavior Settings -


Viewer Protocol Policy - Select as per your requirement.

Allowed HTTP Methods - as per your requirement.

Cached HTTP Methods -  as per your requirement.

Forward Headers -  as per your requirement.

Object Caching - if you are not sending cache behavior with your header or your web server then select Customize.
 now put ttl value as per your caching requirement eg. for how much time you want to cache your object.

all other option leave default .

Distribution Settings



Price Class - Use as from where website visitor access you website if you have a worldwide visitor base you need to use all edge locations.

Alternate Domain Names - put your domain name from which you want to access your website eg. www.adityabaghel.com.

SSL Certificate - if you want to access your website with https so you need to upload ssl certificate in IAM for cloudfront  ( Optional)


Default Root Object - Set to index.php or index.html . This page is the default page that the CloudFront distribution returns if the URL used to access the distribution doesn't contain a file name

Logging -  if you want log of cloudfront then use this or leave this off.

Distribution State - Enabled 

Click Create Distribution.

It can take up to 15 minutes to deploy the distribution. To view the current status of the distribution, find it in the console and check the Status column. A status of InProgress indicates that the distribution is not yet fully deployed.

When your distribution is deployed, you are ready to reference your content with your new CloudFront domain name. Make a note of the value of Domain Name in the CloudFront console. You'll need this value in the next step. In this example, the value is 
dj4p1rv6mvubz.cloudfront.net.  


Now that you have successfully created a CloudFront distribution, the next step is to update the CNAME record to point your domain www.adityabaghel.com( then value we use in cloudfront while creating )  to - dj4p1rv6mvubz.cloudfront.net.


Cheers now you have working cloudfront distribution which help you to increase you website performance.

please connect me if you need more detailed help in setup your first at bagheladitya[at]yahoo[dot]com.

Comments

Popular posts from this blog

How to balance outgoing emails via multiple IP addresses with postfix

Postfix how to balance outgoing emails via multiple IP addresses The solution is depending on postfix`s TCP_TABLES and a perl script. In my example I`m using 7 different IP address to route outgoing mails, make sure you`ve already the IP addresses you are going to use have been configured on your box. First get a recent postfix rpm from here http://ftp.wl0.org/official/2.9/RPMS-rhel5-x86_64/. This one is built for rhel5/centos5 however should be working without much hassle on rhel6/centos5. Install the package: # rpm -Uvh postfix-2.9.1-1.rhel5.x86_64.rpm Make sure its built with tcp tables support: # postconf -m btree cidr environ fail hash internal ldap memcache nis proxy regexp static tcp texthash unix Install the perl module  List::util::WeightedRoundRobin: cpan install /List::util::WeightedRoundRobin/ Create the following perl script and make it executable: vi /etc/postfix/postfix.pl #!/usr/bin/perl -w # author: ...

How To Block Removable drive in linux

For Block Removable disk like pen drive you have to run only one following command - Open terminal -      #sudo chmod 700 /media For unblock -     # sudo chmod 755 /media   

how to take mails backup in outlook 2007

How to take backup of mails in outlook 2007. there is a very simple way to taking backup of mails 1.Opne outlook 2007 > tools >account > data files >open folder then close all other windows and copy outlook.pst file in a safe location To restore backup 1.Opne outlook 2007 > tools >account > data files > add > and give the location of outlook.pst file.