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)

link|improve this question
feedback

1 Answer

up vote 1 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
</VirtualHost>
link|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
feedback

Your Answer

 
or
required, but never shown

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