I'm new to apache and webserving, and I'm trying to write a web interface for some scientific hardware using a cgi script. The script netcats the hardware control protocol over the network to the hardware elsewhere in the building.
I have a test script:
echo "Mary had a little lamb" | netcat 127.0.0.1 1234
Permissions are 755, and it executes fine from the shell. In the apache error log, I have:
[client 127.0.0.1] Premature end of script headers: testscript.cgi, referer:
http://localhost/
Reading the apache manual troubleshooting guide for this error, I get to this bit:
"Even if the CGI runs fine from the command line, remember that the environment and permissions may be different when running under the web server. The CGI can only access resources allowed for the User and Group specified in your Apache configuration. In addition, the environment will not be the same as the one provided on the command line, but it can be adjusted using the directives provided by mod_env."
Ok, fine, I don't have *something* configured right. The trouble is, I don't know what that something could be. Does anyone have any ideas?