| Info: | Simple FastCGI wrapper for CGI scripts |
|---|---|
| Homepage: | http://nginx.localdomain.pl/wiki/FcgiWrap |
| Author: | Grzegorz Nosek <root@localdomain.pl> |
| Contributors: | W-Mark Kubacki <wmark@hurrikane.de> Jordi Mallach <jordi@debian.org> Sam Trenholme (CentOS 6 port) |
- very lightweight (84KB of private memory per instance)
- fixes broken CR/LF in headers
- handles environment in a sane way (CGI scripts get HTTP-related env. vars from FastCGI parameters and inherit all the others from
fcgiwrap's environment)- no configuration, so you can run several sites off the same
fcgiwrappool- passes CGI stderr output to
fcgiwrap's stderr or FastCGI stderr stream
Makefile script is generated by configure
fcgiwraplinks to dev-libs/fcgi ; directions for adding this to- CentOS 6 are in the file COMPILE.fcgi and there is a source code RPM for those who do not want to add the EPEL repo.
fcgiwrap also uses (but not requires) systemd for socket activation.
To install:
./configure make make install
fcgiwrap will be copied to /usr/local/sbin/fcgiwrap if you did not set
--prefix for configure or DESTDIR for the makefile.
A system startup script for CentOS 6 is included in the directory init.d/ here. Note that newer distros of Linux use systemd, which uses a different configuration format for starting daemons (services).
Most probably you will want fcgiwrap be launched by spawn-fcgi, which
is included here as the file spawn-fcgi-1.6.3-1.el6.src.rpm. Directions
for installing are in the file COMPILE.fcgi
- There are two modes of
fcgiwrapoperation: - when SCRIPT_FILENAME is set, its value is treated as the script name and executed directly.
- otherwise, DOCUMENT_ROOT and SCRIPT_NAME are concatenated and split
back again into the script name and PATH_INFO. For example, given a
DOCUMENT_ROOT of
/www/cgiand SCRIPT_NAME of/subdir/example.cgi/foobar,fcgiwrapwill execute/www/cgi/subdir/example.cgiwith PATH_INFO of/foobar(assumingexample.cgiexists and is executable).