Mobile app version of vmapp.org
Login or Join
Turnbaugh106

: Amazon EC2: How do I create a subdomain on an instance? I have apache2 and tomcat installed on Amazon ec2 instance running Ubuntu. tomcat is serving the application and I want to create subdomains

@Turnbaugh106

Posted in: #AmazonEc2 #Apache #Subdomain #Ubuntu

I have apache2 and tomcat installed on Amazon ec2 instance running Ubuntu.

tomcat is serving the application and I want to create subdomains for example.com and abc.example.com to serve to different webapps.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh106

2 Comments

Sorted by latest first Latest Oldest Best

 

@Annie201

This tutorial explains how to setup a virtual host in ubuntu on apache2, it's really quite easy. help.ubuntu.com/10.04/serverguide/httpd.html
Though you do not need a CNAME, what you should be adding is an A record. Basically in your DNS management create an A record with the subdomain name and the server IP. Give it a few minutes and your subdomain will begin to resolve.

Route53 is dirt cheap for DNS management and very easy to use.

10% popularity Vote Up Vote Down


 

@Hamm4606531

Firstly, you need to add the subdomains to DNS.

In this instance you could either create a wildcard entry for all subdomains or you could create individual entires. The type of entry should be a CNAME (alias) pointing to the EC2 instance public hostname.

Then you need to add the host to your apache configuration as a VirtualHost and also to your tomcat configuration in the server.xml resource

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme