[Webinar] Streamline your web hosting managementRegister Today


How can we host a website on Amazon EC2

Posted on 2010-04-06
Medium Priority
Last Modified: 2013-12-20

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 GoDaddy.com 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?
Question by:world8
  • 3
  • 3

Expert Comment

ID: 29902188
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.
LVL 33

Expert Comment

ID: 29948111
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.


Author Comment

ID: 30090292
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.


Expert Comment

ID: 30090612
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. Something.com then youneed dns.

Author Comment

ID: 30092786
Yes rob, I've a named website. Now can you please help me on how to link these??

Accepted Solution

robthewolf earned 2000 total points
ID: 30098950
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

Author Closing Comment

ID: 31711284
Great answer !!

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6. Keep in mind that subnetting requires lots of practice and time.
Myths can prevent you from using the most productive alternatives available for you and opposing cloud accounting because of some myths falls into the same category of missing out on opportunities. Let's expose the myths and enable your business to …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question