Page 1 of 1

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

Posted: Wed Jan 05, 2011 7:59 pm
by KDr2
http://kdr2.net/sb-fastcgi.html

It works well for me, and maybe useful for you.

Expect your advice and bug-reports :)

Thanks.

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

Posted: Sat Jan 08, 2011 1:50 pm
by Warren Wilkinson
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?

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

Posted: Sat Jan 08, 2011 2:41 pm
by vanekl
<520 /var/lib/cl>git clone https://github.com/KDr2/sb-fastcgi
Initialized empty Git repository in /var/lib/cl/sb-fastcgi/.git/
fatal: https://github.com/KDr2/sb-fastcgi/info/refs not found: did you run git update-server-info on the server?

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

Posted: Sat Jan 08, 2011 3:19 pm
by nuntius
You can't point git at the webpage itself... ;) Try this instead:

Code: Select all

# git clone git://github.com/KDr2/sb-fastcgi.git

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

Posted: Sat Jan 08, 2011 4:16 pm
by vanekl

Code: Select all

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"

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

Posted: Sun Jan 09, 2011 6:50 am
by KDr2
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

Posted: Sun Jan 09, 2011 7:11 am
by KDr2
vanekl wrote:

Code: Select all

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:

Code: Select all

(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:

Code: Select all

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