(see also my other gauche-bindings)
You also need mod_fastcgi (apache module) and fcgi (FCGI server library)
Side note: I extended slightly mod_fastcgi to allow Custom-response: How do I use it?
(format oport "Status: 403\n") (format oport "Custom-response: 403#~a\n" url)
mod_fastCGI enables 3 modes of cooperation between the Apache server, and the FCGI server: static, dynamic, or external.
My extension of gauche-fastcgi was aimed at enabling the 3rd mode. In this configuration Apache & gauche server are independent, connected by a master socket.
So, ther standalone gauche server needs to construct the master socket:
(fcgx-init) (let1 socket (fcgx-open-socket port backlog) ; see man listen(2) for backlog ....For use with the socket, the C library provides multi-thread ready functions:
(let1 request (fcgx-prepare-request socket flags)
(fcgx-accept-r request) ;; more threads can invoke it,
;; only one will return for 1 request arrived.
....
(fcgx-set-status request 200)
(fcgx-finish-r request))
fcgx-accept-r makes scheme ports out of the sockets associated with the FCGX_Request, and constructs a hash table for the Environment of the FCGX_Request, it copies the strings!
The best documentation on the C library fcgi is file:///usr/include/fcgiapp.h, in man pages you only have:
I want to warn that these low level applicatoins are almost not used. My main application is (adapted) Kahua.
version 0.1, not multithreaded, provides 2 hi-level calls:
(proc input output error env) ;
and
I provide:
Quoting external
The FastCgiExternalServer directive defines filename as an external FastCGI application. If filename does not begin with a slash (/) then it is assumed to be relative to the ServerRoot. The filename does not have to exist in the local filesystem. URIs that Apache resolves to this filename will be handled by this external FastCGI application..
# <IFModule mod_fastcgi.c> FastCgiExternalServer /var/www/localhost/cgi-gauche/agenzia/virtual -host linux11:19999 -appConnTimeout 120 -idle-timeout 120 #</IfModule>
And now the useful:
<Directory /var/www/localhost/cgi-gauche/agenzia>
AllowOverride All
SetHandler fastcgi-script
# mod_perl used Access handler!
FastCgiAccessChecker /var/www/localhost/cgi-gauche/agenzia/virtual
# FastCgiAccessChecker /var/www/localhost/cgi-gauche/agenzia/access.scm
FastCgiAccessCheckerAuthoritative On
Options ExecCGI FollowSymLinks
# fast cgi does not support Custom failure responses!
ErrorDocument 403 http://maruska.dyndns.org/login
ErrorDocument 303 http://maruska.dyndns.org/login?ahoj
# Allow:
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
example multi-threaded script: http://maruska.dyndns.org/comp/activity/gauche/cgi/server.scm
FastCgiConfig -autoUpdate
<Directory /var/www/localhost/cgi-gauche>
AllowOverride All
SetHandler fastcgi-script
Options ExecCGI FollowSymLinks
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
passing file descriptors between processes!
does the message have to be of non-zero lenght?
what needs to be passed over?
was getting translated to: PATH_INFO = /edit-ticket