#48 Localise PerlAccessHandler

closed-rejected
Rob Malda
None
5
2002-08-01
2001-05-29
Kevin Tam
No

PerlAccessHandler Slash::Apache::User

performs modifications on the Apache->request object
that appears to render it unusable for mod_perl
scripts outside Slash that use mod_perl and CGI.
Specifically, CGI.pm will not handle POST requests if
the request passses through that handler.

My workaround for this was to make sure the handler is
only used for Slash's scripts and the change is as
simple as

<Location ~ "^/(([^/]*)\.pl)?$">
PerlAccessHandler Slash::Apache::User
PerlLogHandler Slash::Apache::Log
</Location>

I also move the LogHandler in the config so that Slash
doesn't log requests to my other scripts (but it will
miss logs to Slash's .html .shtml etc. files).
However, crucially, my other mod_perl app runs with
Slash quite happily now that the PerlAccessHandler
isn't in the way.

Here is the diff for bin/install-slashsite if it helps

--- install-slashsite Wed May 9 19:02:34 2001
+++ install-slashsite-patch Tue May 29 22:14:39
2001
@@ -377,7 +377,9 @@

SlashVirtualUser $opts{'u'}

+ <Location ~ "^/(([^/]*)\.pl)?$">
PerlAccessHandler Slash::Apache::User
+ </Location>
PerlLogHandler Slash::Apache::Log

# this directive will redirect non-logged-in
users to

Discussion

  • Kevin Tam
    Kevin Tam
    2001-05-29

    Logged In: YES
    user_id=229427

    Cliff tells me that Location regexp was a little
    confusing... which it is =P

    The point is that
    mysite.com/
    mysite.com/some_slash.pl
    mysite.com/more_slash.pl
    all get that handler which is necessary whereas
    mysite.com/sub/not_slash.pl
    doesn't get the PerlAccessHandler so it works properly

    The regexp might also need to be adjusted in the event that
    Slash is installed in a sub URL (mysite.com/slash/)

     
  • Logged In: NO

    Another way to do it:

    # turn off the special slash mod_perl handlers in the
    foo area
    <Location /foo>
    PerlAccessHandler "sub {1}"
    PerlLogHandler "sub {1}"
    </Location>

    I think that Alvaro's patch (http://sourceforge.net/tracker/
    index.php?func=detail&aid=427976&group_id=4421&
    atid=304421) also potentially fixes the problem.

    -nathan at thethirdsector dot com

     
  • Jamie McCarthy
    Jamie McCarthy
    2002-06-20

    • assigned_to: nobody --> krow
     
  • Brian Aker
    Brian Aker
    2002-08-01

    • assigned_to: krow --> cmdrtaco
    • status: open --> open-rejected
     
  • Brian Aker
    Brian Aker
    2002-08-01

    Logged In: YES
    user_id=25967

    The log handler and the rest are also used for non-slash
    pages (like shtml).
    So this is a no go.

     
  • Rob Malda
    Rob Malda
    2002-08-01

    • status: open-rejected --> closed-rejected