Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 a CentOS instance. Is it possible for multiple domains / subdomains to share that single instance and on my Apache server i will have separate folders for each domain. How do I start doing this and how would I map my subdomains to the instance.

share|improve this question
up vote 1 down vote accepted

You should read up on Name Based Virtual Hosting. Get an elastic IP address for your instance. Create a DNS entry that points each domain name to the elastic IP address. Create a virtual host for each domain.

share|improve this answer

Sure, EC2 is no different from any other server in that regard. You setup separate virtual hosts for each domain, and then modify the DNS entries for the domains to point to the public IP address of the EC2 instance. You'll probably want to get an Elastic IP so that your public IP address doesn't change every time your EC2 instance reboots, and an EBS volume to put all the content onto so you don't have to re-roll your base image every time your vhost's content changes.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.