Welcome to WebmasterWorld Guest from 54.167.153.63

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

mod perl: Page outputs source code

Need help getting mod_perl working correctly

   
1:35 am on Oct 6, 2008 (gmt 0)

10+ Year Member



Hi All,

I have searched around the forums but cannot find an answer to my mod_perl troubles.

Basically i finally got mod_perl working where it will interpret the script BUT when i view the script on this server via a browser i get a complete dump of the page's HTML source code.

All perl code is interpreted correctly, but it's like the page's header is not being sent over correctly?

On a different server that has mod_perl working correctly, i can access the exact same script/source code and the page renders correctly.

Any pointers on where i can look?

This is an ubuntu/apache2 setup.

Thank you!

PS: Here is the start of the script im running if it helps?


#!/usr/bin/perl

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

###Find where we are
open(PWD,'pwd');
$pwd = join('',<PWD>);
$pwd =~ s/\n//gi;
close PWD;

### Find the system date
open(DT, 'date "+DATE: %Y-%m-%d%n<br>TIME: %H:%M:%S"');
$dt = join('', <DT>);
$dt =~ s/\n//gi;
close DT;

print "<HEAD><TITLE>Advanced Whereami.cgi</TITLE></HEAD>\n";
print "<body bgcolor='#CC3399' text='#000000'>\n";

.....etc

[edited by: phranque at 8:17 am (utc) on Oct. 6, 2008]
[edit reason] disabled smileys ;) [/edit]

8:27 am on Oct 6, 2008 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



maybe it's not sending a correct HTTP Response header and/or you're getting a text/plain content type in front of your document.
have a look at this documentation and see if anything there works for your situation:
[modperlbook.org...]
4:30 pm on Oct 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are missing the opening <HTML> tag... and you may want to send a DTD ahead of it.
6:46 pm on Oct 6, 2008 (gmt 0)

10+ Year Member



phranque... Thank you sir!

PerlSendHeader On

was needed in my location def within /etc/apache2/apache2.conf

 

Featured Threads

Hot Threads This Week

Hot Threads This Month