SHTTPD & mini_httpd CGI problem..

Alexandros Stergiakis alsterg at freemail.gr
Tue Sep 27 23:21:44 UTC 2005


Hi,

working with buildroot (actually AspisOS), I encountered the following 
problem:

Both shttpd and mini_httpd (although cleanly compiled) fail to serve cgi 
pages.

shttpd responds with:

500 Bad headers sent:
""

whereas mini_httpd with:

500 Internal Error
Something unexpected went wrong running a CGI program.

I think the cause is the same. There is no apparent reason for this 
failure. This problem arrises both in normal and SSL (port 443) mode. 
Could uclibc be responsible for this?

The cgi shell scripts are as simple as:

#!/bin/sh
echo "Content-Type: text/html"
echo;echo
echo "<html><title></title><body>Hello World!</body></html>"

or

#!/bin/sh
echo "HTTP/1.1 200 OK"
echo "Content-Type: text/html"
echo -e "\n\n"

Components:
uclibc version: 0.9.28
busybox version: 1.00
shttpd version: 1.26
mini_httpd version: 1.19

I've also tried boa and I get back

502 Bad Gateway
The CGI was not CGI/1.1 compliant.

boa error log:

[27/Sep/2005:22:53:15 +0000] boa: server version Boa/0.94.14rc20
[27/Sep/2005:22:53:15 +0000] boa: server built Sep 27 2005 at 21:40:45.
[27/Sep/2005:22:53:15 +0000] boa: starting server pid=9734, port 80
10.143.200.2 - - [27/Sep/2005:22:53:22 +0000] request "GET /favicon.ico 
HTTP/1.1" ("/var/www/favicon.ico"): document open: No such file or directory
10.143.200.2 - - [27/Sep/2005:22:53:23 +0000] request "GET /index.cgi 
HTTP/1.1" ("./index.cgi"): Unable to execve/execl pathname: 
"./index.cgi"Exec format error10.143.200.2 - - [27/Sep/2005:22:53:23 
+0000] request "GET /index.cgi HTTP/1.1" ("/var/www/index.cgi"): 
cgi_header: unable to find LFLF
10.143.200.2 - - [27/Sep/2005:22:53:23 +0000] request "GET /favicon.ico 
HTTP/1.1" ("/var/www/favicon.ico"): document open: No such file or directory

According to boa's source code, it seems like it doesn't recognize a 
\n\n sequence, but I'm pretty sure that there is.

For for bothering if it's something trivial or irrelevant to uclibc.

regards,
  al_ex

____________________________________________________________________
http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
http://www.freemail.gr - free email service for the Greek-speaking.



More information about the uClibc mailing list