+-----------------------------------------------------------------------
| Running mapserver on OpenBSD
+-----------------------------------------------------------------------

If you plan to use mapserv CGI with a chrooted web server, make sure to
copy the libs needed by mapserv binary from /usr/local/lib, but also
the projection definitions from libgeotiff and proj packages to the
chroot:

# mkdir -p /var/www/usr/local/share/{epsg_csv,proj}
# cp /usr/local/share/epsg_csv/* /var/www/usr/local/share/epsg_csv
# cp /usr/local/share/proj/* /var/www/usr/local/share/proj

If you would like to use FastCGI with nginx, use the provided rc.d(8)
script to start a spawn-fcgi process and add the following lines to you nginx.conf:

	location /cgi-bin/mapserv {
		fastcgi_pass  unix:run/mapserv.sock;
		fastcgi_split_path_info		^(/cgi-bin/mapserv)(.*)$; # split path for ogcapi support
		fastcgi_param SCRIPT_FILENAME	$fastcgi_script_name;
		fastcgi_param PATH_INFO		$fastcgi_path_info;
		include fastcgi_params;
	}

Doing so, make sure /var is mounted with dev option, otherwise spawn-fcgi will
fail opening /dev/null in the chroot.

Another option is to use sysutils/supervisor to start a FastCGI process
pool, using this configuration snippet in /etc/supervisord.d/mapserv.ini:

[fcgi-program:mapserv]
command=/var/www/cgi-bin/mapserv
socket=unix:///var/www/run/%(program_name)s.sock
socket_owner=www
socket_mode=0700
process_name=%(process_num)02d
numprocs=5
user=www
