[KLUG Members] Apache

John Pesce members@kalamazoolinux.org
Wed, 4 Sep 2002 09:59:39 -0400 (EDT)


Hi all,

I'm not sure if this is an apropriate list to post this, but I read all
the relative pages on Apache's site.

I'm running a CGI program written in C. The script runs fine until I add a
call to system() to do some post-processing on some files the script
produced. I can run the script manually and it does not produce errors.
The program being called by system() runs fine, even from the CGI because
its output files were created properly. Also, I turned on debuging for
CGIs and the results section is the webpage that should be displayed.

The error in the log is:
malformed header from script. Bad header=/home/httpd/html/capacity/MCO/:
/warehouse/apache/cgi-bin/Capacity

The first directory is the one the program was working in.
The second line is the name of the cgi program.

The output of the cgi logger is below. Everything in the %request
and %stdout section looks correct. The %stdout section is a valid page and
what I get if I don't include the system() call.

The %response section seems to be what apache is complaining about, but
that is not the response %stdout is.

What am I missing here??? The system() call must be doing something?



-----------------------------------------

%% [Wed Sep  4 05:30:54 2002] POST /cgi-bin/Capacity HTTP/1.1
%% 500 /warehouse/apache/cgi-bin/Capacity
%request
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Language: en-us, en;q=0.50
Connection: keep-alive
Content-Length: 308
Content-Type: application/x-www-form-urlencoded
Cookie: Online_ID=1031101600%3A1031080000-0013228%3Astf
Host: earl.blah
Keep-Alive: 300
Referer: http://earl.blah/capacity/MCO/MCO.html
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
Gecko/20020529

airport=MCO&active0=on&visibility0=0&windSpeed0=0&windDirection0=0&broken0=-1&active1=on&visibility1=0&windSpeed1=0&windDirection1=0&broken1=-1&visibility2=0&windSpeed2=0&windDirection2=0&broken2=-1&visibility3=0&windSpeed3=0&windDirection3=0&broken3=-1&visibility4=0&windSpeed4=0&windDirection4=0&broken4=-1
%response
/home/httpd/html/capacity/MCO/cap_data
%stdout
Content-type: text/plain

query=[airport=MCO&active0=on&visibility0=0&windSpeed0=0&windDirection0=0&broken0=-1&active1=on&visibility1=0&windSpeed1=0&windDirection1=0&broken1=-1&visibility2=0&windSpeed2=0&windDirection2=0&broken2=-1&visibility3=0&windSpeed3=0&windDirection3=0&broken3=-1&visibility4=0&windSpeed4=0&windDirection4=0&broken4=-1]

Variables:

airport=MCO
active0=on
visibility0=0
windSpeed0=0
windDirection0=0
broken0=-1
active1=on
visibility1=0
windSpeed1=0
windDirection1=0
broken1=-1
visibility2=0
windSpeed2=0
windDirection2=0
broken2=-1
visibility3=0
windSpeed3=0
windDirection3=0
broken3=-1
visibility4=0
windSpeed4=0
windDirection4=0
broken4=-1