newLISP + FCGI

Started by statik, March 06, 2006, 11:32:24 PM

Previous topic - Next topic

statik

I read a few older threads here and while newlisp + fcgi was mentioned as being used or toyed with, I never could find anything that hinted at it's success...



If someone here has successfully gotten newlisp to work with fastcgi (and lighttpd would be nice too) please let me know how you managed to do so.



Or is there any ideas how it might be accomplished?



Thanks guys.
-statik

newdep

#1
Hi Static,



What I can remember from FastCgi is that it somehow needs an extention

to the normal cgi to work with FastCgi, not sure if newlisp has this though and im also not sure what that is.. ;-)

I know that Clisp had once an FastCgi extention and that Rebol uses it too (commercial versions only)..

..Mmm...Perhpas Lutz knows..



Norman.
-- (define? (Cornflakes))

Lutz

#2
Here you find everything you need to know:  http://www.fastcgi.com/">http://www.fastcgi.com/

and here:

http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S2">http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S2



FastCGI works via a socket interface, so you would have newLISP running listening for FastCGI requests on a socket. For maximum scaleability you would run the newLISP server as an UNIX inetd process. There are examples in the newLISP manual how to configure your inetd configuration file, as an example:



# in inetd.conf
fastcgi  stream  tcp  nowait  root  /usr/bin/newlisp -c fastcgi.lsp


and in /etc/services



fastcgi        1234/tcp     # newLISP fastcgi requests


1234 would be the FastCGI port or whatever the correct number is. fastcgi.lsp would contain the logic necessary to receive and respond to FastCGI requests. Inside newLISP you would use print, println, read-line, write-line, read-buffer and write-buffer communicating to std/io (file handles 1 and 0). Which would automatically be redirected to 1234 by inetd.



I wonder if other schemes are possible without inetd, where FastCGI starts the newLISP process directly in this case newLISP would be started with the -p or -d option and a specific port, but i didn't read enough of the docs to find out. Most likely the inetd method described is the correct one.



Lutz