Blob


1 .\" $OpenBSD: slowcgi.8,v 1.17 2022/08/06 17:11:36 op Exp $
2 .\"
3 .\" Copyright (c) 2013 Florian Obser <florian@openbsd.org>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate: August 6 2022 $
18 .Dt SLOWCGI 8
19 .Os
20 .Sh NAME
21 .Nm slowcgi
22 .Nd a FastCGI to CGI wrapper server
23 .Sh SYNOPSIS
24 .Nm
25 .Op Fl dv
26 .Op Fl p Ar path
27 .Op Fl s Ar socket
28 .Op Fl t Ar timeout
29 .Op Fl U Ar user
30 .Op Fl u Ar user
31 .Sh DESCRIPTION
32 .Nm
33 is a server which implements the FastCGI Protocol to execute CGI scripts.
34 FastCGI was designed to overcome the CGI protocol's scalability
35 and resource sharing limitations.
36 While CGI scripts need to be forked for every request, FastCGI scripts
37 can be kept running and handle many HTTP requests.
38 .Pp
39 .Nm
40 is a simple server that translates FastCGI requests to the CGI protocol.
41 It executes the requested CGI script and translates its output back to the
42 FastCGI protocol.
43 .Pp
44 Modern web frameworks and web applications usually come with the
45 capability to run as FastCGI servers.
46 .Nm
47 is not intended for these applications.
48 .Pp
49 .Nm
50 opens a socket at
51 .Pa /var/www/run/slowcgi.sock ,
52 owned by www:www,
53 with permissions 0660.
54 It will then
55 .Xr chroot 8
56 to
57 .Pa /var/www
58 and drop privileges to user
59 .Qq www .
60 .Pp
61 The options are as follows:
62 .Bl -tag -width Ds
63 .It Fl d
64 Do not daemonize.
65 If this option is specified,
66 .Nm
67 will run in the foreground and log to stderr.
68 .It Fl p Ar path
69 .Xr chroot 2
70 to
71 .Ar path .
72 A
73 .Ar path
74 of
75 .Pa /
76 effectively disables the chroot.
77 .It Fl s Ar socket
78 Create and bind to alternative local socket at
79 .Ar socket .
80 .It Fl t Ar timeout
81 Terminate the request after
82 .Ar timeout
83 seconds instead of the default 120 seconds.
84 The CGI script is left to run but its standard input, output and error
85 will be closed.
86 .It Fl U Ar user
87 Change the owner of
88 .Pa /var/www/run/slowcgi.sock
89 to
90 .Ar user
91 and its primary group instead of the default www:www.
92 .It Fl u Ar user
93 Drop privileges to
94 .Ar user
95 instead of default user www and
96 .Xr chroot 8
97 to
98 the home directory of
99 .Ar user .
100 .It Fl v
101 Enable more verbose (debug) logging.
102 .El
103 .Sh SEE ALSO
104 .Xr httpd 8
105 .Sh STANDARDS
106 .Rs
107 .%A Mark R. Brown
108 .%D April 1996
109 .%T FastCGI Specification
110 .Re
111 .Pp
112 .Rs
113 .%A D. Robinson, K. Coar
114 .%D October 2004
115 .%R RFC 3875
116 .%T The Common Gateway Interface (CGI) Version 1.1
117 .Re
118 .Sh HISTORY
119 The
120 .Nm
121 server first appeared in
122 .Ox 5.4 .
123 .Sh AUTHORS
124 .An Florian Obser Aq Mt florian@openbsd.org
125 .Sh BUGS
126 .Nm
127 only implements the parts of the FastCGI standard needed to execute
128 CGI scripts.
129 This is intentional.