Skip to main content.
home | support | download

Back to List Archive

Re: runs from command line, not from browser

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Nov 29 2002 - 20:25:52 GMT
At 11:33 AM 11/29/02 -0800, Jody Cleveland wrote:
>Hello,

Hi!

>Well, I finally got a production Linux server! Anyway, I've got swish-e
>2.2.2 setup on redhat 8. I got it installed fine, it indexed my site fine,
>and I can run swish.cgi from a command prompt and it all runs great. The
>problem comes in when I try to run it from a web browser.

When you say you can run it form the command line you mean you can run it
by typing:

  ./swish.cgi

Make sure you test that way instead of typing "perl swish.cgi".

>Here's the error I get in the browser:
>The server encountered an internal error or misconfiguration and was unable
>to complete your request.
>
>I check the error log and it says this:
>[error] [client 172.30.2.136] Premature end of script headers: swish.cgi

And no other errors?  (BTW -- good for you to actually check the log!)

Run the script like 

   ./swish.cgi | head

and make sure it's showing the correct header:

> ./swish.cgi | head  
Content-Type: text/html; charset=ISO-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
       <title>
          Search our site
       </title>
    </head>
    <body>

That's the correct output from the script.  If that works, but fails when
running as a CGI script then it's probably a permissions problem, although
the script will catch most of those and simply display "Software Error
Please check error log".  If you are using a .swishcgi config file and the
user that the web server runs as doesn't' have permission to read that file
then you will see the Internal Server Error.  But that should be detailed
in the error log file.

You might also check httpd.conf for a ScriptLog directive.

>http://email.winnefox.org/cgi-bin/search/swish.cgi

I get a 404 error.

Although this is CGI debugging, can you post what solution you find?  That
will help others.  Thanks,

-- 
Bill Moseley
mailto:moseley@hank.org
Received on Fri Nov 29 20:26:01 2002