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

I'm trying to get VirtualDocumentRoot to work in a fresh install of apache2 on Ubuntu Server.

I've got httpd.conf configured as such:

<VirtualHost *:80>
    ServerName thicket
    DocumentRoot /var/www
    UseCanonicalName Off
    VirtualDocumentRoot /var/www/%1/%2

When I restart apache, I can't access dev.test.thicket/index.html even though the associated file/directory exists (/var/www/dev/test/index.html).

When I comment out UseCanonicalName and VirtualDocumentRoot, I can access the server by using thicket/dev/test/index.html

Apache confuses and frightens me. What am I doing wrong here?

share|improve this question

Is your DNS resolving "dev.test.thicket" to either localhost ( or ::1) if you are issuing the request locally, or whatever the server's IP is if you are issuing the request remotely?

VirtualHosts make serving decisions based on the incoming "Host:" header of the HTTP request, but DNS is doing separate resolving before that HTTP request even gets sent.

If your system's hostname is "thicket", just that word might be resolving to via the /etc/hosts file, especially if you set that hostname as part of the operating system installation.

You could try to add "dev.test.thicket" to your hosts file just for testing purposes.

share|improve this answer
I can ping 'thicket' from a box on the same network, but 'dev.thicket' cannot be found. This is a DNS issue then? – Jim Greenleaf Nov 8 '10 at 23:55

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.