Problem getting started - modperl

This is a discussion on Problem getting started - modperl ; I'm trying to use mod_perl on Debian Etch. I was looking at "practical mod_perl" book, but it appears that much has changed in mod_perl 2.0 so the second example doesn't work at all. The first example, which is just two ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Problem getting started

  1. Problem getting started

    I'm trying to use mod_perl on Debian Etch. I was looking at "practical mod_perl" book, but it appears that much has changed in mod_perl 2.0 so the second example doesn't work at all.

    The first example, which is just two print statements to give a minimal header and content text, is invoked so I know the code is installed and the Apache configuration files are set up.

    But the code from the Synopses of the Apache2::Request module documentation causes a segfault on the second line. The 'use' is OK, but the 'new' shows in the apache logs that there was a segfault.

    How do I begin to find out what the real error is? Is there something more that needs to be done with Debian installing from the apt? Could someone post a trivial example that ought to work?

    --John


  2. Re: Problem getting started

    John M. Dlugosz wrote:
    > I'm trying to use mod_perl on Debian Etch. I was looking at "practical mod_perl" book, but it appears that much has changed in mod_perl 2.0 so the second example doesn't work at all.
    >
    > The first example, which is just two print statements to give a minimal header and content text, is invoked so I know the code is installed and the Apache configuration files are set up.
    >
    > But the code from the Synopses of the Apache2::Request module documentation causes a segfault on the second line. The 'use' is OK, but the 'new' shows in the apache logs that there was a segfault.
    >
    > How do I begin to find out what the real error is? Is there something more that needs to be done with Debian installing from the apt? Could someone post a trivial example that ought to work?
    >
    > --John


    It looks like the examples from practical mod_perl are from before the
    API was changed to use Apache2:: instead of Apache::. So for all those
    examples you'd need to s/Apache::/Apache2::/g. If you could provide a
    link to the specific example you're having trouble with that might help.
    The whole book is online at http://modperlbook.org/ if you weren't
    already aware.

    For the Apache2::Request problem you're running:

    use Apache2::Request;
    $req = Apache2::Request->new($r);
    @foo = $req->param("foo");
    $bar = $req->args("bar");

    and getting a segfault on new?

    Are you running this as a handler, or through one of the CGI emulation
    layers (ModPerl::PerlRun, or ModPerl::Registry for example). you do
    also have

    my $r = shift;

    somewhere above that (and ideally use strict; as well) right?

    I personally normally install mp and libapreq from source, so i'm not
    familiar with how one would install/configure them using debian.

    Adam


  3. Re: Problem getting started


    Hi John,

    Unfortunately, I'm still muddy with modperl to help you even though I'm
    on Debian Etch. I have it working and can tell you what I have
    installed...but I can't help you with modperl specifics as I'll probably
    end up teaching the wrong thing.

    To answer Adam's question:


    Adam Prime wrote:
    > John M. Dlugosz wrote:
    >> I'm trying to use mod_perl on Debian Etch. I was looking at
    >> "practical mod_perl" book, but it appears that much has changed in
    >> mod_perl 2.0 so the second example doesn't work at all.
    >>

    > I personally normally install mp and libapreq from source, so i'm not
    > familiar with how one would install/configure them using debian.


    aptitude install libapreq2

    as root (or sudo). Or just install everything related if you are not sure:

    aptitude install libapache2-mod-apreq2 libapreq2 libapreq2-dev libapreq2-doc

    (I have all of them installed.)

    Of course, apt-get works too, if you prefer that. I don't remember
    doing more configuration. There's a symlink from
    /etc/apache2/mods-enabled/apreq.load to
    /etc/apache2/mods-available/apreq.load

    Sorry, can't think of anything else tricky that I did. I hope this is
    enough.

    Ray


+ Reply to Thread