1

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)

David Kaczynski
  • 101
  • 3
  • 11

1 Answers1

3

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.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • *DNS CNAME records should be created `redmine.myDomain.us` and `myphpadmin.myDomain.us`, both pointing to `myDomain.us`.* Just to verify, should they point to the elastic IP or the domain name? – David Kaczynski Nov 11 '12 at 03:07
  • They should point to the domain name. – EEAA Nov 11 '12 at 03:10
  • This is helping, but I still have an issue. I am using the rewrite mod to force port 80 connections to be rewritten to https, `RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/redmine [R]`. This is resulting in requests for `http://redmine.myDomain.us` to go to `https://redmine.myDomain.us/redmine`. Any suggestions? – David Kaczynski Nov 11 '12 at 03:21
  • Please post that as a separate question. – EEAA Nov 11 '12 at 03:28