سؤال

I wanted just to double check this since my friend asked me to be double check this. We have a domain and the customer support is kinda hard to work with, so it would be easier if we could do this on "Amazon side".

We have a EC2 instance, and want to have another separate one on a different domain, subdomain.example.com. That subdomain would be handled by the separate instance.

We are currently using elastic IP for one instance, Route 53 to route requests from Amazon DNS to the specific instance, and on the name register we have set up the route 53 name servers.

Is there a way to do this via AWS/Route 53 or some other tool, or the subdomains have to be explicitly handled on the name register?

Thanks!

هل كانت مفيدة؟

المحلول

DNS handles mapping for subdomains. If you ware using Route 53, you would set it up there.

نصائح أخرى

I would say that you don't need EIP. Just register EC2 instance public DNS (ec2-54-00-000-169.compute-1.amazonaws.com) as CNAME record in your Route53 zone. Using CNAME is better than IP address. In that case your name will be resolved to private IP address if you are resolving it from inside AWS network or to public IP address if from outside AWS network.

You can even try Arecord a free service to avoid zone apex issue

If I understand the problem I think that you don't have to use the route 53 service. You can just point both of the domains to your elastic IP and create a virtual server.

You can create a new virtual server using the httpd.conf found at /etc/httpd/conf .

Just add to the end of the file something like that:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /var/www/html/SomeDomain
    ServerName somedomain.com
    ServerAlias www.somedomain.com
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /var/www/html/SomeDomain2
    ServerName somedomain2.com
    ServerAlias www.somedomain2.com
</VirtualHost>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top