Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home Internet Create Amazon CloudFront With Your Own Domain And Own Files Server

Create Amazon CloudFront With Your Own Domain And Own Files Server

As you may already see that all static files (CSS, JavaScript and image files) in my blogs are delivering from CDN via 3 sub domains: cdn, cdn1 and cdn2 and all those files are still hosted on my own dedicated server. Meaning you can either access a particular file from my main domain or from a certain CDN domain (cdn, cdn1 or cdn2).

For example, 2 image link below will load the same content, one from the Amazon CDN and one from my own server:

+ http://cdn.4rapiddev.com/wp-content/uploads/2011/12/WP-Super-Cache-CDN-Settings.jpg
+ http://4rapiddev.com/wp-content/uploads/2011/12/WP-Super-Cache-CDN-Settings.jpg

This post will let you know steps by steps how I set it up.

First, you need to Sign up for Amazon CloudFront service via: http://aws.amazon.com/cloudfront/. Once you have verified your account and activated your CloudFront service, please follow steps below:

CloudFront Loads Original Files From Custom Sub Domain

Meaning you intend to use your own server to host original files and these files will be accessed through CDN via your own domain or sub domain.

  • 1. Login to the AWS Management Console then click on Amazon CloudFront tab.
    AWS Management Console Amazon CloudFront

    AWS Management Console Amazon CloudFront

  • 2. Create a new Distribution by clicking on Create Distribution button. In the Create Distribution Wizard, select Custom Origin option then type your domain which will associate with the distribution in Origin DNS Name text box. Ex: 4rapiddev.com. After that, click Continue button to go to the next step.
    Note: this is the first requirement of this tutorial: storing files on your own server.

    Amazon CloudFront Origin DNS Name

    Amazon CloudFront Origin DNS Name

  • 3. This is the second requirement, creating your own domains/sub domains that link to the distribution instead of using the CloudFront domain name. Simply enter desired domains in CNAMEs text box, ex: cdn.4rapiddev.com or cdn1.4rapiddev.com.
    Note: you can enter up to 10 domains, separated by commas or new lines.
    After everything is okay, click Continue button to review your new distribution settings.

    Amazon CloudFront Create Custom Domains

    Amazon CloudFront Create Custom Domains

  • 4. If you’re fine with current settings for the new Distribution, click Create Distribution button to finish this step or click Back to change something.
    Amazon CloudFront Review Distribution

    Amazon CloudFront Review Distribution

  • 5. After clicking Create Distribution button, your distribution is created and appears in the list. However, it may take few minutes to propagate across the CloudFront system.
    Amazon CloudFront Distribution List

    Amazon CloudFront Distribution List

  • 6. Creating CNAMEs (Alias) in your DNS control panel: cdn, cdn1 and cdn2 that point to Domain Name of your new distribution. In this case, the domain name is d1415bowm1j0qn.cloudfront.net and assume that we’re trying to create CNAME in Godaddy DNS Manager. These CNAMEs also need few minutes to be propagated across DNS servers.
    Create CNAME in Godaddy DNS Manager

    Create CNAME in Godaddy DNS Manager

That’s all. Now you can access static files either from your own domain URL or from CNAMEs you just create or even from CloudFront domain name as long as they have the same structure and your distribution is Deployed.

For example:

+ http://4rapiddev.com/wp-content/uploads/2011/12/AWS-Management-Console-Amazon-CloudFront.jpg
+ http://d1415bowm1j0qn.cloudfront.net/wp-content/uploads/2011/12/AWS-Management-Console-Amazon-CloudFront.jpg
+ http://cdn.4rapiddev.com/wp-content/uploads/2011/12/AWS-Management-Console-Amazon-CloudFront.jpg
+ http://cdn1.4rapiddev.com/wp-content/uploads/2011/12/AWS-Management-Console-Amazon-CloudFront.jpg
+ http://cdn2.4rapiddev.com/wp-content/uploads/2011/12/AWS-Management-Console-Amazon-CloudFront.jpg

Dec 22, 2011Hoan Huynh
WordPress Cache Plugins Support CDNResolve Could not load file or assembly Microsoft.VisualStudio.Web.Runtime
You Might Also Like:
  • Rackspace VS Amazon EC2
  • Top CDN Services You Should Use
  • Create CrmService with Domain, Username And Password
  • How To Compare The Differences Between 2 Files (Text File)
  • Free Software To Monitor and Log Directories Files Changed On Windows 2000 XP 2003 Vista 7 Server 2008
  • Godaddy Cancel Domain, Hosting, VPS, Dedicated Server Or Virtual Data Center
  • Create Account With Microsoft Dynamics CRM Web Services By C#
  • Free Web Admin For Microsoft SQL Server And Oracle – 1ClickDBPro
  • Create Youtube Playlist
  • Example Of crossdomain.xml – Cross Domain Policy File
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

9 years ago InternetAmazon, CDN, CloudFront, CNAME, DNS, Goddady707
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
21,956 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
19,805 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
15,629 views
JQuery Allow only numeric characters or only alphabet characters in textbox
13,136 views
C# Read Json From URL And Parse/Deserialize Json
9,595 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Essay Writers
  • College Essay Writers – The Way to Earn Your Essay in Demand
  • Buy Research Papers – How to See Them at a Bargain Price
  • How to Write a Research Paper For Sale
  • Essay Writing – Some Useful Suggestions for Writing Urgent Essays
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (28)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (69)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development