Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have looked at setting up an Apache server.

I want to run our site example.com on the server, as well as testing test.example.com.

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. mol.test.example.com. 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

1 Answer 1

up vote 3 down vote accepted

VirtualDocumentRoot should do the trick.

Something like this:

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