1spawn-fcgi(1) General Commands Manual spawn-fcgi(1)
2
3
4
6 spawn-fcgi - Spawns FastCGI processes
7
9 spawn-fcgi [options] [ -- <fcgiapp> [fcgi app arguments]]
10
11 spawn-fcgi -v
12
13 spawn-fcgi -h
14
16 spawn-fcgi is used to spawn remote and local FastCGI processes.
17
18 While it is obviously needed to spawn remote FastCGI backends (the web
19 server can only spawn local ones), it is recommended to spawn local
20 backends with spawn-fcgi, too.
21
22 Reasons why you may want to use spawn-fcgi instead of something else:
23
24 * Privilege separation without needing a suid-binary or running a
25 server as root.
26
27 * You can restart your web server and the FastCGI applications without
28 restarting the others.
29
30 * You can run them in different chroot()s.
31
32 * Running your FastCGI applications doesn't depend on the web server
33 you are running, which allows for easier testing of other web
34 servers.
35
37 spawn-fcgi accepts the following options:
38
39 -f <path>
40 Filename of the FastCGI application to spawn. This option is
41 deprecated and it is recommend to always specify the applica‐
42 tion (absolute path) and its parameters after "--"; the fcgiapp
43 parameter is directly used for the exec() call, while for
44 starting the binary given with -f /bin/sh is needed (which may
45 not be available in a chroot).
46
47 This option is ignored if fcgiapp is given.
48
49 -d <path>
50 Change the current directory before spawning the application.
51
52 -a <address>
53 IPv4/IPv6 address to bind to; only used if -p is given too.
54 Defaults to "0.0.0.0" (IPv4).
55
56 -p <port>
57 TCP port to bind to; you cannot combine this with the -s
58 option.
59
60 -s <path>
61 Path to the Unix domain socket to bind to; you cannot combine
62 this with the -p option.
63
64 -C <children>
65 (PHP only) Number of children to spawn by setting the
66 PHP_FCGI_CHILDREN environment variable. Default is not to over‐
67 write the environment variable; php will spawn no children if
68 the variable is not set (same as setting it to 0).
69
70 -F <children>
71 Number of children to fork, defaults to 1. This option doesn't
72 work with -n, have a look at multiwatch(1) if you want to
73 supervise multiple forks on the same socket.
74
75 -P <path>
76 Name of the PID file for spawned processes (ignored in no-fork
77 mode)
78
79 -n No forking should take place (for daemontools)
80
81 -M <mode>
82 Change file mode of the Unix domain socket; only used if -s is
83 given too.
84
85 -?, -h General usage instructions
86
87 -v Shows version information and exits
88
89 The following options are only available if you invoke spawn-fcgi as
90 root:
91
92 -c <directory>
93 Chroot to specified directory; the Unix domain socket is cre‐
94 ated inside the chroot unless -S is given.
95
96 -S Create Unix domain socket before chroot().
97
98 -u User ID to change to.
99
100 -g Group ID to change to. Defaults to primary group of the user
101 given for -u.
102
103 -U Change user of the Unix domain socket, defaults to the value of
104 -u. (only used if -s is given)
105
106 -G Change group of the Unix domain socket, defaults to the primary
107 group of the user given for -U; if -U wasn't given, defaults to
108 the value of -g. (only used if -s is given)
109
111 svc(8), supervise(8), see http://cr.yp.to/daemontools.html
112
113 multiwatch(1), see http://cgit.stbuehler.de/gitosis/multiwatch/about/
114
115
116
117 26 March 2009 spawn-fcgi(1)