How can we host a website on Amazon EC2


Can we host a website on Amazon EC2??

I've registered a website, I'll take an instance in Amazon EC2 and then how do I link these two, generally if we go with they will provide the "name servers" which we uploaded the into registration site, and everything works fine.

How can we achieve the same using Amazon EC2 instance? And also, if we want to post more than one website on the same instance, how can we do the same?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

First you need to make sure you have a webserver installed on your instance.  Apache can be used on both windows and linux instances.  Then you want to install the files you have created when you built your website.  Along with anything else you might need like mysql (or some other database) and php etc.
Once you have done the set up I recommend bundling that as a private instance.  That way when you restart you wont lose everything.  I would not rely on using bundling to save user data.  For that you should create an EBS volume for your persistent dynamic data.
Run set up apache to run you website and then point the name servers at the external IP address of the EC2 server (the same one you use to remote connect to it)
Ok that should get you most of the way there, let me know if you any more questions.
In terms of running more than one website off the same server, that depends on how you want to do it.  But basically it should be possible especially as you can have more than one external ip address.  I can't help you much more with that I am afraid.
Shalom CarmelCTOCommented:
all modern web servers support virtual hosting, so a single web server instance can be used to host hundreds of web sites.
you have to give each one a distinct name and setup your DNS accordingly.

world8Author Commented:
when you say "distinct name" are you talking about the website url??

How do I setup the DNS or link the website and Instance ?? or would it possible to use the "ip address" to use as the name servers, if Yes - can I do the same for all the websites?
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

It depends what you are trying to do. If you have a webserver running a website at a certain address then you will be able to acess it at that address. If you want a named website eg. Www. then youneed dns.
world8Author Commented:
Yes rob, I've a named website. Now can you please help me on how to link these??
I am really not an expert on webhosting, I know about cloud computing and EC2. Also we are getting to grounds of a separate question.
Regardless.  Lets try to break down what you want to do here, starting with one website.
1) create the website code.
2) buy a domain name
3) get hosting.
4) put website on host
5) get domain name to point to host.

I presume 1 and 2 are done, or at least you can take care of that.
3 is solved by installing apache or some other webserver software on your instance (and what ever else you need, perl modules, php etc.)
4 should be straight forward once you have done 3.  If you havent set up a webserver before, read up on it on the internet, have a go and come back with specific questions.  
5 Where ever you bought your domain you should be able to point create an A record, which is basically a way of telling the name server where your host is.  It will then link from an ip address to a domain url.  

hey presto you are done.

to extend that to multiple websites you will need to set up apache so that it knows you have more than one domain url pointing to your server.  Then you set it up to point to the correct html files for each specific website.

Have a go.  When you get stuck ask a new question.

Word of warning.  If you install software to an EC2 image you will lose if when you shut down.  There are two ways to avoid this problem.  
1) once the software is installed create a new bundled image and make it private.  Next time instead of using the image provided by amazon you can use your own image and it will bring you back to the state it was in before you bundled it.  This is good for saving your initial set up.  All mainly static software.  It wont change very much so you want to keep it the same.
2) use and EBS volume.  This data is persistent and can be mounted to your imaged once it is started. This is good for your dynamic data.  If you are going to change the website files then you will want to store them on this volume too.

good luck

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
world8Author Commented:
Great answer !!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.