You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nick Cooper <ni...@jdi-solutions.co.uk> on 2009/03/31 17:23:09 UTC

[users@httpd] Replace multiple VirtualHosts

I have got a very large httpd.conf file and am looking for ways to clean it
up.

The main problem is the large number of vHosts, most of these follow the
same pattern and it's only the subdomain which affects the documentRoot in
use.

I have managed to reduce it to the following:

<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot c:/wwwroot/clients/%1/
ServerName *.server
ServerAlias *. server
ErrorLog c:/logs/errors.log
</VirtualHost>

The issue is the DocumentRoot is not set as it previously was when using
multiple vHosts, I understand this is because I'm using
the VirtualDocumentRoot instead.

Is there anyway to get round this problem and have DocumentRoot set to the
same value as VirtualDocumentRoot ?

The documentation mentions "The other thing to `fake' is the document root
(configured with DocumentRoot and available to CGIs via the
DOCUMENT_ROOTenvironment variable)" but it's not very clear on how to
do this.

Thank you for reading.

Nick