Introduction
Table of Contents
XL supports FastCGI 1.0 specification. It does support request multiplexing over single connection at a time. It supports Responder role, and Authorizer and Filter roles are not supported, but they are planned.
lighttpd configuration
First, we must append index.xhtml to recognized index file names, in lighttpd.conf:
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm", "index.xhtml" )
And exclusion for static files...
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".xl", ".xhtml" )
And then fastcgi.servers section:
fastcgi.server = (
".xhtml" => (
"localhost" => (
"socket" => "/tmp/xli-fastcgi.socket",
"bin-path" => "/usr/bin/xli-fcgi",
"max-procs" => 1,
"check-local" => "disable"
)
)
)
Now we need to restart lighttpd.
Configuration of xli-fcgi based virtual site
When some client asks for .xhtml URL, or prefix from fastcgi.server prefix based declaration, for the first time after server is (re)started, next steps happen:
- xli-fcgi will load /index.xl from DOCUMENT_ROOT of presentation and invoke index.Main procedure, with HTTP_HOST and logWr arguments; This procedure will initialize "web server" and page handlers for URL's.
- WebServer.m3 will recognize FastCGI mode and will not start HTTP listening socket; Also, it will not accept file handler configuration, only pure page handlers.
- After initialization during first request, and for every request after that, FastCGI.ServeRequest will strip .xhtml extension (and period - total of six characters) and continue with normal request servicing. "Like nothing happened". XL page handling procedure will not "see" difference between FastCGI and standalone mode until eventually it peeks into FastCGI.ServeRequest.params.
- FastCGI.ServeRequest invokes WebServer.ServeRequest and through it configured page handlers. Page handlers directly write into FastCGIWr.T - a pseudo writer which does packeting for FCGI_STDOUT stream;
- It also sends logWr (FCGI_STDERR writer) as params.logWr to handlers; Writes to this writer are forwarded to lighttpd's errorlog.
Only .xhtml file needed in hosted space is index.xhtml and it's content is irrelevant. It's existence is how lighttpd recognizes XL hosted presentation and forwards requests for "/" URL to our FastCGI scripts.
