Hello Monks; I beg your pardon for this, because it seems I should be able to find the answer somewhere, and it may not be a pure Perl question. But after 2 days of google searches and banging my head on my desk all I have is a dented desk (and a headache.) I'm the first to admit I don't really understand Apache/modperl/data persistence very well, so bear with this fool for a bit...

I have a user authentication script (PerlAuthenHandler) which stores a time value for each authenticated user in a hash. Every time the script runs it updates the value, checks it, etc. Basically if a user has authenticated recently I don't force another check (the underlying authentication is via LDAP.) I want this hash to be persistent across calls to the handler (of course.)

Under Apache 1.3 with an early modperl version this works fine. But now I'm bringing up a new server with Apache 2 and modperl 2, I've set up the httpd.conf and perl.conf file directives the same way, and I can't get it to work. Under Apache 2 the script appears to not be persistent; the hash gets reinitialized with every authentication call.

It's been a while since I set up my old 1.3 server, but I don't recall doing anything special other than installing modperl and setting up the appropriate apache directives. I certainly had to make a lot of changes to my authentication script to get it running under Apache/modperl 2, and it works fine except for this lack of persistence. Is there some configuration value controlling this behavior whose default has changed between Apache or modperl versions?

Here are the relevant entries in my Apache configuration files; they are unremarkable. I include them for completeness. They are identical (except for the name of the modperl module) on both servers.

LoadModule perl_module modules/mod_perl.so . . . <Directory /> Options FollowSymLinks AllowOverride all PerlAuthenHandler MyApache::MyAuthScript AuthType Basic AuthName "Welcome to My Server" Require valid-user </Directory> . . . # ModPerl setup Alias /perl/ /data/www/perl/ <Location /perl/> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI Order allow,deny Allow from all </Location>

Thanks, in advance, muchly. I know this spills over to non-Perl issues as well, but hopefully I'm not too off topic.

"This bounty hunter is my kind of scum: Fearless and inventive." --J.T. Hutt

In reply to modperl PerlAuthenHandler script persistence by SirBones

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.