Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 "http://www.example.com"

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 http://www.example.com in /etc/hosts file point it to 127.0.0.1 to open locally on instance.

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

  • I have changed http://www.example.com 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
2  
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 www.example.com in /etc/hosts to 127.0.0.1, you should setup the www.example.com 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 www.example.com 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
add comment

migrated from stackoverflow.com Sep 24 '12 at 21:35

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

2 Answers

You can configure the Domain('www.example.com') 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
add comment

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 (0.0.0.0/0)

  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 http://www.isup.me/ .

share|improve this answer
add comment

Your Answer

 
discard

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