You don't need to walk the config tree to accomplish that. There is a much simpler way:
sub post_config { my($conf_pool, $log_pool, $temp_pool, $s) = @_;
for (my $vhost_s = $s->next; $vhost_s; $vhost_s = $vhost_s->next) { my $port = $vhost_s->port; my $val = $vhost_s->dir_config->{PostConfig}; warn "port: $port, val $val\n"; } ...
That is indeed much simpler. Is the fact that you can get from the root server to vhost to vhost documented anywhere? I couldn't find it in the docs.
But unfortunately I don't think it will work in the general case for Apache::PageKit, because it needs to support different values in different locations, i.e. for this configuration:
PerlSetVar PKIT_SERVER xyz <VirtualHost one> <Location /a> PerlSetVar PKIT_ROOT /pk/a </Location> <Location /b> PerlSetVar PKIT_ROOT /pk/b </Location> </VirtualHost> <VirtualHost two> PerlSetVar PKIT_ROOT /pk/c PerlSetVar PKIT_SERVER pqr </VirtualHost>
I should make three calls:
Apache::PageKit->startup("/pk/a", "xyz");
Apache::PageKit->startup("/pk/b", "xyz");
Apache::PageKit->startup("/pk/c", "pqr");
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html