Getting DocRoot of currently requested VirtualHost

Jordan Michaels <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hey Folks,

I'm pretty new to mod_perl but not new to programming in general. I'm 
working on a mod_perl Apache module and I'm trying to find the way to 
get the Document Root of the Currently requested VirtualHost.

I can get the currently requested domain name easily enough with:

my $servername          = $r->get_server_name();

But getting the document root for that domain is proving to be a 
challenge with VirtualHosts.

running this code:

my $document_root       = $r->document_root();

Returns the first VirtualHost's document root, and not the document root 
of the domain that's being requested.

I'm pretty sure I'm just missing something noobish here, but any 
pointers on how to go about getting the document root of the current 
requested VirtualHost would be *deeply* appreciated.

Thank you in advance!

-- 
Warm regards,
Jordan Michaels
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.