6
.Nd FastCGI server for kcgi applications
8
.\" For sections 2, 3, and 9 only.
9
.\" Not used in OpenBSD.
29
to handle FastCGI connections.
30
It can handle any FastCGI worker implementing the FastCGI v1.0
31
Specification as well as those implementing the FastCGI Extensions for
32
Management Control (see
38
By default, it opens the socket
39
.Pa /var/www/run/httpd.sock
40
in mode 0660 under the current user and group, changes to a file-system
43
daemonises and opens its system log,
44
then starts 3 workers executing
46
which must exist relative to the file-system jail root.
47
The back-log is twice the worker pool size
49
or, in the event of variable-sized pools, twice the maximum worker size
52
The arguments are as follows:
55
Do not daemonise and, in addition to syslog, print messages to standard
58
Be more verbose in output.
63
The connection backlog.
64
If this is too small, connections will be refused and cause the request
66
The operating system will usually truncate this.
68
The initial number of workers >1.
70
The maximum number of workers in a variable-sized pool.
71
By default, this is twice
74
Location of file-system jail.
75
This is mandatory: use the root directory if you insist on being
78
Use a variable-sized pool of workers.
81
be used for workers implementing the FastCGI Extensions for Management
83
The pool will be at least (and initially) size
87
with a release policy dictated by
90
Alternative socket path.
92
The user in whose name (user and group) the socket is created.
94
The user in whose name the process is dropped.
96
The amount of time in seconds a worker must be idle before being
97
released from a variable-sized pool.
98
By default, this is five minutes.
107
to the process, it will restart all workers.
109
.\" For section 9 functions only.
110
.\" .Sh IMPLEMENTATION NOTES
111
.\" Not used in OpenBSD.
113
.\" For sections 2, 3, and 9 function return values only.
115
.\" For sections 1, 6, 7, and 8 only.
119
.\" For sections 1, 6, and 8 only.
121
On OpenBSD, the default user for the web server is
123
Assuming we have a server that doesn't need any files, we can run the
124
following to keep it in a safe jail:
126
.D1 # kfcgi -u www -U www -- /fcgi-bin/prog
130
within the default file-system jail of
134
It will create the default socket
135
.Pa /var/www/run/httpd.sock
139
This can also be extended to run a variable-sized pool of workers that
140
responds to system load.
142
.D1 # kfcgi -r -n 2 -N 100 -w 10 -u www -U www -- /fcgi-bin/prog
144
This will start with only two servers, but scale it to 100 in the event
145
of a burst of communication.
146
Workers started to handle the burst will be terminated after 10 seconds.
148
.\" For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
150
.\" For sections 2, 3, 4, and 9 errno settings only.
156
.Dq FastCGI Specification ,
157
version 1.0, published 29 April 1996, for properly passing connections
159
It also implements the
160
.Lk https://kristaps.bsd.lv/kcgi/extending01.html "FastCGI Extensions for Management Control"
161
for variable-sized worker pools.
166
.\" .Sh SECURITY CONSIDERATIONS
167
.\" Not used in OpenBSD.