Thank you - I am making progress.

I've setup Apache to listen on port 8080 and Included VH config file like so:

<VirtualHost *:8080> ServerName test.graq.co.uk DocumentRoot /home/graq/html/ PerlOptions +Parent PerlSwitches -I/home/graq/lib -I/home/graq/test-lib ScriptAlias /cgi-events /home/graq/cgi-bin ErrorLog /var/log/httpd/graq8080_error_log CustomLog /var/log/httpd/graq8080_access_log combined SetEnv PERL5LIB /home/graq/lib:/home/graq/test-lib Include "/etc/httpd/conf/dev8080/graq.conf" Include "/etc/httpd/conf/dev8080/other.conf" </VirtualHost>
The config file dev8080/graq.conf contains the mod_perl handler definitions:
... PerlModule GRAQ::Menu; ... <Location /_menu> SetHandler modperl PerlOptions +ParseHeaders PerlOptions +SetupEnv PerlResponseHandler GRAQ::Menu </Location> ...
And here is the snippet from GRAQ::Menu
package GRAQ::Menu; use Apache2::Const; use Apache2::RequestRec (); use Apache2::RequestUtil (); sub handler { my ($r) = @_; # my $r = Apache2::RequestUtil->request(); $r->log_error( 'GRAQ::Menu::handler: START'); ... }
Which I have as an alternative tried to setup as an Apache2::Filter.
package GRAQ::Menu; use base qw(Apache2::Filter) ... sub handler :FilterRequestHandler() { my ($f) = @_; my $r = $f->r; ... }
UPDATE To clarify further, the dev8080/other.conf config file has this definition:
<IfDefine MODPERL2> PerlOptions +GlobalRequest </IfDefine>
/UPDATE
But I get this error, despite my best efforts:
Can't locate object method "log_error" via package "Apache2::RequestRe +c" at /home/graq/lib/GRAQ/Menu.pm line 56.

This all used to work with liberal smatterings of <Perl> use lib 'home/graq/lib';</Perl> and I'm getting a little lost on exactly what effects my changes have had on the mod_perl environment.

I remember having this error when porting from mp1 to mp2, but can't find any notes on it or hints from the docs on what object I should have in handler...?

-=( Graq )=-

In reply to Re^3: Dynamic @INC under mod_perl2 (Apache2 VirtualHost) by graq
in thread Dynamic @INC under mod_perl2 (Apache2 VirtualHost) by graq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.