Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / September 2004



Tip: Looking for answers? Try searching our database.

10.3.5 - mod_perl upgrade trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Brosnan - 20 Sep 2004 20:17 GMT
Hello,

Previously I had been running Mac OS X 10.2.X. I had installed an
additional version of Perl (v5.8.4) and used it to build mod_perl(v1.29)
and Apache (v1.3.31). mod_perl scripts ran fine, until ...

Last night I upgraded to Mac OS X 10.3.5. and Apple installed new
versions of Perl, mod_perl and Apache. After modifying the new
httpd.conf file, I restarted Apache and checked the error log:

[notice] Apache/1.3.29 (Darwin) mod_perl/1.26 configured -- resuming
normal operations

However, even though it appears that mod_perl is loaded, I can't get
mod_perl scripts to run. Depending on which browser I use, it either
seems to ignore the request(Camino) or complain 'could not load any data
from this location'(Safari). No errors are reported in the error log.

If I remove 'PerlHandler Apache::Registry', etc. from httpd.conf, it
serves up the plain text just fine.

Any thoughts?

Regards,
Andrew
Chris Devers - 20 Sep 2004 20:31 GMT
> However, even though it appears that mod_perl is loaded, I can't get
> mod_perl scripts to run.

This had been driving me nuts for months, and I finally figured it out
this weekend. I posted a message a while back about Apache::MP3 not
working, but wasn't able to find a fix at the time -- now it works, too.

A fuller description is on my web site (see below), but basically, for
reasons I'm not clear on, mod_perl isn't grabbing stdout from scripts,
which means they go through the motions of working, normal activity
shows up in the access log (and nothing in the error log), but nothing
ever shows up in the browser.

The interesting test is to telnet to the web port of your server and
manually request a mod_perl controlled document:

-> $ telnet localhost 80
   Trying 127.0.0.1...
   Connected to my-tester
   Escape character is '^]'.
-> GET /perl/test HTTP/1.0
->
   $

Or something like that -- no data at all comes back.

The fix is to tie STDOUT to Apache in your script --

   tie *STDOUT, 'Apache';

-- or do the same in your httpd.conf --

   PerlHeaderParserHandler "sub { tie *STDOUT, 'Apache' unless tied *STDOUT; }"

I'm still not clear what, exactly, the bug is that is causing this
(simply a bad build that got shipped?), but in any event the mechanism
makes sense, and the way to fix it is clear.

Give that a try & let me know if it doesn't work.

This ought to be in a prominent Perl/OSX10.3 FAQ somewhere... :-/

Longer version of the above, with links & references, etc:

   <http://devers.homeip.net:8080/blog/archives/000064.html>

Signature

Chris Devers

Andrew Brosnan - 20 Sep 2004 21:04 GMT
> > However, even though it appears that mod_perl is loaded, I can't get
> > mod_perl scripts to run.
>
> This had been driving me nuts for months,

Now I feel better. It's only been driving me nuts for 7-8 hours :-)

> and I finally figured it out this weekend.

Lucky me!

>...they go through the motions of working, normal activity
> shows up in the access log (and nothing in the error log), but nothing
> ever shows up in the browser.

AARRGGHHH!!! YES!!...oops, sorry. For a moment I forgot that I felt
better.

> The fix is to tie STDOUT to Apache in your script --

Thanks, works great. I owe you a beer!

> This ought to be in a prominent Perl/OSX10.3 FAQ somewhere... :-/

Indeed.
William Ross - 21 Sep 2004 10:06 GMT
>> However, even though it appears that mod_perl is loaded, I can't get
>> mod_perl scripts to run.
[quoted text clipped - 9 lines]
> shows up in the access log (and nothing in the error log), but nothing
> ever shows up in the browser.

Odd. This doesn't seem to apply to native handlers - is that the right
description? - only to Apache::Registry scripts. I've used the stock
apache/mod_perl all along without any trouble.

best

will
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.