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
   Â