Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apache --Long-- question, very frustrated!



Les Pendleton wrote:
> 
> First:  I wanted to see what modules are running so I typed httpd -l to
> try out the command, I got a reply command not found... I figured that
> the path were the executable resides wasn't set, so I cd into every
> directory which I felt might might contain that binary and tried it
> again, still no luck.  

I don't know much about apache, but on my system (RedHat 6.1), httpd is
at '/usr/sbin/httpd'.  Since you installed it via RPM, 'rpm -ql apache'
should tell you what you need to know to find it.  Of course, if all
else fails you can 'find / -name httpd | less' and go for a short beer! 
:-)



> [Wed Jun 14 15:11:49 2000] [error] [client 24.28.27.151] Premature end
> of script headers: /home/httpd/cgi-bin/mailer.pl
> 
> Here is the perl code:
> 
> #/usr/bin/perl
> use CGI qw(:standard);
> 
> print header(), start_html( "Mail from results" ),\
> h1( "Mail from results" );
> 
> my $to = parse( "to" );
> my $from = parse( "from" );
> my $subject = parse( "subject" );
> my $body = parse( "body" );
> 
> open (MAIL, "|/var/qmail/bin/qmail-inject $to") || die "<p>Error:
> Couldn't execute qmail. \n";
> 
> print MAIL "To: $to\n";
> print MAIL "From: $from\n";
> print MAIL "subject: $subject\n\n";
> print MAIL "$body\m";
> close MAIL;
> 
> print p( "All right, mailed the following to <tt>$to</tt>:" );
> print p( "<pre>\nTo: $to\nFrom: $from\nsubject:
> $subject\n\n$body\n</pre> );
> print end_html();

You're missing an end " in the second to last line, which ought to read:

$subject\n\n$body\n</pre>");

This missing quote is preventing the 'print end_html()' instruction from
being executed, and leading to an error.  You could help yourself with
this (a) by using the "-w" switch on the first line where you specify
the path to the perl interpreter and (b) by using a highlighting editor
-- my favorite is emacs. :-)

> I also noticed in my httpd.conf file that the Module for perl was
> commented out,
> Here's a list of the modules in listed in the file:  Do I need to
> un-comment this?

Not if all you want to do is CGI.  The whole point of CGI is that the
web server doesn't have to know anything about the program except that
it's executable and that it returns the right headers.  CGI programs can
be perl, compiled C, bash, or whatever.  The modules here (like
mod_perl) are for running an interpreter *inside* the server process --
much more efficient than CGI, but not quite as general.

Good luck, and keep your spirits up!

Dan
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org