httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karel Kubat <>
Subject Re: [users@httpd] My apache server stopped doing CGI
Date Mon, 16 Feb 2009 08:14:52 GMT
Hash: SHA1

Hi Kevin,

On Feb 16, 2009, at 1:41 AM, Kevin O'Gorman wrote:

> The logs are not much help.  The access log shows that the
> request got an error code,
> - - [15/Feb/2009:15:46:32 -0800] "GET /hex-bin/board
> HTTP/1.1" 500 542

OK.. so a HTTP 500 (internal server error) code.

> and all that the error log says is:
> [Sun Feb 15 15:46:32 2009] [error] [client] Premature
> end of script headers: board

This usually indicates that the script didn't send "Content-Type: text/ 
html" as its first line (at least, in my case, because that's what I  
usually forget).

> I put a simple C program in there to create a file in /tmp, and  
> nothing happens.

You mean you replaced /hex-bin/board with another CGI that didn't  
execute? Strange, because the error log above indicates invalid  
execution - but execution nonetheless.

> So the question is: how can I debug this?  Or does anyone have an
> inuition about what might be wrong?

Have your script send messages to stderr. These will go into Apache's  
error log.

Alternatively, to work from the CLI, proceed as follows. Set the  
environment variable QUERY_STRING to your input arguments (as in,  
export QUERY_STRING="name=Kevin&location=San+Francisco") so you can  
run the script from the commandline and see what happens. The script  
must answer with Content-Type: text/html followed by one empty line,  
and then must send HTML that the browser would render.

Also very important: try the CLI approach while under the permissions  
of the Apache user (stated in your httpd.conf). E.g., if your user is  
"www", then:
	su - www
	cd /hex/bin/
	export .... and so on
That way you truly verify that the www user has access to the cgi-bin  
directory and may run the script.

- --
Best regards / met vriendelijke groet, Karel Kubat
Mob +31 6 2956 4861

Version: GnuPG v1.4.9 (Darwin)


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message