_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

cgiconfiguration and usage

back_to_top

This should be the first line to ensure browsers can read it:

echo "Content-type: text/html"

$ 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/

server "default" {
	...
	location "/$CGI_PATH/*" {
	fastcgi socket "/run/slowcgi.sock"
	}
}

back_to_top

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
}

back_to_top

doas slowcgi -dnvvv
Enable and start
doas rcctl enable slowcgi
doas rcctl restart slowcgi

back_to_top

back_to_top

httpd

slowcgi(8) , rcctl(8)

<cgi.oh>

back_to_top

ohazot | about | ohazot.com <admin@ohazot.com>

Created:2025-10-03|Updated:2025-10-06 OpenBSD