Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

[Newbie] MP2.0: PerlSendHeader versus PerlOptions (and Apache::Registry grrr...)

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


perljunkie at gmail

Apr 24, 2008, 9:18 PM

Post #1 of 3 (315 views)
Permalink
[Newbie] MP2.0: PerlSendHeader versus PerlOptions (and Apache::Registry grrr...)

Okay, it's been a while, despite the name, that I've done any serious
playing around with MP. Since 1.0. I've just installed and gotten
running MP 2.0 on Apache 2.2.8... I'm doing the "ground up" and trying
to get registry scripts working first and I've run into the following,
right-off-the-bat head scratchers:

(1) The documentation says that:


|ParseHeaders|
<http://perl.apache.org/docs/2.0/user/config/config.html#toc_C_ParseHeaders_>

Scan output for HTTP headers, same functionality as mod_perl 1.0's
|PerlSendHeader|, but more robust. This option is usually needs to
be enabled for registry scripts which send the HTTP header with:

print "Content-type: text/html\n\n";


Doesn't work for me... When I run registry scripts using in httpd.conf:

Alias /mp "/var/www/mp"
PerlModule ModPerl::Registry
<Directory "/var/www/mp">
SetHandler perl-script
Options +ExecCGI
PerlHandler ModPerl::Registry
*PerlOptions ParseHeaders*
Order allow,deny
Allow from all
</Directory>

The content-type is never sent and the response delivers text/plain -- I
see the HTML in plain text. When I go back to the MP 1.0 way in
httpd.conf, it works:

Alias /mp "/var/www/mp"
PerlModule ModPerl::Registry
<Directory "/var/www/mp">
SetHandler perl-script
Options +ExecCGI
PerlHandler ModPerl::Registry
*PerlSendHeader On*
Order allow,deny
Allow from all
</Directory>

What's the story here....?

ALSO...

(2) It took me a while to figure out that Apache::Registry has become
ModPerl::Registry. I saw nothing and still see nothing in the MP 2.0
docs about this, what I would consider MAJOR change, and as I said, it
took me a while to realize what happened here... What gives? What was
wrong with Apache::Registry???

I had Stas' book, which I know was written during MP 1.0, so between
these two things, it leaves me wondering how much more of the book is
now practically worthless?? I'm fast beginning to feel MP 2.0 has now
become the domain of "old MP 1.0 hands" and if you didn't follow MP from
1.0 days -- which I did not in a consistent way, then you are out of
luck... Where can I get the latest MP 2.0 beef? I think the MP 2.0
documentation at perl.apache.org leaves a lot to be desired...

Anyways, if someone can explain the ParseHeaders versus PerlSendHeader
and the ModPerl::Registry versus Apache::Registry changes, that would
help at least get registry scripts running in the optimal way. If the
MP 2.0 docs say that ParseHeaders is better, than I'd like to be able to
use it, but right now, it doesn't seem to work as the docs say. :-(

-PJ


perrin at elem

Apr 24, 2008, 9:43 PM

Post #2 of 3 (301 views)
Permalink
Re: [Newbie] MP2.0: PerlSendHeader versus PerlOptions (and Apache::Registry grrr...) [In reply to]

On Fri, Apr 25, 2008 at 12:18 AM, Perl Junkie <perljunkie[at]gmail.com> wrote:
> PerlOptions ParseHeaders

I think that should be +ParseHeaders. See
http://perl.apache.org/docs/2.0/user/porting/compat.html#C_PerlSendHeader_

> (2) It took me a while to figure out that Apache::Registry has become
> ModPerl::Registry. I saw nothing and still see nothing in the MP 2.0 docs
> about this, what I would consider MAJOR change, and as I said, it took me a
> while to realize what happened here... What gives? What was wrong with
> Apache::Registry???

This is answered in the migration guide for converting from 1.x to 2.x:
http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends

> I had Stas' book, which I know was written during MP 1.0, so between these
> two things, it leaves me wondering how much more of the book is now
> practically worthless??

The information about system architecture, performance tuning,
debugging techniques, and general perl issues is all applicable, but
of course the API for mod_perl 2 is different and there's no way
around that. There is a new book by Stas and Jim Brandt about
mod_perl 2:
http://modperl2book.org/

> I think the MP 2.0 documentation at
> perl.apache.org leaves a lot to be desired...

Sorry to hear you don't like the documentation. If you have some
ideas for how to improve it, send them over.

- Perrin


perljunkie at gmail

Apr 24, 2008, 10:00 PM

Post #3 of 3 (302 views)
Permalink
Re: [Newbie] MP2.0: PerlSendHeader versus PerlOptions (and Apache::Registry grrr...) [In reply to]

Perrin Harkins wrote:
> On Fri, Apr 25, 2008 at 12:18 AM, Perl Junkie <perljunkie[at]gmail.com> wrote:
>
>> PerlOptions ParseHeaders
>>
>
> I think that should be +ParseHeaders. See
> http://perl.apache.org/docs/2.0/user/porting/compat.html#C_PerlSendHeader_
>
I did finally see that in another section. I *have* to bother thousands
of people with a question before I find it in the docs, even if I've
already looked. I have no idea why it works out that way. :-( :-)
>
>> (2) It took me a while to figure out that Apache::Registry has become
>> ModPerl::Registry. I saw nothing and still see nothing in the MP 2.0 docs
>> about this, what I would consider MAJOR change, and as I said, it took me a
>> while to realize what happened here... What gives? What was wrong with
>> Apache::Registry???
>>
>
> This is answered in the migration guide for converting from 1.x to 2.x:
> http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends
>
Nice.
>
>> I had Stas' book, which I know was written during MP 1.0, so between these
>> two things, it leaves me wondering how much more of the book is now
>> practically worthless??
>>
>
> The information about system architecture, performance tuning,
> debugging techniques, and general perl issues is all applicable, but
> of course the API for mod_perl 2 is different and there's no way
> around that. There is a new book by Stas and Jim Brandt about
> mod_perl 2:
> http://modperl2book.org/
>
I'll look into it. Thanks. Sounds invaluable.
>
>> I think the MP 2.0 documentation at
>> perl.apache.org leaves a lot to be desired...
>>
>
> Sorry to hear you don't like the documentation. If you have some
> ideas for how to improve it, send them over.
>
Hmmmm, seems like maybe my ability to spot the right information IN the
docs is what is leaving a lot to be desired right now. :-) Maybe I need
to just settle down and read some more first before assuming it's "not
there." Thanks!

The only suggestion so far would be to make that one section I quoted on
the ParseHeaders option a little more clearer than it is albeit it's
documented elsewhere, as you pointed out above.

What nice people here at MP... :-) Alright, I'll leave y'all alone and
do some more reading first. The migration guide seems like a good place
to start to convert all my past (way, way back in the past) remembrances
into the new MP2 reality.

-PJ

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.