I've just got mod_perl installed on my server, but am having some
difficulty with it.  My test script is getting executed (I can see
it detecting the mod_perl environment correctly) but I'm having
trouble with the headers.  Can someone give me a hand?

The script:

    #!/usr/bin/perl -w
    use strict;
    print "Content-type: text/html\n\n";
    print "<HTML><HEAD><TITLE>mod_perl test</TITLE></HEAD><BODY>";
    if ($ENV{'MOD_PERL'}) {
            print "running in mod_perl";
    } else {
            print "running as a CGI";
    }
    print "</BODY></HTML>";

which, when run as a CGI, sends back:

    200 OK
    Connection: close
    Date: Tue, 19 Jun 2001 19:13:41 GMT
    Server: Apache/1.3.9 (Unix) Debian/GNU mod_perl/1.21_03-dev
    Content-Type: text/html
    Client-Date: Tue, 19 Jun 2001 19:13:41 GMT
    Client-Peer: 10.0.0.3:80

    <HTML><HEAD><TITLE>mod_perl test</TITLE></HEAD><BODY>running as a CGI</BODY></HTML>

as you can see, Apache is Doing The Right Thing with headers.  However,
when run under mod_perl, I get back:

    200 OK
    Client-Date: Tue, 19 Jun 2001 19:14:43 GMT
    Client-Peer: 10.0.0.3:80

    Content-type: text/html

    <HTML><HEAD><TITLE>mod_perl test</TITLE></HEAD><BODY>running in 
mod_perl</BODY></HTML>

which is Not Good.

The relevant bit of my httpd.conf (this is inside the relevant VirtualHost):

    <Files *.modperl>
      SetHandler perl-script
      PerlHandler Apache::Registry
      Options ExecCGI
    </Files>

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david/

      Good advice is always certain to be ignored,
      but that's no reason not to give it            -- Agatha Christie

Reply via email to