perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: Getting domain info on each hit.
Date Mon, 16 Nov 2009 19:04:05 GMT
On 09-11-16 13:54 , Devrim Yasar wrote:
> Hi,
> 
> We want to retrieve URL and use it inside our vhosts, realtime.
> 
> To demonstrate my case, I placed random numbers on ServerAdmin directive
> (just to test),
> 
> <Perl>
> $ServerAdmin = int(rand(100))."loko\@koko.com";
> </Perl>
> 
> 
> 
> 
> As you may know, this random number is assigned only when you restart
> the server, and never changes until another restart.
> 
> This is what we want: 
> 
> if julie.myperl.com <http://julie.myperl.com/> is the requested domain,
> then $ServerAdmin = julie@myperl.com <mailto:julie@myperl.com>, that is,
> realtime.
> 
> Hopefully there is a solution, since this will help us remove thousands
> of config files, and save us from thousands of apache reloads.

Something like this is probably what you are looking like

$r->server->server_hostname;
$r->server->server_admin('julie@myperl.com');

Read from here:

<http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.html#C_server_admin_>

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Mime
View raw message