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 33is a server which implements the FastCGI Protocol to execute CGI scripts. 34FastCGI was designed to overcome the CGI protocol's scalability 35and resource sharing limitations. 36While CGI scripts need to be forked for every request, FastCGI scripts 37can be kept running and handle many HTTP requests. 38.Pp 39.Nm 40is a simple server that translates FastCGI requests to the CGI protocol. 41It executes the requested CGI script and translates its output back to the 42FastCGI protocol. 43.Pp 44Modern web frameworks and web applications usually come with the 45capability to run as FastCGI servers. 46.Nm 47is not intended for these applications. 48.Pp 49.Nm 50opens a socket at 51.Pa /var/www/run/slowcgi.sock , 52owned by www:www, 53with permissions 0660. 54It will then 55.Xr chroot 8 56to 57.Pa /var/www 58and drop privileges to user 59.Qq www . 60.Pp 61The options are as follows: 62.Bl -tag -width Ds 63.It Fl d 64Do not daemonize. 65If this option is specified, 66.Nm 67will run in the foreground and log to stderr. 68.It Fl p Ar path 69.Xr chroot 2 70to 71.Ar path . 72A 73.Ar path 74of 75.Pa / 76effectively disables the chroot. 77.It Fl s Ar socket 78Create and bind to alternative local socket at 79.Ar socket . 80.It Fl t Ar timeout 81Terminate the request after 82.Ar timeout 83seconds instead of the default 120 seconds. 84The CGI script is left to run but its standard input, output and error 85will be closed. 86.It Fl U Ar user 87Change the owner of 88.Pa /var/www/run/slowcgi.sock 89to 90.Ar user 91and its primary group instead of the default www:www. 92.It Fl u Ar user 93Drop privileges to 94.Ar user 95instead of default user www and 96.Xr chroot 8 97to 98the home directory of 99.Ar user . 100.It Fl v 101Enable 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 119The 120.Nm 121server first appeared in 122.Ox 5.4 . 123.Sh AUTHORS 124.An Florian Obser Aq Mt florian@openbsd.org 125.Sh BUGS 126.Nm 127only implements the parts of the FastCGI standard needed to execute 128CGI scripts. 129This is intentional. 130