water has asked for the wisdom of the Perl Monks concerning the following question:

Hi -- This may be an off-topic question, probably dealing more with Apache than Perl, sorry --
We moved a Mason intranet from Apache 1.x on XP to Apache 2.0 on Linux. Surprisingly easy move, and most everything worked right off. (Amazingly.) Some Mason code that redirected, however, stopped working:
% # code snippet % if ($action2 eq 'del-att') { % my $sth = Attribute->sql_kill; % $sth->execute($att); % Attribute->dbi_commit; % $m->clear_buffer; % $m->redirect("/dimatt2.html?cl=$cl&em=$em");
On the new server, Apache issues a redirect message but doesn't redirect:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>200 OK</title> </head><body> <h1>OK</h1> <p>The document has moved <a href="dimatt2.html?cl=3&amp;em=1">here</a +>.</p> <hr /> </body></html>
We get the same results even if we explictly specify the status code (301 or 302) in the Mason redirect call.

We're guessing the server isn't configged right (virtual named server), vs. this being a Mason issue, as the code ran fine under AP 1.... would anyone have any suggestions as to what this might be? Google searching on the error phrase didn't yield any solns.

Thanks

water

Replies are listed 'Best First'.
Re: OT: HTML::Mason & apache redirects
by PodMaster (Abbot) on Apr 02, 2004 at 02:24 UTC
      podmaster, can you elucidate? I've read those and am still in the dark....
        Did you call abort (can't hurt)? Do you have autoflush on (turn it off)? Which handler are you using (important)?

        update:
        I'd say this is the fault of whatever handler you're using (i'm guessing HTML::Mason::ApacheHandler2). You should try MasonX::Apache2Handler (note FLUSH BUFFER AND REDIRECTS).

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Re: OT: HTML::Mason & apache redirects
by neilwatson (Priest) on Apr 02, 2004 at 14:46 UTC
    Are you running mod_perl aswell? Mod_perl does not yet have stable release for Apache2. While this may not be related to you issue, running a production machine on an unstable release is risky.

    Neil Watson
    watson-wilson.ca