Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Mod Perl Content Header Output

by Hrunting (Pilgrim)
on Dec 21, 2000 at 02:49 UTC ( [id://47668]=note: print w/replies, xml ) Need Help??


in reply to Mod Perl Content Header Output

There's a server configuration variable 'PerlSendHeader'. Set it to 'off' to send your own headers (I believe, it's actually different on my server conf, but this is what the man page says).

This exact question and many exactly like it are answer in the mod_perl Guide (which appears to be down as I write this). This is one of the most frequently asked questions by people starting.

Also, 'man cgi_to_mod_perl'.

Replies are listed 'Best First'.
mod_perl Content Header Output with PerlSendHeader off
by true (Pilgrim) on Oct 23, 2002 at 09:52 UTC
    I set the PerlSendHeader to 'off' in my httpd.conf configuration but i am still getting a content-type header printed out by apache. Under mod_perl this test script outputs to my browser the following:
    Content-type:image/gif
    Here's my test.cgi script which is inside my mod_perl directory (/home/httpd/perl/).
    #!/usr/bin/perl -w use strict; if ($ENV{'MOD_PERL'}){ print "Content-type:image/gif\n\n"; #my image output will go here }else{ print "Content-type:text/html\n\n"; print "MOD_PERL is off"; } exit;
    And here's my httpd.conf settings.
    <IfModule mod_perl.c> Alias /perl/ /home/httpd/perl/ <Location /perl> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader off </Location> </IfModule>
    I restarted apache and did a killall -HUP apache. As you can see by the output of the script, mod_perl is working. I'm running mod_perl/1.23. Anybody have any ideas on how i can fix this? I'd like to be able to output more than just text/html files with mod_perl.

    thanks monks,
    james

    p.s. i tried "PerlSendHeader off" and "PerlSendHeader Off"

      It's the other way around. PerlSendHeader should be *ON*. From the ModPerl documentation:

      The PerlSendHeader On directive tells mod_perl to intercept anything that looks like a header line (such as Content-Type: text/plain) and automatically turn it into a correctly formatted HTTP/1.0 header, the same way it happens with CGI scripts running under mod_cgi. This allows you to keep your CGI scripts unmodified.
      oh crap, you are absolutely right. lol. May my stupidity be a shining beacon for those who follow in my footsteps.
      thanks very much.
      jtrue

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://47668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-20 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found