httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin O'Gorman" <kogor...@gmail.com>
Subject Re: [users@httpd] My apache server stopped doing CGI
Date Mon, 16 Feb 2009 15:48:19 GMT
On Mon, Feb 16, 2009 at 3:12 AM, Bruno - e-comBR <bruno@e-combr.com.br> wrote:
> 2009/2/16 André Warnier <aw@ice-sa.com>:
>> Kevin O'Gorman wrote:
>> [...]
>> You're not saying what version of Apache you are running, but you could look
>> up the "ScriptLog" directive.  That will leave a larger log of what happens
>> when your script is called.
>> Don't leave this activated in normal times, because it is very heavy on the
>> server (well, as long as the scripts are called of course).
>>
>> "Premature end of script headers" basically means "the script crashed".
>> It could just mean - for instance - that the first line of the script (the
>> "shebang" line) now points to some shell that no longer exists at that
>> location.
>> Could.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
> Do you have sure the permissions at /tmp is as it should be?? Maybe
> it's wrong and making your script crash(segmentation fault). Instead,
> try to simply write to stdout.
> You may also run the script at the shell to test it.
>
> Simply try a bash script like this:
> ---
> #!/bin/bash
> echo -e "Content-type: text/plain\r\n"
> echo "It's a cool test"
> export
> ---
>
> []'s
> Bruno Moreira Guedes
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

My script is up and running again.

OS is gentoo Linux, running "stable" packages with weekly updates, so
everything is as current as Gentoo stable gets.

Apache is 2.2.10
Python is 2.5.2

The problem was in argument processing.  An old old old piece of code
that had never caused trouble was crashing without putting out that content-type
like Karel suggested.  It looked like this:

for arg in sys.argv[1:]:
    if arg=='-D':
        DEBUG = not DEBUG
    else:
        sys.stdout.write("Unknown argument: %s\n" % arg)
        sys.exit(1)

It should have output the content-type like all the other error tests
in the code do.

Somewhere along the line, apache must have started passing in one
empty parameter.  Or else python changed in some way.  In any event,
my script started to crash.  I fixed up the error treatment and  added
a case for an empty string.  The script now runs.

Thanks, all.

Another thread will start, because I'm getting odd things in the error
log now, from this script
that runs okay.

-- 
Kevin O'Gorman, PhD

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message