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:
http://www.abc.com should have /var/www/abc as DocumentRoot,
http://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 contact@abc.com as admin email, xyz.com should have contact@xyz.com as admin email etc).
I couldnt find any tutorial on how to backreference wildcards, etc.
regards,
JP
Aha. Found the solution. VirtualDocumentRoot is the answer.
A single line like:
does the job. Havent really figured the logs stuff but should be similar and easy.
See https://serverfault.com/questions/182929/wildcard-subdomain-directory-names for a nice related thread.
You gotta enable vhost_alias module for this. (
sudo a2enmod vhost_aliason ubuntu).