This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

I just release a fastcgi toolkit (sb-fastcgi) for SBCL

7 posts · 2077 views

Re: I just release a fastcgi toolkit (sb-fastcgi) for SBCL

I haven't had time to look right yet, but how does it compare to using mod-lisp? I'm guessing more portable to other web servers --- would it be faster? mod-lisp has really easy communication -- is this harder or simpler?
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.

Re: I just release a fastcgi toolkit (sb-fastcgi) for SBCL

You can't point git at the webpage itself... ;) Try this instead:
# git clone git://github.com/KDr2/sb-fastcgi.git

Re: I just release a fastcgi toolkit (sb-fastcgi) for SBCL

TEST> (sb-fastcgi:load-libfcgi "/usr/lib/libfcgi.so.0")
T
TEST> (defun simple-app (req)
  (let ((c (format nil "Content-Type: text/plain

Hello, I am a fcgi-program using Common-Lisp")))
    (sb-fastcgi:fcgx-puts req c)))

; compiling (SB-FASTCGI:SIMPLE-SERVER (FUNCTION SIMPLE-APP))SIMPLE-APP
TEST> (defun run-app-0 ()
  (sb-fastcgi:simple-server #'simple-app))

RUN-APP-0
TEST> (run-app-0)
"ACCEPT ERROR"

Last edited by nuntius on , edited 1 time in total. Reason: add code tag

Re: I just release a fastcgi toolkit (sb-fastcgi) for SBCL

Warren Wilkinson wrote: I'm guessing more portable to other web servers
Yes, it's more portable to other web servers, it can run on apache/nginx/lighttpd and all other web-servers support fastcgi,
while mod_lisp only runs with apache.

Warren Wilkinson wrote: would it be faster?
You can refer to http://fastcgi.com, but I think, is it faster depends on you app-implementation, and to the same app runs
on apache, using mod_lisp or using sb-fastcgi makes nearly no diffrence, but you can run manay fastcgi processes as the
backend/upstream of the web-server, in this mode fastcgi may perform better.

Warren Wilkinson wrote: mod-lisp has really easy communication -- is this harder or simpler?
It's simpler, I provider WSGI-LIKE API in it, which is easy to use.

Re: I just release a fastcgi toolkit (sb-fastcgi) for SBCL

vanekl wrote:
TEST> (defun run-app-0 ()
  (sb-fastcgi:simple-server #'simple-app))

RUN-APP-0
TEST> (run-app-0)
"ACCEPT ERROR"
The simple-server use the file-descriptor *stdin* as a server-socket(a listening socket),
so you would not run it directly, you should invoke it from apache's mod_fcgi or use spawn-fcgi: http://redmine.lighttpd.net/projects/spawn-fcgi

Or you can use the socket-server which can listen/accpet on a [inet-addr:port]-socket or a unix-domain-socket, then put a webserver on the front,
e.g:
(sb-fastcgi:socket-server #'simple-app
   :inet-addr "0.0.0.0"
   :port 9000)
will listens on 0.0.0.0:9000

then in your conf file of nginx, you may write lines like below:

location / {
          include fastcgi_params;
          fastcgi_pass 127.0.0.1:9000;
          }
More info about how to run a fastcgi-app on the webservers you can see :
http://www.fastcgi.com/drupal/?q=node/3