MAN.CGI(7)

NAME
man.cgi - cgi for manpage query and display

SYNOPSIS
man.cgi

DESCRIPTION
The man.cgi script queries and displays manual pages. It interfaces with mandocdb(8) databases cached with catman(8).

To use man.cgi, create a manual cache in catman(8). Assign this directory to the environment variable CACHE_DIR, defaulting to /cache/man.cgi. Copy the man.cgi script into your CGI directory (see FILES for other relevant files).

Multiple catman(8) trees may be managed by man.cgi: directories under CACHE_DIR containing etc/catman.conf are identified as "manroots". The path of a manroot under CACHE_DIR is converted to a name by replacing path separators with spaces.

Thus, if CACHE_DIR is the default /cache/man.cgi, the web-server is jailed to /var/www, and cache subdirectories ./foo/1 and ./bar/2 contain etc/catman.conf, man.cgi will assign these to manroots "foo 1" and "bar 2", respectively. These names will appear as choices when searching for manuals.

If man.cgi finds only one manroot, or none, then the selection box is omitted. If no manroot is specified during search, the first manroot is used by default.

ENVIRONMENT

CACHE_DIR
    The absolute path of the catman(8) cache directory. This must not have a trailing slash.

CSS_DIR
    Prepended to CSS file links in outputted HTML files. This must not have a trailing slash.

FILES

etc/catman.conf
    Built by catman(8) and must exist at least once under the configuration directory root.

man.css
    Should be visible in the server document root or within CSS_DIR. Included in each page after man-cgi.css, ostensibly for mandoc(1) HTML output styling.

man.cgi.css
    Should be visible in the server document root or within CSS_DIR. Included in each page, ostensibly for general man.cgi styling.

COMPATIBILITY
The man.cgi script is call-compatible with queries from the traditional man.cgi script by Wolfram Schneider. However, the results may not be quite the same.

SEE ALSO
catman(8), mandocdb(8)

AUTHORS
The man.cgi utility was written by Kristaps Dzonsons, kristaps@bsd.lv.

CAVEATS
If you're running in a jailed web-server, make sure the /tmp directory exists and is writable. The databases may need this for scratch space.