undefined subroutine: get_server_description, get_server_banner

undefined subroutine: get_server_description, get_server_banner

am 08.04.2008 13:26:55 von Jeff Armstrong

Folks,


indicates that I should be able to:
$description = Apache2::ServerUtil::get_server_description();

however, I find that
Apache2::ServerUtil::get_server_description();
Apache2::ServerUtil::get_server_banner();

warn => Undefined subroutine

and
Apache2::ServerUtil->user_id;
Apache2::ServerUtil->group_id;

warn => Can't locate object method

Are the docs incorrect, or am I doing the wrong thing?

----
Other subs work ok: get_server_built get_server_version server_root

Debian stable (etch)
Apache/2.2.3
mod_ssl/2.2.3
OpenSSL/0.9.8c
mod_apreq2-20051231/2.6.0
mod_perl/2.0.2
Perl/v5.8.8


Many thanks,

Jeff

Re: undefined subroutine: get_server_description, get_server_banner

am 08.04.2008 14:53:11 von Jeff Armstrong

Folks,

I am finding this frustrating - many of the documented functions do not
appear to work,

another example - I am trying to find the local IP and port of the
connection - local_ip works, $r->connection->local_addr->port() does
not, and $r->server->port() return 0.

Has anyone already written an equivalent of phpinfo() which basically
dumps out everything-you-might-want-to-know about the current OS,
server, request, cookies, environment and connection?

More specifically, I was also hoping to gain direct access to the SSL
connection info for client certificate authentication - e.g. the stuff
that appears in %ENV like:
SSL_CLIENT_S_DN_CN
SSL_CLIENT_S_DN_Email
SSL_CLIENT_S_DN

Am very happy to be redirected to updated / accurate info, though I have
read the relevant sections in the docs and horsey book that I could find.

Regards & thanks,

Jeff


-------- Original Message --------
Subject: undefined subroutine: get_server_description, get_server_banner
From: Jeff Armstrong
To: modperl
Date: 08 April 2008 12:26:55

> Folks,
>
>
> indicates that I should be able to:
> $description = Apache2::ServerUtil::get_server_description();
>
> however, I find that
> Apache2::ServerUtil::get_server_description();
> Apache2::ServerUtil::get_server_banner();
>
> warn => Undefined subroutine
>
> and
> Apache2::ServerUtil->user_id;
> Apache2::ServerUtil->group_id;
>
> warn => Can't locate object method
>
> Are the docs incorrect, or am I doing the wrong thing?
>
> ----
> Other subs work ok: get_server_built get_server_version server_root
>
> Debian stable (etch)
> Apache/2.2.3
> mod_ssl/2.2.3
> OpenSSL/0.9.8c
> mod_apreq2-20051231/2.6.0
> mod_perl/2.0.2
> Perl/v5.8.8
>
>
> Many thanks,
>
> Jeff

Re: undefined subroutine: get_server_description, get_server_banner

am 08.04.2008 15:01:13 von Malcolm J Harwood

On Tuesday 08 April 2008 07:26:55 am Jeff Armstrong wrote:

> Folks,
>
> >escription_> indicates that I should be able to:
> $description = Apache2::ServerUtil::get_server_description();
>
> however, I find that
> Apache2::ServerUtil::get_server_description();
> Apache2::ServerUtil::get_server_banner();
>
> warn => Undefined subroutine
>
> and
> Apache2::ServerUtil->user_id;
> Apache2::ServerUtil->group_id;
>
> warn => Can't locate object method
>
> Are the docs incorrect, or am I doing the wrong thing?

Did you remember to "use Apache2::ServerUtil"? It's probably obvious, but it's
easy to miss sometimes - mod_perl doesn't pull in all the APIs automatically,
just what you specify (to avoid memory overhead for things you don't use).


> Has anyone already written an equivalent of phpinfo() which basically
> dumps out everything-you-might-want-to-know about the current OS,
> server, request, cookies, environment and connection?

Does Apache2::Status (http://perl.apache.org/docs/2.0/api/Apache2/Status.html)
give you want you want?

Re: undefined subroutine: get_server_description, get_server_banner

am 08.04.2008 15:26:26 von torsten.foertsch

On Tue 08 Apr 2008, Jeff Armstrong wrote:
> More specifically, I was also hoping to gain direct access to the SSL
> connection info for client certificate authentication - e.g. the stuff
> that appears in %ENV like:
> =A0 SSL_CLIENT_S_DN_CN
> =A0 SSL_CLIENT_S_DN_Email
> =A0 SSL_CLIENT_S_DN

Apache2::ModSSL on CPAN.

Torsten

Re: undefined subroutine: get_server_description, get_server_banner

am 08.04.2008 16:02:44 von jeff

> Did you remember to "use Apache2::ServerUtil"? It's probably obvious, but it's
> easy to miss sometimes - mod_perl doesn't pull in all the APIs automatically,
> just what you specify (to avoid memory overhead for things you don't use).

Yes - I have already used Apache2::ServerUtil - other funcs are working.

(though this was the problem for APR::SocketAddr,
$r->connection->local_addr->port() is now working. I am used to objects
having loaded their packages, these are not real objects, despite the ->
syntax)

I also note from Modperl2 users Guide' that things like uid / guid (does
that mean group_id and user_id too?) are platform specific and so have
to be coded by modperl users.

> Does Apache2::Status (http://perl.apache.org/docs/2.0/api/Apache2/Status.html)
> give you want you want?

have it installed, will check it out...

Re: undefined subroutine: get_server_description,

am 08.04.2008 17:45:54 von Adam Prime

Quoting Jeff Armstrong :

> Folks,
>
> indicates that I should be
> able
> to:
> $description = Apache2::ServerUtil::get_server_description();
>
> however, I find that
> Apache2::ServerUtil::get_server_description();
> Apache2::ServerUtil::get_server_banner();
>
> warn => Undefined subroutine
>

Those functions were added in 2.0.4, which is currently in RC, as the
docs indicate. If you install the 2.0.4 RC1 (see:
http://marc.info/?l=apache-modperl&m=120760945808543&w=2)

> and
> Apache2::ServerUtil->user_id;
> Apache2::ServerUtil->group_id;
>
> warn => Can't locate object method
>

Those functions were added in 2.0.3, as the docs indicate. If you
upgrade to 2.0.3, they should work.

Adam

Re: undefined subroutine: get_server_description, get_server_banner

am 09.04.2008 12:15:00 von jeff

Doh! Thanks for that Adam!

The version info in the docs was indeed staring me in the face

An MP2 upgrade is out of the question - Debian Stable is 2.0.2 for the
next few years (historically, 3 year cycle, Stable was first released
Aug-07), Testing and Unstable currently have MP2.0.3_5, but these don't
get security patched, and worse require a different libc6 chain, (2.3.5
vs 2.7 [ia64]) that has not been fully soak tested for interaction
stability.

Stable prod servers are a high priority for us, so its MP2.02 for the
next few years, sigh. At least we are not still stuck on a non-working
(pre-rename) 1.99-21 as we were until Aug 07!

Thanks again!

Jeff