jacques has asked for the wisdom of the Perl Monks concerning the following question:

Cross-platformly, I want to get Apache information, such as server root, loaded modules, api version, server administrator, etc. What would be the best way to do this? If modperl is installed, how can I use it to get the info? Thanks.

Replies are listed 'Best First'.
Re: Getting Apache info
by johnnywang (Priest) on Feb 07, 2005 at 22:48 UTC
    This is part of the apache API, you can take a look at all the API's at mod_perl It's something like:
    sub handler{ my $r = shift; my $s = $r->server; # $s->server_admin # $s->server_hostname # $s->port # etc. # connection my $c = $r->connection; # $c->remote_host # $c->remote_ip }
      that's great. Thanks.
Re: Getting Apache info
by Errto (Vicar) on Feb 07, 2005 at 23:38 UTC
    Well, you need mod_perl if you want to query Apache internals from a Perl program. But fortunately, mod_perl has a built-in feature called Apache::Status that allows you to go to http://www.example.com/perl-status or whatever and see a nice hypertext listing of all the Perl-related status info.