Lists all of the journal entries for the day.

Thu, 11 Jan 2024

6:05 PM - Setting up mandoc man.cgi on MidnightBSD

Mandoc (mdocml) includes a man.cgi(8) script to display man pages. Here's a quick and dirty explanation on how to set it up.

  • mport install mdocml

  • Files will be installed in /usr/local/www/mdocml/

  • Configure apache

  • Configure man directory

create a directory /man on your file system. This is the default path.

in it, create a file called manpath.conf

it should have a RELATIVE path for one or more directories (per line) that you want to index.

so /man/midnightbsd-3.1

copy the man1, man2, and so on folders from /usr/share/man for your release.

extract all of then with gunzip

run makewhatis -a . from the /man/midnightbsd-3.1 folder. This will create your mandoc.db file.

Apache config

<VirtualHost *:80>
Protocols h2c http/1.1
H2Direct on
DocumentRoot /usr/local/www/mdocml/htdocs/
ServerName man.midnightbsd.org
ErrorLog /var/log/man.midnightbsd.org-error_log
CustomLog /var/log/man.midnightbsd.org-access_log combinedio
RedirectMatch ^/$ /cgi-bin/man.cgi
<Directory /usr/local/www/mdocml/>
DirectoryIndex man.cgi index.html
Require all granted

ScriptAlias /cgi-bin/ "/usr/local/www/mdocml/cgi-bin/"
<Location "/cgi-bin/man.cgi">
Options +ExecCGI
SetHandler cgi-script

()