Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My client site is:

I have created a (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?

share|improve this question

migrated from Mar 29 '11 at 13:07

This question came from our site for professional and enthusiast programmers.

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

<VirtualHost *:80>
    DocumentRoot /var/www/html/myfiles
share|improve this answer
That does not answer @CrazyJoe's question. – Guy Mar 29 '11 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 on my domain. I'm thinking maybe some type of proxy but I wouldn't bet on it. – luckytaxi Mar 29 '11 at 12:50
No, I think this answers the question just fine. – Kieren Johnstone Mar 29 '11 at 12:52
Ok, but does not work!! The Problem: You don't have permission to access / on this server. The is hosted on another server , its possible? Thank's – CrazyJoe Mar 29 '11 at 13:00
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 '11 at 13:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.