1FCGIWRAP(8) System Manager's Manual FCGIWRAP(8)
2
3
4
6 fcgiwrap - serve CGI applications over FastCGI
7
9 fcgiwrap [OPTIONS]
10
11
13 fcgiwrap is a simple server for running CGI applications over FastCGI.
14 It hopes to provide clean CGI support to Nginx (and other web servers
15 that may need it).
16
17
19 -c number
20 Number of fcgiwrap processes to prefork.
21
22 -f Redirect STDERR output from executed CGI through FastCGI so it
23 shows in the web server error log. Otherwise it would be
24 returned on fcgiwrap's STDERR, which could be redirected. If
25 running through spawn-fcgi, fcgiwrap's STDERR is sent to
26 /dev/null, so this option provides a way to get that output
27 back.
28
29 -s socket_url
30 A URL for the listen socket to bind to. By default fcgiwrap
31 expects a listen socket to be passed on file descriptor 0,
32 matching the FastCGI convention. The recommended way to deploy
33 fcgiwrap is to run it under a process manager that takes care of
34 opening the socket. However, for simple configurations and one-
35 off tests this option may be used. Valid socket_urls include
36 unix:/path/to/unix/socket, tcp:dot.ted.qu.ad:port and
37 tcp6:[ipv6_addr]:port.
38
39 -h Show a help message and exit.
40
41
43 When running, fcgiwrap evaluates these environment variables set by the
44 web server calling an fcgi-script. The variables DOCUMENT_ROOT and
45 SCRIPT_NAME will be concatenated and the resulting executable run as
46 CGI script wrapped as FastCGI, with the remainder after the script name
47 available as PATH_INFO. To disable PATH_INFO mangling, set up your web
48 server to pass SCRIPT_FILENAME, which should contain the complete path
49 to the script. Then PATH_INFO will not be modified.
50
51 DOCUMENT_ROOT
52 directory which the script resides in
53 SCRIPT_NAME
54 actual executable
55 SCRIPT_FILENAME
56 complete path to CGI script. When set, overrides DOCUMENT_ROOT
57 and SCRIPT_NAME
58 FCGI_CHDIR
59 By default fcgiwrap changes to the directory containing the CGI
60 script before executing it (per CGI spec). You may override
61 this behaviour by passing FCGI_CHDIR containing the script's
62 expected working directory or - to skip the directory change
63 completely.
64
65
67 The fastest way to see fcgiwrap do something is to launch it at the
68 command line like this:
69 fcgiwrap -s unix:/var/run/fcgiwrap.sock
70 Apart from potential permission problems etc., it should be ready to
71 accept FastCGI requests and run CGI scripts.
72
73 Most probably you will want to launch fcgiwrap by spawn-fcgi using a
74 configuration like this:
75
76 FCGI_SOCKET=/var/run/fcgiwrap.sock
77 FCGI_PROGRAM=/usr/sbin/fcgiwrap
78 FCGI_USER=nginx
79 FCGI_GROUP=www
80 FCGI_EXTRA_OPTIONS="-M 0700"
81 ALLOWED_ENV="PATH"
82
83 Nginx can be configured to have the arbitrary CGI cgit run as FastCGI
84 as follows:
85
86 location / {
87 fastcgi_param DOCUMENT_ROOT /var/www/localhost/htdocs/cgit/;
88 fastcgi_param SCRIPT_NAME cgit;
89 fastcgi_pass unix:/var/run/fastcgi.sock;
90 }
91
92
94 fcgiwrap was written by Grzegorz Nosek <root@localdomain.pl> with con‐
95 tributions by W-Mark Kubacki <wmark@hurrikane.de>.
96
97 This manual page was written by Jordi Mallach <jordi@debian.org> (with
98 contributions by Grzegorz Nosek) for the Debian project (and may be
99 used by others).
100
101
102
103 Jun 3, 2010 FCGIWRAP(8)