To get a list of virtual servers -

> > > for (my $s = Apache->server; $s; $s = $s->next()) {
> > >         print "Virtual host: ", $s->server_hostname, "\n";
> > > }

> > Is there any reasonable way to use the list of servers (successive
> > values of $s above) to determine what mod_perl PerlSetVar directives
> > have been issued for each virtual host?
> >
> > E.g., is there some clever way to use Apache::ModuleConfig->get ()
> > to do this?
> 
> $s->dir_config() should work.

You've actually hit upon my original reason for writing.  For whatever
reason, the following code doesn't work for me.  The dir_config routine
doesn't find what it's looking for (although it should - or at least so
I thought):

sub handler () {

  my $r = shift;
  my $vserver;

  $r->status (OK);
  $r->content_type ('text/plain');
  $r->send_http_header ();

  for ($vserver = Apache->server; $vserver; $vserver = $vserver->next) {
    $r->print ('server: ', $vserver->server_hostname(), "\n");
    $r->print ('port: ',   $vserver->port(), "\n");
    $r->print ('variable value: ', $vserver->dir_config
('SomePerlVariable'), "\n");
  }

etc.

-- 
Richard Goerwitz                                [EMAIL PROTECTED]

Reply via email to