Quantcast
Viewing all articles
Browse latest Browse all 10

How to use route 53 to create subdomains that reference specific URLs of an EC2 instance

Image may be NSFW.
Clik here to view.
Question

I have an EC2 instance running Redmine and myPHPadmin at https://myElasticIP/redmine and https://myElasticIP/phpmyadmin.

I have a domain name registered with namecheap: myDomain.us

Using Route 53, I have customized the DNS of myDomain.us (through the namecheap interface) to use the delegate NS’s in Route 53, so going to myDomain.us will automatically reference myelasticIP instead.

How do I get it so that going to redmine.myDomain.us references https://myElasticIP/redmine and myphpadmin.myDomain.us references https://myElasticIP/myphpadmin? (without using URL Frames or URL redirect…I want x.myDomain.us to remain in the address bar)

Image may be NSFW.
Clik here to view.
Answer

You can’t do that with DNS alone – you’ll need to get some HTTP involved somewhere.

I’d just create two vhosts, one for redmine.myDomain.us and one for myphpadmin.myDomain.us, and just point their DocumentRoot to the correct location on your filesystem.

For instance, if this is your vhost for myDomain.us:

<VirtualHost *:80>
    ServerName myDomain.us
    DocumentRoot /var/www
</VirtualHost>

Then you’d create the following additional vhosts:

<VirtualHost *:80>
    ServerName redmine.myDomain.us
    DocumentRoot /var/www/redmine
</VirtualHost>

and

<VirtualHost *:80>
    ServerName myphpadmin.myDomain.us
    DocumentRoot /var/www/myphpadmin
</VirtualHost>

Additionally, you’ll need to create two new DNS names for the two new vhosts. DNS CNAME records should be created redmine.myDomain.us and myphpadmin.myDomain.us, both pointing to myDomain.us.

Answered by EEAA

Viewing all articles
Browse latest Browse all 10

Trending Articles