#include <stdio.h>
int main(void) {
printf("Content-Type: text/plain;charset=us-ascii\n\n");
printf("Hello world\n\n");
return 0;
}
gcc -o hello_cgi.cgi hello_cgi.c
matingball@zeno:~/public_html/cgi-bin$ hello_cgi.cgi
Content-Type: text/plain;charset=us-ascii
Hello world
I found a project on Google code that I want to test (a browser-based interactive fiction game player). It uses a server CGI compiled from C and an ajax-based client in the browser. The project is here: http://code.google.com/p/iffy/.
I followed the install instructions, but it seems like the CGI doesn't work (the server just isn't serving the game). I don't really know how to troubleshoot this as there's no error or log messages I can look at to see what may be going wrong. I'm pretty sure the CGI is executable by the webserver as I've chmod'ed permissions, and Zeno the site admin set up a cgi-bin to run the CGI from.
I can alter the CGI source, but I don't really know where to start. Is there any way to enable some kind of debugging on this thing? Any pointers?