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 have looked at setting up an Apache server.

I want to run our site on the server, as well as testing

This I can setup by having two almost identical VirtualHost in the configure file in sites-available.

What I then want is a development subdomain, but these need to be unique per developer, e.g. Is there a smart way to set this up?

I have setup the production to take data from /var/www/live/, the test to take data from /var/www/test/ and would like the development to take data from e.g. /var/www/dev/mol/, where mol is the first part of the URL. (the sub-subdomain for test)

share|improve this question
up vote 4 down vote accepted

VirtualDocumentRoot should do the trick.

Something like this:

<VirtualHost *:80>
    ServerAlias *
    VirtualDocumentRoot /var/www/dev/%1
share|improve this answer
Thanks! Is there a way to avoid the Where does this even send people? – Mads Ohm Larsen Jul 19 '11 at 17:20
It's placeholder garbage - you can put ServerName in there for the same effect. – Shane Madden Jul 19 '11 at 18:21
But setting it to gives me an error when going to Setting it to seems a bit better :) – Mads Ohm Larsen Jul 19 '11 at 18:43

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.