-1

I have added domain name in route 53 and creating a sub domain to land into virtualhost with a port. I am trying to add a sub domain as cname and cname is my servername in virtualhost. I am on ubuntu apache. Any help will highly be appreciated.

  • What records have you set up in Route53? What's the problem? – ceejayoz Feb 18 '14 at 17:59
  • I have setup domain name with NS and its pointing to EC2 instance of ubuntu server. I have virtualhost on the same server with port 82. Now I want to add a sub domain in route 53 and want to redirect to vitualhost with port. I have added a subdomain with cname and cname is my server name in apache vh setting. I am not sure if I am the right track? – Krishna Bhatt Feb 18 '14 at 18:09
  • You can't use DNS to redirect to a port. That's not how DNS works. Why do you think you need to run the subdomain on a different port? – ceejayoz Feb 18 '14 at 19:04
  • Ok got it. But how can i redirect a sub domain to a vh host in apache. What are the steps?? – Krishna Bhatt Feb 18 '14 at 19:16
  • You put a DNS record in place to point at the server. If Apache is properly configured it'll work fine. – ceejayoz Feb 18 '14 at 19:59

1 Answers1

1

ensure NameVirtualHost is on and then you can do something such as

<VirtualHost *:80>
        DocumentRoot /var/www/subdomain.site1
        ServerName subdomain.site1.com

That will appropriately send your subdomain to the proper location. Obviously you have to finish filling out the VirtualHost section and close it properly.

Kevin
  • 633
  • 3
  • 7