FCGIWRAP(8)
β¨ FCGIWRAP β¨
okay bestie, this is the fcgiwrap page from the System Manager's Manual section 8, and it's lowkey one of the most useful little daemons ever. let's get into it π
πΈ NAME πΈ
fcgiwrap β serve CGI applications over FastCGI. that's it, that's the whole job, and it does it beautifully β¨
π¦ SYNOPSIS π¦
fcgiwrap [OPTIONS]
π DESCRIPTION π
so fcgiwrap is a simple server for running CGI applications over FastCGI. it's giving "small but mighty". it hopes to provide clean CGI support to Nginx (and honestly, to any other web servers that may need it too). no cap, it's just here to help π«Ά
π OPTIONS π
-cnumber β how manyfcgiwrapprocesses you wanna prefork. yes queen, parallelism π-fβ redirect STDERR output from the executed CGI through FastCGI so it actually shows up in the web server error log. otherwise it would get returned onfcgiwrap's own STDERR, which could be redirected (π bye bye, output). and if you're running throughspawn-fcgi,fcgiwrap's STDERR is sent to/dev/null, so this option is literally the way to get that output back. iconic rescue mission π¦Έ-ssocket_url β a URL for the listen socket to bind to. by defaultfcgiwrapexpects a listen socket to be passed on file descriptor0, matching the FastCGI convention. the recommended way to deployfcgiwrapis to run it under a process manager that takes care of opening the socket for you (very main character energy, letting someone else handle the socket). however, for simple configurations and one-off tests, this option may be used. valid *socket_url*s includeunix:/path/to/unix/socket,tcp:dot.ted.qu.ad:portandtcp6:[ipv6_addr]:portβ-hβ show a help message and exit. a little "hi, here's what I do" moment π
π ENVIRONMENT π
when it's running, fcgiwrap evaluates these environment variables, set by the web server calling an fcgi-script. the variables DOCUMENT_ROOT and SCRIPT_NAME will be concatenated, and the resulting executable gets run as a CGI script wrapped as FastCGI, with the remainder after the script name available as PATH_INFO. to disable PATH_INFO mangling, set up your web server to pass SCRIPT_FILENAME, which should contain the complete path to the script. then PATH_INFO will not be modified. periodt. π₯
DOCUMENT_ROOTβ directory which the script resides inSCRIPT_NAMEβ actual executableSCRIPT_FILENAMEβ complete path to CGI script. when set, overridesDOCUMENT_ROOTandSCRIPT_NAMENO_BUFFERINGβ when set (e.g., to""), disables output buffering
π§ EXAMPLE π§
the fastest way to see fcgiwrap do something is to launch it at the command line like this:
fcgiwrap -s unix:/var/run/fcgiwrap.sock
apart from potential permission problems etc., it should be ready to accept FastCGI requests and run CGI scripts. slay π
most probably you will want to launch fcgiwrap by spawn-fcgi using a configuration like this:
FCGI_SOCKET=/var/run/fcgiwrap.sock
FCGI_PROGRAM=/usr/sbin/fcgiwrap
FCGI_USER=nginx
FCGI_GROUP=www
FCGI_EXTRA_OPTIONS="-M 0700"
ALLOWED_ENV="PATH"
Nginx can be configured to have the arbitrary CGI cgit run as FastCGI as follows:
location / {
fastcgi_param DOCUMENT_ROOT /var/www/localhost/htdocs/cgit/;
fastcgi_param SCRIPT_NAME cgit;
fastcgi_pass unix:/var/run/fastcgi.sock;
}
π AUTHOR π
fcgiwrap was written by Grzegorz Nosek <root@localdomain.pl> with contributions by W-Mark Kubacki <wmark@hurrikane.de>. absolute legends π«Ά
this manual page was written by Jordi Mallach <jordi@debian.org> (with contributions by Grzegorz Nosek) for the Debian project (and may be used by others). iykyk π
and that's the whole vibe check, bestie β this page is from Jun 3, 2010, manual section FCGIWRAP(8), straight out of the System Manager's Manual. go forth and serve some CGI πβ¨ππ¦
π¦ where this page comes from
- alpine 3.22: fcgiwrap-doc 1.1.0-r8 Β· MIT
- alpine 3.23: fcgiwrap-doc 1.1.0-r9 Β· MIT
- alpine 3.24: fcgiwrap-doc 1.1.0-r9 Β· MIT
- debian bookworm: fcgiwrap 1.1.0-14+deb12u1 Β· MIT
- debian trixie: fcgiwrap 1.1.0-16 Β· MIT
- ubuntu jammy: fcgiwrap 1.1.0-12 Β· MIT
- ubuntu noble: fcgiwrap 1.1.0-14build1 Β· MIT
- ubuntu questing: fcgiwrap 1.1.0-16build1
- ubuntu resolute: fcgiwrap 1.1.0-16build3 Β· MIT
- ubuntu stonking: fcgiwrap 1.1.0-17 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms