Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Getting domain info on each hit.

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


devrim at kodingen

Nov 16, 2009, 10:54 AM

Post #1 of 2 (152 views)
Permalink
Getting domain info on each hit.

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 is the requested domain, then $ServerAdmin = julie [at] myperl
, 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.

Thanks,
Devrim

here is kind of similar situation and solution,

> http://httpd.apache.org/docs/1.3/mod/mod_vhost_alias.html


and here is why ask this question,
we have built an API in which subdomains signify unix account names,
so variable part of {$user}.kodingen.com must be used within vhost conf.
http://serverfault.com/questions/84582/using-variables-within-apache-virtualhost-containers
Attachments: PastedGraphic-1.png (15.8 KB)


gozer at ectoplasm

Nov 16, 2009, 11:04 AM

Post #2 of 2 (144 views)
Permalink
Re: Getting domain info on each hit. [In reply to]

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 [at] myperl <mailto:julie [at] myperl>, 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 [at] myperl');

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/
Attachments: signature.asc (0.24 KB)

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.