0

My client site is: xyz.com.br

I have created a demo.xyz.com.br (DNS Record A) pointing to the ip address of my server.

The request is reaching my server.

The problem:

How do I setup Virtual Host on appache to hit the root directory of the 2nd level domain, if the domain is not hosted on my server?

1 Answer 1

3

Same way you would a regular domain. Servername demo.xyz.com.br and set the documentroot to the path of the web files. As long as DNS is correct, you'll be fine.

<VirtualHost *:80>
    ServerName demo.xyz.com.br
    DocumentRoot /var/www/html/myfiles
</VirtualHost>
5
  • That does not answer @CrazyJoe's question.
    – Guy
    Mar 29, 2011 at 12:46
  • Maybe I misunderstood, he wants what now? He wants the subdomain to hit the files on the domain itself without hosting the file? There's no way, that's like me saying let's host facebook.com on my domain. I'm thinking maybe some type of proxy but I wouldn't bet on it.
    – sdot257
    Mar 29, 2011 at 12:50
  • 1
    No, I think this answers the question just fine.
    – Kieren Johnstone
    Mar 29, 2011 at 12:52
  • Ok, but does not work!! The Problem: You don't have permission to access / on this server. The xyz.com.br is hosted on another server , its possible? Thank's
    – CrazyJoe
    Mar 29, 2011 at 13:00
  • 2
    Forget about the TLD. If DNS points to your server for a subdomain, requests coming in will be for that ServerName. The problem you are experiencing is nothing to do with the fact the root domain is on another server - it's a permissions issue. (You should create a new question if you're unable to solve it)
    – Kieren Johnstone
    Mar 29, 2011 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .