1*068d93a3Sop.\" $OpenBSD: slowcgi.8,v 1.17 2022/08/06 17:11:36 op Exp $ 27ac15270Sflorian.\" 37ac15270Sflorian.\" Copyright (c) 2013 Florian Obser <florian@openbsd.org> 47ac15270Sflorian.\" 57ac15270Sflorian.\" Permission to use, copy, modify, and distribute this software for any 67ac15270Sflorian.\" purpose with or without fee is hereby granted, provided that the above 77ac15270Sflorian.\" copyright notice and this permission notice appear in all copies. 87ac15270Sflorian.\" 97ac15270Sflorian.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 107ac15270Sflorian.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 117ac15270Sflorian.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 127ac15270Sflorian.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 137ac15270Sflorian.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 147ac15270Sflorian.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 157ac15270Sflorian.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 167ac15270Sflorian.\" 17*068d93a3Sop.Dd $Mdocdate: August 6 2022 $ 187ac15270Sflorian.Dt SLOWCGI 8 197ac15270Sflorian.Os 207ac15270Sflorian.Sh NAME 217ac15270Sflorian.Nm slowcgi 227ac15270Sflorian.Nd a FastCGI to CGI wrapper server 237ac15270Sflorian.Sh SYNOPSIS 247ac15270Sflorian.Nm 25cc4a9b69Sjmc.Op Fl dv 26a3b046bcSflorian.Op Fl p Ar path 270b5ee19eSblambert.Op Fl s Ar socket 28*068d93a3Sop.Op Fl t Ar timeout 298f6f6407Sflorian.Op Fl U Ar user 30a3b046bcSflorian.Op Fl u Ar user 317ac15270Sflorian.Sh DESCRIPTION 327ac15270Sflorian.Nm 337ac15270Sflorianis a server which implements the FastCGI Protocol to execute CGI scripts. 340ece3052SflorianFastCGI was designed to overcome the CGI protocol's scalability 350ece3052Sflorianand resource sharing limitations. 360ece3052SflorianWhile CGI scripts need to be forked for every request, FastCGI scripts 370ece3052Sfloriancan be kept running and handle many HTTP requests. 380ece3052Sflorian.Pp 390ece3052Sflorian.Nm 40014389b7Sjmcis a simple server that translates FastCGI requests to the CGI protocol. 410ece3052SflorianIt executes the requested CGI script and translates its output back to the 420ece3052SflorianFastCGI protocol. 430ece3052Sflorian.Pp 440ece3052SflorianModern web frameworks and web applications usually come with the 450ece3052Sfloriancapability to run as FastCGI servers. 460ece3052Sflorian.Nm 470ece3052Sflorianis not intended for these applications. 487ac15270Sflorian.Pp 497ac15270Sflorian.Nm 507ac15270Sflorianopens a socket at 5174abb244Sflorian.Pa /var/www/run/slowcgi.sock , 52f6474c66Sflorianowned by www:www, 5322443ec5Sjmcwith permissions 0660. 54855c9853SderaadtIt will then 557ac15270Sflorian.Xr chroot 8 567ac15270Sflorianto 5734a21554Sflorian.Pa /var/www 58855c9853Sderaadtand drop privileges to user 5934a21554Sflorian.Qq www . 607ac15270Sflorian.Pp 617ac15270SflorianThe options are as follows: 627ac15270Sflorian.Bl -tag -width Ds 637ac15270Sflorian.It Fl d 647ac15270SflorianDo not daemonize. 657ac15270SflorianIf this option is specified, 667ac15270Sflorian.Nm 677ac15270Sflorianwill run in the foreground and log to stderr. 68a3b046bcSflorian.It Fl p Ar path 69a3b046bcSflorian.Xr chroot 2 70a3b046bcSflorianto 71a3b046bcSflorian.Ar path . 72a3b046bcSflorianA 73a3b046bcSflorian.Ar path 74a3b046bcSflorianof 75a3b046bcSflorian.Pa / 76a3b046bcSflorianeffectively disables the chroot. 770b5ee19eSblambert.It Fl s Ar socket 780b5ee19eSblambertCreate and bind to alternative local socket at 790b5ee19eSblambert.Ar socket . 80*068d93a3Sop.It Fl t Ar timeout 81*068d93a3SopTerminate the request after 82*068d93a3Sop.Ar timeout 83*068d93a3Sopseconds instead of the default 120 seconds. 84*068d93a3SopThe CGI script is left to run but its standard input, output and error 85*068d93a3Sopwill be closed. 868f6f6407Sflorian.It Fl U Ar user 878f6f6407SflorianChange the owner of 888f6f6407Sflorian.Pa /var/www/run/slowcgi.sock 898f6f6407Sflorianto 908f6f6407Sflorian.Ar user 918f6f6407Sflorianand its primary group instead of the default www:www. 92a3b046bcSflorian.It Fl u Ar user 93a3b046bcSflorianDrop privileges to 94a3b046bcSflorian.Ar user 95478c021aSflorianinstead of default user www and 96478c021aSflorian.Xr chroot 8 97478c021aSflorianto 98478c021aSflorianthe home directory of 99478c021aSflorian.Ar user . 10004ab3ac4Sflorian.It Fl v 10104ab3ac4SflorianEnable more verbose (debug) logging. 1027ac15270Sflorian.El 103014389b7Sjmc.Sh SEE ALSO 104014389b7Sjmc.Xr httpd 8 1057ac15270Sflorian.Sh STANDARDS 1067ac15270Sflorian.Rs 1077ac15270Sflorian.%A Mark R. Brown 1087ac15270Sflorian.%D April 1996 1097ac15270Sflorian.%T FastCGI Specification 1107ac15270Sflorian.Re 1117ac15270Sflorian.Pp 1127ac15270Sflorian.Rs 1137ac15270Sflorian.%A D. Robinson, K. Coar 1147ac15270Sflorian.%D October 2004 1157ac15270Sflorian.%R RFC 3875 1167ac15270Sflorian.%T The Common Gateway Interface (CGI) Version 1.1 1177ac15270Sflorian.Re 118f273b081Sschwarze.Sh HISTORY 119f273b081SschwarzeThe 120f273b081Sschwarze.Nm 121f273b081Sschwarzeserver first appeared in 122f273b081Sschwarze.Ox 5.4 . 123f273b081Sschwarze.Sh AUTHORS 124f273b081Sschwarze.An Florian Obser Aq Mt florian@openbsd.org 1250ece3052Sflorian.Sh BUGS 1260ece3052Sflorian.Nm 1270ece3052Sflorianonly implements the parts of the FastCGI standard needed to execute 1280ece3052SflorianCGI scripts. 1290ece3052SflorianThis is intentional. 130