CGI ought to be the simplest protocol ever, you should get this running fast. Check:

 * Try to run your app individually as to doublecheck that it outputs the right thing (=right function)
 * Try another CGI app as to doublecheck your app outputs the same thing as the other app (=ensure sufficient protocol conformance for this one)
 * Check so that you output the right type of newline expected by the caller and output by the test app, check with a hex editor - \n only or \r\n ? (=")
 * Insert a force-output call somewhere maybe
 * Make it log its executions to some file so you know it actually got run and how far

When it spins, let the ml know how you got it there

2011/12/13 Eduardo Costa <edu500ac@yahoo.com>
I need to use Scheme or Common Lisp for writing CGI scripts to process the XSL/XML protocols of a law firm. I started with Stalin, since it is easier to compile. The resulting exec files work perfectly well, and have small foot prints. However, the Stalin community does not seem to be very active. Besides this, Stalin is very slow to compile, and does not provide an interpreter. Therefore, I decided to switch to Gambit, Bigloo or SBCL. 

Gambit has the advantage of providing native infix notation. However, it is not working in most commercial servers that the law firm uses. I am using the following command line to create the exec files:

$ ./gsc -exe gambtest.scm

Where gambtest.scm contains the following lines:

(display "Content-type: text/html")
(newline)
(newline)
(display 
"<html>
  <body>
   <h1>Hello from Gambit</h1>
  </body>
</html>" )
(newline)

It generates an executable file that works perfectly well in my machine, but not in the servers that host the pages of the law firm. 

$ ./gambtest 
Content-type: text/html

<html>
  <body>
   <h1>Hello from Gambit</h1>
  </body>
</html>

For reasons that I cannot fathom, the law firm uses many hosting providers. I also tried to use Gambit as a scripting language. The result is the same.  In the case of Bigloo, the problem lies in the fact that it uses dynamic libraries incompatible with the server.  I cannot understand why this happens, since Stalin works even when linked to dynamic libraries. By the way, I prefer the scripting solution, since the static exec files are very large.

I installed gambit in the hosting provider, making sure that both gsi and gsi-script have permission to execute. I also tested the scripts with Dorai Sitaram's Scheme in Common Lisp to make sure that everything is working fine.  Here is the script (that works in my machine):

#! ./gsi-script -:d-

(display "Content-type: text/html")
(newline)
(newline)
(display 
"<html>
  <body>
   <h1>Hello from Gambit</h1>
  </body>
</html>" )
(newline)


Here is the message that I get from Hostgator both for the scripting version and the compiled version:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@advogadosmg.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 mod_fcgid/2.3.6 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 Server at advogadosmg.org Port 80



_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list