.Dd Created:$Mdocdate$ .Dt ohazot_cgi .Tg back_to_top .Bd -literal -compact _ _ ___ | |__ __ _ _______ | |_ / _ \\| '_ \\ / _` |_ / _ \\| __| | (_) | | | | (_| |/ / (_) | |_ \\___/|_| |_|\\__,_/___\\___/ \\__| .Ed .Tg menu .Bl -column ".Sy ohazot " ".Sy ohazot " ".Sy ohazot " .It Xr ohazot oh Ta | .Xr docs oh Ta | .Xr about oh Ta .El .Dd Created:2025-10-03|Updated:2025-10-06 .Dt ohazot_cgi .Os OpenBSD .Nm cgi .Nd configuration and usage .Sh CGI .Sx back_to_top This should be the first line to ensure browsers can read it: .Bd -literal -compact echo "Content-type: text/html" .Ed .Bl -compact .It copy binaries to /var/www/bin/ .It copy dependencies to the corresponding structures in /var/www .El .Ss example .Bd -literal -compact $ whereis grep /usr/bin/grep $ ldd /usr/bin/grep Start End Type Open Ref GrpRef Name 0000030be12e4000 0000030be12ef000 exe 1 0 0 /usr/bin/grep 0000030e32295000 0000030e322b3000 rlib 0 1 0 /usr/lib/libz.so.6.0 0000030eb72e8000 0000030eb73dd000 rlib 0 1 0 /usr/lib/libc.so.96.1 0000030de67ed000 0000030de67ed000 ld.so 0 1 0 /usr/libexec/ld.so $ cp /usr/lib/libz.so.6.0 /var/www/usr/lib/ $ cp /usr/libexec/ld.so /var/www/usr/libexec/ .Ed .Ss httpd.conf .Bd -literal -compact server "default" { ... location "/$CGI_PATH/*" { fastcgi socket "/run/slowcgi.sock" } } .Ed .Sh EXAMPLE .Sx back_to_top .Bd -literal -compact server "default" { listen on * port 80 root "/htdocs/$DIR" location "/$CGI_PATH/*" { fastcgi socket "/run/slowcgi.sock" } #curl access location "/:*" { root "/htdocs/ohazot/repo" fastcgi { param SCRIPT_FILENAME "$CGI_PATH/$SCRIPT"} } location "/$LOCATION/*" { directory auto index } errdocs "$ERRORS_DIR" } types { text/css css text/html html text/plain txt oh sh awk bc } .Ed .Sh SERVICES .Sx back_to_top .Dl doas slowcgi -dnvvv Enable and start .Bd -literal -compact doas rcctl enable slowcgi doas rcctl restart slowcgi .Ed .Sh TODO .Sx back_to_top .Bl -bullet -compact .It Review and add example. .El .Sh SEE ALSO .Sx back_to_top .Xr httpd oh .Ss OpenBSD manpages .Xr slowcgi 8 , .Xr rcctl 8 .Ss files .In cgi.oh .Sh AUTHORS .Sx back_to_top .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com