Philip M. Gollucci wrote:
> What version of mp2 comes with Sarge packages ?
> 1.9922 or higher I hope.

Thanks for your reply.  :-)

    [EMAIL PROTECTED]:~$ apt-cache showpkg libapache2-mod-perl2 | head -n 3
    Package: libapache2-mod-perl2
    Versions:
    1.999.21-1(/var/lib/apt/lists/ftp.us.debian.org_debian_dists_stable_
main_binary-i386_Packages)(/var/lib/dpkg/status)


> use Apache2::Const -compile qw(OK) or similiar see
> http://perl.apache.org/docs/2.0/rename.html

Okay.  I have a bunch more reading to do:

    http://perl.apache.org/docs/index.html


> I assume you are using
> http://modperl.com/book/source/apachemod-code-1.02/lib/Apache/Hello.pm

No.  When I work my way through a book, I learn best if I write functionally
similar code from scratch.  My code follows at the end.


>>     [EMAIL PROTECTED]:~$ grep Method .bashrc
>>     alias lookup="perl -MModPerl::MethodLookup -e print_method"
> hmm.... I'll bet you are using something PRE RC5 (i.e. 1.9921 or
> before) Likely, you're not missing it, but its not in your @INC.

    [EMAIL PROTECTED]:~$ locate MethodLookup.pm
    /usr/lib/perl5/Apache2/ModPerl/MethodLookup.pm

    [EMAIL PROTECTED]:~$ perl -e 'print join("\n", @INC), "\n";'
    /home/dpchrist/perl/lib/perl/5.8
    /home/dpchrist/perl/lib/perl/5.8.4
    /home/dpchrist/perl/share/perl/5.8
    /home/dpchrist/perl/share/perl/5.8.4
    /etc/perl
    /usr/local/lib/perl/5.8.4
    /usr/local/share/perl/5.8.4
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.8
    /usr/share/perl/5.8
    /usr/local/lib/site_perl

Looking at the porting guidelines again:

    http://winnipeg.pm.org/modperl/docs/2.0/user/porting/porting.html

and changing the alias:

    [EMAIL PROTECTED]:~$ perl -e 'use Apache2::ModPerl::MethodLookup;'

removes the Perl error, but doesn't provide any useful information:

    [EMAIL PROTECTED]:~$ lookup content_type
    [EMAIL PROTECTED]:~$

    [EMAIL PROTECTED]:~$ perl -MApache2::ModPerl::MethodLookup -e print_method
content_type


I guess I'm missing libraries, or mine are out of date/ broken (?).


>> Has anyone had success using Debian 3.1 with Apache2 and mod_perl2?
> Haven't tried yet, but I'll have a test bed sometime next week.

Okay.  I'll be interested to hear your findings.


>> Someone mentioned FreeBSD -- which version?  5.4?  Are there "ports"
>> for CPAN modules, or does the user go to CPAN directly?
> I'm biased to FreeBSD so I won't comment.  However, to answer your
> question. ports/packages are at 2.0.54 and 2.0.1.
> Should work on almost all versions.  If you wanted threaded
> environments use 5.3+ with libpthread.so instead of the older
> libc_r.so
> I'll vouch vor 4.11, 5.3, 5.4, 6.0-BETA2, 7.0-current.

I downloaded and burned ISO's for FreeBSD 5.4, but my vintage hardware won't
boot the CD and segfaults when I insert the boot floppy the second time.  I
downloaded 4.11 ISO's just now, and will try those next.


Any other suggestions/ comments/ recommendations?


David



#######################################################################
# $Id: Hello.pm,v 1.8 2005/07/20 23:53:48 dpchrist Exp $
#
# "hello, world!" using mod_perl per [1] pp. 30, 123.
#
# Copyright 2005 by David Christensen <[EMAIL PROTECTED]>
#
# References:
#
# [1]  Lincoln Stein & Doug MacEachern, 1999, "Writing Apache Modules
#      with Perl and C", O'Reilly, ISBN 1-56592-567-X.
#######################################################################
# package:
#----------------------------------------------------------------------

package Apache::Hello;

#######################################################################
# uses:
#----------------------------------------------------------------------

use strict;
use warnings;

use Apache::Constants qw(:common);

#######################################################################
# Apache mod_perl handler:
#----------------------------------------------------------------------

sub handler
{
    my $r = shift;

    my $retval = OK;            ##### optimistic
    
    $r->content_type('text/html');
    $r->send_http_header;
    goto done if $r->header_only;
    my $host = $r->get_remote_host;
    $r->print(<<END);
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1>hello, $host!</H1>
Who would take this book seriously if the first example didn't say
"hello, world!"?
</BODY>
</HTML>
END

  done:
    return $retval;
}

#######################################################################
# end of code:
#----------------------------------------------------------------------

1;

__END__

#######################################################################

Reply via email to