RE: [Hampshire] Apache config & cgi-bin

Top Page

Reply to this message
Author: Bond, Peter
Date:  
To: lug, Hampshire LUG Discussion List
CC: 
Subject: RE: [Hampshire] Apache config & cgi-bin
> > Symptoms are "Premature end of script headers" in the error log.
>
> This implies that the file is being interpreted as a script
> to be run - so
> you can stop looking at your Apache config.


Good start, thank you.

> Your problem is that the script is not returning a vaild hmtl
> page; this
> almost always means that the script had failed.


It's almost too Mickey Mouse to fail:

#!/bin/sh
echo "Content-type: text/html
<html>
<head>
<title>CGI test</TITLE>
</head>
echo "Query string is "
echo $QUERY_STRING
echo "<P>"
echo REMOTE_ADDR = $REMOTE_ADDR
echo "<P>"
echo REMOTE_ADDR = $REMOTE_ADDR
echo "<P>"
echo CONTENT_LENGTH = $CONTENT_LENGTH
echo "<P>"
echo Reading stuff from stdin
echo "<P>"
read STUFF
echo $STUFF
echo "<P>"
echo Done reading stuff from stdin
echo "<P>"
echo "</body>
</html>"

> Can you run it from the shell? Does it do what you expect?


An identical copy (tautology?) of the script runs from my area both from the shell and accessed via Apache...

> If the script nominally runs, check any environment
> differences between
> your login and the Apache user - particularly the path.


OK, I'll take a look - thanks.

Think I might need to set myself up an account as a "normal" user as well.

Blooming user interfaces...

Ta.

Peter

**********************************************************************

This email, its content and any attachments is PRIVATE AND
CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group.
If received in error please notify the sender and destroy the original
message and attachments.

www.tandbergtv.com
**********************************************************************