AWS-EC2, how to set multiple public sites with just one instance?

tech_me asked:

I have read many articles and also topics in SF, but could not find out any clue to my case.

I have on instance of AWS-EC2, and want to hold several public sites within it.

I have already get my first public site to run like below:
http://ec2-50-xxx-214-xxx.us-west-2.compute.amazonaws.com/

What I have done is just added a file which named manmu under
/etc/apache2/sites-available

<VirtualHost *:80>
    ServerName ec2-50-xxx-214-xxx.us-west-2.compute.amazonaws.com
    DocumentRoot /home/ubuntu/manmu/YYYYY/web
    DirectoryIndex index.php
</VirtualHost>

and then
ubuntu@ip-10-245-38-136:/etc/apache2/sites-enabled$ ln -s ../sites-available/manmu

But how could I get my other sites to run?
For example, I may want some subdomains such as:
http://abc.ec2-50-xxx-214-xxx.us-west-2.compute.amazonaws.com/
and so on.

Thank you.
Best regards,
tech_me

My answer:


You can’t create subdomains of the EC2-provided hostname. You must use name-based virtual hosting with your own domain name.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.