Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Internal Server Error please help

Status
Not open for further replies.

yoramdar

IS-IT--Management
Jan 8, 2004
15
US
Hi Mates,

Recently I migrated to a new server running FreeBSD 4.9 and apache 2.0.47. Unfortunately one of my cgi scripts does not work. The error log indicates on “malformed header”, while on the browser I get an Internal Server Error message, this suppresses me since the cgi ran correctly on the old server.

Here is the error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator,

Thank you for your help
 
Can you show us the lines of your CGI printing the header out?

I bet you are not printing a 'real' header but just printing 'Content-type: text/html\n\n' which does not always work.

 
Here is the whole script
the variables $to, $from, filename, @comments I get from the client.

#!/usr/bin/perl -w
use strict;
use CGI qw:)all);
use CGI::Carp qw(fatalsToBrowser);

sub send_mail {
my($to, $from, $subject, $filename, @comments)=@_;

my $sendmail="/usr/sbin/sendmail -t";

open(MAIL, "|$sendmail") || die "Can't start sendmail: $!";

print MAIL<<END_OF_HEADER;
From: $from
To: $to
Subject: $subject

END_OF_HEADER

print MAIL &quot;$filename\n&quot;;
foreach (@comments) {
print MAIL &quot;$_\n&quot;;
}
close(MAIL);
}

print header;

my ($FileName)=param(&quot;FileName&quot;);
my ($From)=param(&quot;From&quot;);
my ($Email)=param(&quot;Email&quot;);
my (@Comments)=param(&quot;Comments&quot;);

my ($subject)=&quot;You have got mail&quot;;

send_mail($Email,
$From,
$subject,
$FileName,
param(&quot;Comments&quot;));


print<<END_OF_HTML;
<html>
<head>
<title>reply </title>
</head>
<body bgcolor=&quot;#C5C2FB&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr>
<td>
<div align=&quot;center&quot;> </div>
</td>
</tr>
</table>
<p align=&quot;center&quot;> </p>
<p align=&quot;center&quot;><b><font size=&quot;5&quot; color=&quot;#3300CC&quot;>Thank You </font></b></p>
</body>
</html>
END_OF_HTML


 
Is

my $sendmail=&quot;/usr/sbin/sendmail -t&quot;;

valid? Meaning is that where sendmail actually is and does it take the -t command?

You may be boming out at that level.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top