[102168] in RedHat Linux List
Internal HTTP ERROR.
daemon@ATHENA.MIT.EDU (aromes@microtec.net)
Tue Dec 1 18:20:22 1998
From: aromes@microtec.net
Date: Tue, 01 Dec 1998 18:34:41 -0800
To: redhat-list@redhat.com
Cc: redhat-list-request@redhat.com, linux-admin@vger.rutgers.edu
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Hi,
Given my little following HTML sample and its related cgi-script, could
anyone tell me why I still get either the output of the text of my
cgi-script(when I do lynx http://localhost/cgi-bin/mailer.pl) or the error
"Internal HTTP ERROR. Config problems" or there no mailer.pl file found on
this server. I ve check all configs for my apache config files,
made sure my cgi0scripts were in right path, made them executables..
<HTML>
<HEAD>
<TITLE>hellpo</TITLE>
</HEAD>
<BODY>
<H1>Send mail to me</H1>
<P>you can use this form to send me mail.
<p><hr><p>
<form method="POST" action=/cgi-bin/mailer.pl">
<input name="from"> Your email address<p>
<input name="subject"> Subject<p>
<input type=hidden name value="aromes@SonyLloyd4">
<hr>
Enter message body below:<br>
<hr>
<textarea name="body" cols=60 rows=12></textarea><p>
<hr>
<input type=submit value="Send mail"><p>
</form>
</BODY>
</HTML>
#Here's mailer.pl in cgi-bin directory:
#!/usr/bin/perl
require "cgi.pl";
&ReadParse;
print STDOUT "Content-type: text/html\n\n";
print STDOUT "<title>Mail form results</title>";
print STDOUT "<h1>Mail form results</h1>;
open (MAIL, "|/usr/lib/sendmail $to") ||
die "<p>Error: Couldn't execute sendmail.\n";
print MAIL "To: $in{'to'}\n";
print MAIL "From: $in{'from'}\n;
print MAIL "subject: $in{'subject'}\n\n";
print MAIL "$in{'body'}\n";
close MAIL;
print STDOUT "<p>All right mailed the following to <tt>$to</tt>:\n";
print STDOUT "<p><pre>";
print STDOUT "To: $in{'to'}\n";
print STDOUT "From: $in{'from'}\n";
print STDOUT "subject: $in{'subject'}\n\n";
print STDOUT "$in{'body'}\n";
print STDOUT "</pre>";
#Here the cgi.pl file in cgi-bin directory, for the cgi routines:
#!/usr/bin/perl
sub ReadParse {
if (@_) {
local (*in) = @_;
}
local ($i, $loc, $key, $val);
#
if ($ENV{'REQUEST_METHOD'} eq "GET" ) {
$in = $ENV{QUERY_STRING'};
} elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
for ($i = 0; $i < $ENV{'CONTENT_LENGTH'}; $i++) {
$in .= getc;
}
}
@in = split(/&/,$in);
foreach $i (0 .. $#in); {
#
$in[$i] =~s/\+/ /g;
#
$in[$i] =~ s/%(..)/pack("c",hex($1)) /ge;
#
$loc = index($in[$i],"=");
$key = substr($in[$i],0,$loc);
$val = substr($in[$i],$loc+1);
$in{key} .= '\0' if (defined($in{$key}));
$in{key} .=$val;
}
1;
And in srm.conf, I have the correct setting:
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
I ve even tried different paths for the script alias directive with no
success.
I even made sure that the directive for my CGI directory has either
Options ExecCGI or ALL.
Thanks for help
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.