You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Brian Burke <BB...@nc.rr.com> on 2001/05/08 02:35:45 UTC

Re: Sections in Apache Config

I'm running into a similiar issue, and I from what I've read,
mod_vhost_alias looks like it could help:
http://httpd.apache.org/docs/mod/mod_vhost_alias.html

Any comments on this mod?

Brian B.

----- Original Message ----- 
From: Jonathan Hilgeman <JH...@ecx.com>
To: <mo...@apache.org>
Sent: Monday, May 07, 2001 8:35 PM
Subject: <Perl> Sections in Apache Config


> Hi,
> I've been trying to do this for some time but can't figure out how.
> Basically I want a setup where anyone at www.UserName.domain.com or
> UserName.domain.com will have their DocumentRoot set to
> /www/httpd/html/UserName. So far I've tried this:
> 
> <VirtualHost 111.111.111.111>
> UseCanonicalName Off
> <Perl>
> 
> if($HTTP_HOST =~ s/(?:www\.)?(.*)\.domain\.com//g)
> {
> $VirtualDocumentRoot = "/www/httpd/html/$1";
> }
> else
> {
> $VirtualDocumentRoot = '/www/httpd/html/%-3';
> }
> 
> 1;
> 
> </Perl>
> 
> </VirtualHost>
> 
> The second $VirtualDocumentRoot line works fine, but I NEED to be able to
> get the first line to work instead, using <Perl> if possible.
> 
> Any guesses?
> 
> Jonathan