views:

12

answers:

1

Hi,

I have few sites, and they all have identical setup on a single server. Now, instead of the separate configuration file for each of them in sites-enabled directory, I want to have a common file.

Idea is this:

www.abc.com should have /var/www/abc as DocumentRoot, www.xyz.com should have /var/www/xyz as DocumentRoot, etc.

All other parameteres like log files, contact emails etc should also have identical setup (abc.com should have [email protected] as admin email, xyz.com should have [email protected] as admin email etc).

I couldnt find any tutorial on how to backreference wildcards, etc.

regards,

JP

A: 

Aha. Found the solution. VirtualDocumentRoot is the answer.

A single line like:

VirtualDocumentRoot /var/www/%0

does the job. Havent really figured the logs stuff but should be similar and easy.

See http://efreedom.com/Question/2-182929/Wildcard-Subdomain-Directory-Names
for a nice related thread.

You gotta enable vhost_alias module for this. (sudo a2enmod vhost_alias on ubuntu).

JP19