Re: [Pas-dev] Re: mod_perl 2
Status: Beta
Brought to you by:
mortis
From: Justin B. <ju...@le...> - 2002-05-31 19:35:24
|
Ok. I got all the PAS examples running under Apache 2.0.36, mod_perl 2.0 & CGI.pm 2.81. There's a bug in CGI.pm 3.01b with reading cookies. I might have needed to modify it to make it complient with mod_perl 2.0, I dunno. All the PAS examples work. The internal application developed using PAS still has some small problems but this will get you up and running if you want to be "cutting edge". I think I got everything I changed below. Here's the diff for RequestHandler.pm: ================================================================================= RCS file: /cvsroot/pas/pas/src/Org/Bgw/Pas/RequestHandler.pm,v retrieving revision 1.39 diff -r1.39 RequestHandler.pm 10c10,18 < use Apache::Constants qw(:response :http); --- > use Apache::Const qw(:http :common); > use Apache::RequestRec; > use Apache::RequestIO; # for $r->print() > use Apache::Response; # for $r->send_http_header() > use Apache::SubRequest (); # for $r->lookup_uri() > use APR::Table; # for $r->headers_out() > 133,135c141,142 < $self->request()->header_out( < 'Location' => $self->page()->response()->redirect_uri() < ); --- > $self->request()->headers_out->{'Location'} = > $self->page()->response()->redirect_uri(); 145,147c152,153 < $self->request()->header_out( < 'Expires' => 'Expires: Sat, 29 Dec 2001 16:44:13 GMT' < ); --- > $self->request()->headers_out->{'Expires'} = > 'Expires: Sat, 29 Dec 2001 16:44:13 GMT'; 151,152c157,158 < $self->log()->debug("header_out: Set-Cookie: ", $cookie); < $self->request()->header_out('Set-Cookie',$cookie); --- > $self->log()->debug("headers_out: Set-Cookie: ", $cookie); > $self->request()->headers_out->{'Set-Cookie'} = $cookie; ================================================================================= CGI.pm needs: use Apache::RequestRec; use APR::Pool; And change line 272 from: # Apache->request->register_cleanup(\&CGI::_reset_globals); to: Apache->request->pool->cleanup_register(\&CGI::Object::_reset_globals); And at line 163: require Apache; to: require Apache2; ================================================================================= httpd.conf should look like: PerlInitHandler Apache::Reload PerlSetEnv PAS_BASE "/usr/local/pas" PerlRequire /usr/local/pas/conf/startup.pl Alias /pas/ /usr/local/pas/htdocs/ <Location /pas/> Options +ExecCGI SetHandler perl-script PerlHandler Org::Bgw::Pas::RequestHandler </Location> ================================================================================= Log::Dispatch::Screen behaves a little funny when printing to STDERR. It will just stop in the middle of a log stmt. I just turned it off so it would stop annoying me. Justin |