FastCGI and CLISP - clarification on a few aspects ?

C Habs <[email protected]> Fri, 11 May 2018 15:06:11 +0100
Newsgroups gmane.lisp.clisp.general
Message-ID <CANe8y8b2cCCyb_KX0X8B9QKVtnCucutyNQ0QUg5pnre9JrHQQw@mail.gmail.com>
Hello clisp-list

I ramble a bit, but please bear with me.

I suppose I am asking for little bit of assistance/clarification in
understanding CLISP implementation of FastCGI, of which I have done a fair
bit (in terms of time) of searching and reading.

One particular piece of hooking up CLISP was here -->
https://www.phillipstreet.com/2013/01/dipping-my-toes-into-lisp-getting-common-lisp-with-fastcgi-support-working-with-apache/

I was still unclear though on some aspects.

Let me explain an expectation, as naive as it may be:  in a [plain] CGI
context, I would expect it possible to have 1..n CLISP
apps/programs/scripts doing various things, perhaps all with an extension
of '.lisp' under a directory of cgi-bin on a webserver.

On receiving a request e.g https://myserver/cgi-bin/example1.lisp, the
server would return whatever was the output of the example1 script (or any
of the others that may get called).

Each script file might be something along the lines of:
-----
#!/usr/bin/clisp -K base -m 10M

(some lisp forms to evaluate and return some plain text, or html, or
whatever)
-----

I have succeeded to an extent in creating and operating this 'expectation'
on thttpd and lighttpd.


The point being, that I just drop each lisp script in the cgi-bin folder
and call which ever using a url and that's it as such.

Now when it comes to FastCGI and please correct me if I am wrong, this way
of working changes. What is required is a separately [from the webserver]
and persistently running CLISP FastCGI process and one that the webserver
communicates with using sockets.

There is example code here of a CLISP 'program' -->
https://clisp.sourceforge.io/impnotes/fastcgi.html#fcgi-example

On a server, e.g. lighttpd (as thttpd only has standard CGI), a fastcgi
config option for calling fastcgi 'programs' would detail the url 'path' to
be used to invoke a connection to the CLISP Fastcgi process, the socket to
use for the connection and the 'binary' itself e.g. the CLISP fastcgi
enabled program.

Where I need clarification/assistance, thinking back to the 1..n standard
CGI scripts in a cgi-bin setup, does each CLISP CGI script in cgi-bin, need
converting to a CLISP FastCGI program as in the linked example code, where
each will then require starting up to run persistently before it can be
called by the webserver ?

This would then require a configuration setting for *each* program in the
webserver (path, socket, program name etc), yes ?

It seems not so simple/flexible for want of better words, compared to just
dropping a script with a .cgi extension in a cgi-bin. I think some of my
confusion is from reading about FastCGI PHP scripts/programs,  where PHP
appears to have an inbuilt FASTCGI 'lauching' (my description) program
built in that can run any script with a .php extension...but maybe I've got
that wrong.


Any helpful comments gratefully received.

Thank you
Habs
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list