|Source:||http://git.xnull.de/cgit/mod_fastcgi_handler/ (also on github)|
mod_fastcgi_handler is a very simple FastCGI implementation derived from mod_fastcgi and mod_proxy_fcgi. mod_fastcgi_handler does not implement a process manager, nor does it support Authenticator and Authorizer roles. mod_fastcgi_handler is a module for rapidly deploying FastCGI applications with Apache.
mod_fastcgi and mod_fcgid both include a huge process manager code, which is not needed with a typical FastCGI application. Such applications, including Django and PHP-FPM, ship their own process manager and provide a socket to communication with the web server. Thus a simple mechanism for talking to this socket is required. While mod_fastcgi and mod_proxy_fcgi both provide such a feature, the former has a quite complex configuration syntax while the latter does not support unix domain sockets.
The solution is to provide simple handler for external FastCGI applications.
To compile and install this module, use
apxs provided by the apache
apxs -i -a -o mod_fastcgi_handler.so -c *.c
mod_fastcgi_handler provides a handler that can be activated by using the
SetHandler directives. To use mod_fastcgi_handler with
PHP-FPM add the following option to your httpd.conf:
AddHandler fcgi:/var/run/php-fpm.socket .php
To use mod_fastcgi_handler with a Django FastCGI application running on port 3000:
<Location /> SetHandler fcgi:127.0.0.1:3000 </Location>
mod_fastcgi_handler is beta-quality software. It has not been widely tested, and some production-critical features, like non-blocking sockets and timeouts have not yet been implemented.