Okay, in that case, would there be a way for Perl/Apache to read in info
from a mySQL database and dynamically update itself? Something like:

<Perl>
        connect_to_db(info);
        $resultrows = db_query("SELECT .... FROM .... WHERE .... ");
        foreach($resultrows as $UserName)
        {
                $VirtualHost = .....
        }
</Perl>

Can someone give me a good example of how to do that?
Thanks!

Jonathan

-----Original Message-----
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 5:36 PM
To: '[EMAIL PROTECTED]'
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

Reply via email to