beanryu has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get a page working using Mason and Mod_Perl2. I have lampp set up, and I was following the examples from the Mason book.
I downloaded Mason using CPAN, and I see Mason is installed successfully with lampp's perl by running the following command and receiving the following output: /opt/lampp/bin/perl /opt/lampp/htdocs/mason/handshake.pl Greetings, Martians
This is the content of the script#start of script #!/usr/bin/perl use strict; use HTML::Mason; my $interp = HTML::Mason::Interp->new( ); my $comp = $interp->make_component(comp_source => <<'END'); Greetings, <% ("Earthlings", "Martians")[rand 2] %> END $interp->exec($comp); #end of script
But when I try to test the second example in the book, which is creating a html file with only one line:
lampp is complaining that it doesn't return a header, checking the error_log:hi Greetings, <% ("Earthlings", "Martians")[rand 2] %>
[Sun Mar 25 13:28:31 2012] [error] [client 127.0.0.1] malformed header + from script. Bad header=hi Greetings, Earthlings: handshake3.html [Sun Mar 25 13:28:31 2012] [warn] /mason/handshake3.html did not send +an HTTP header
I have in my httpd.conf the following setup:
I tried adding the DefaultType "text/html" line to the Location directive, but it doesn't change anything. After a day of googling, the answer still shuns me. Would you kind monks please bless your enlightenment upon me.PerlModule HTML::Mason::ApacheHandler <Location /mason/handshake3.html> SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler </Location>
|
|---|