Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently bought an amazon ec2 instance. Now I want to host a website. I have googled and found some useful info but there is some confusion in my mind.

Suppose domain name is ""

That's what I have done so far.

  • I have configured my domain locally on amazon ec2 instance and it's working fine when I open that url in amazon ec2 instance's browser. I have used in /etc/hosts file point it to to open locally on instance.

  • I have got one elastic ip address and associated it with the instance.

  • I have changed A's record with the elastic IP that I have got in above step.

Now what should I do?

When some user will open my website anywhere in the world, will it get pointed to my instanace's ip address?

Have I done proper configurations for website on instance?

share|improve this question

migrated from Sep 24 '12 at 21:35

This question came from our site for professional and enthusiast programmers.

Well... what happens when you open your domain name in your browser locally from our home machine? From your description everything sounds fine so far... – j0nes Sep 23 '12 at 9:41
Better than hostmapping in /etc/hosts to, you should setup the as a CNAME of the HOSTNAME of the Elastic IP (your Public hostname after assigning the EIP). This has the benefit of resolving differently based on where you're looking it up. External requests for will return the external IP (the Elastic IP) and internal AWS lookups will return your INTERNAL (10.x.x.x) IP. This allows you to use the same hostname but still use the internal address without any /etc/hosts mucking. – Jason Floyd Sep 25 '12 at 6:12

It seems alright. Here is the steps one follow:

  1. Start your server.

  2. Make sure you have port/s (80, 443 commonly), you are serving the website from, is allowed in your Security Group to the world (

  3. Use the public DNS/ public IP for that instance (obtained via Web Console or API call). Check if website looks all fine in all supported browsers.

  4. Either use the public DNS to assign CNAME or use public-IP to assign an A-name to all the sub-domain/domain/s to point to this instance.

  5. Check from your browser if all those assignments work. (It may take as long as 24 hours to propagate the change over the internet)

  6. Finally, get satisfied if everyone can access your website by checking using a tool like .

share|improve this answer

You can configure the Domain('') to an ELB (Elastic Load Balancer) So that in the future if there is an increase in Load more number of EC2 instances can be added to the ELB

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.