Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHow to use boa?
I wanna add cgi scripts to my web server (boa), I do things like this: 1.select boa in the filesystem config. 2.make a dir with the name cgi-bin in /home/httpd 3.config boa.conf: add a line :...
Altera_Forum
Honored Contributor
21 years agoHi, in order for boa to properly run an executable, the extension of the file must be changed to .cgi.
Additionally, for the executable to be run correctly, it needs to output to standard out (before outputting anything else) a "cgi header". Since a CGI program can return a myriad of document types, a CGI program must place a short header (ASCII text) on its output so that the client will know how to interpret the information it generates. Most commonly, CGI programs generate HTML, so the header that needs to be output is:Content-type: text/html\n\n Note that this header MUST include the two new lines at the end. Since the executable you are trying to run has been compiled from C source, you need to put this line in your program: printf("Content-type: text/html\n\n");