Re: My apache server stopped doing CGI

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

 



On Mon, Feb 16, 2009 at 3:12 AM, Bruno - e-comBR <bruno@xxxxxxxxxxxxxx> wrote:
> 2009/2/16 André Warnier <aw@xxxxxxxxxx>:
>> 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@xxxxxxxxxxxxxxxx
>>  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>
> 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@xxxxxxxxxxxxxxxx
>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
>

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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux