1*0a6a1f1dSLionel Sambuc.Dd July 13, 2013 292395e9cSLionel Sambuc.Dt MAN.CGI 7 392395e9cSLionel Sambuc.Os 492395e9cSLionel Sambuc.Sh NAME 592395e9cSLionel Sambuc.Nm man.cgi 692395e9cSLionel Sambuc.Nd cgi for manpage query and display 792395e9cSLionel Sambuc.Sh SYNOPSIS 892395e9cSLionel Sambuc.Nm 992395e9cSLionel Sambuc.Sh DESCRIPTION 1092395e9cSLionel SambucThe 1192395e9cSLionel Sambuc.Nm 1292395e9cSLionel Sambucscript queries and displays manual pages. 1392395e9cSLionel SambucIt interfaces with 1492395e9cSLionel Sambuc.Xr mandocdb 8 1592395e9cSLionel Sambucdatabases cached with 1692395e9cSLionel Sambuc.Xr catman 8 . 1792395e9cSLionel Sambuc.Pp 1892395e9cSLionel SambucTo use 1992395e9cSLionel Sambuc.Nm , 2092395e9cSLionel Sambuccreate a manual cache in 2192395e9cSLionel Sambuc.Xr catman 8 . 2292395e9cSLionel SambucAssign this directory to the environment variable 2392395e9cSLionel Sambuc.Ev CACHE_DIR , 2492395e9cSLionel Sambucdefaulting to 2592395e9cSLionel Sambuc.Pa /cache/man.cgi . 2692395e9cSLionel SambucCopy the 2792395e9cSLionel Sambuc.Pa man.cgi 2892395e9cSLionel Sambucscript into your CGI directory (see 2992395e9cSLionel Sambuc.Sx FILES 3092395e9cSLionel Sambucfor other relevant files). 3192395e9cSLionel Sambuc.Pp 3292395e9cSLionel SambucMultiple 3392395e9cSLionel Sambuc.Xr catman 8 3492395e9cSLionel Sambuctrees may be managed by 3592395e9cSLionel Sambuc.Nm : 3692395e9cSLionel Sambucdirectories under 3792395e9cSLionel Sambuc.Ev CACHE_DIR 3892395e9cSLionel Sambuccontaining 3992395e9cSLionel Sambuc.Pa etc/catman.conf 4092395e9cSLionel Sambucare identified as 4192395e9cSLionel Sambuc.Qq manroots . 4292395e9cSLionel SambucThe path of a manroot under 4392395e9cSLionel Sambuc.Ev CACHE_DIR 4492395e9cSLionel Sambucis converted to a name by replacing path separators with spaces. 4592395e9cSLionel Sambuc.Pp 4692395e9cSLionel SambucThus, if 4792395e9cSLionel Sambuc.Ev CACHE_DIR 4892395e9cSLionel Sambucis the default 4992395e9cSLionel Sambuc.Pa /cache/man.cgi , 5092395e9cSLionel Sambucthe web-server is jailed to 5192395e9cSLionel Sambuc.Pa /var/www , 5292395e9cSLionel Sambucand cache subdirectories 5392395e9cSLionel Sambuc.Pa ./foo/1 5492395e9cSLionel Sambucand 5592395e9cSLionel Sambuc.Pa ./bar/2 5692395e9cSLionel Sambuccontain 5792395e9cSLionel Sambuc.Pa etc/catman.conf , 5892395e9cSLionel Sambuc.Nm 5992395e9cSLionel Sambucwill assign these to manroots 6092395e9cSLionel Sambuc.Qq foo 1 6192395e9cSLionel Sambucand 6292395e9cSLionel Sambuc.Qq bar 2 , 6392395e9cSLionel Sambucrespectively. 6492395e9cSLionel SambucThese names will appear as choices when searching for manuals. 6592395e9cSLionel Sambuc.Pp 6692395e9cSLionel SambucIf 6792395e9cSLionel Sambuc.Nm 6892395e9cSLionel Sambucfinds only one manroot, or none, then the selection box is omitted. 6992395e9cSLionel SambucIf no manroot is specified during search, the first manroot is used by 7092395e9cSLionel Sambucdefault. 7192395e9cSLionel Sambuc.Sh ENVIRONMENT 7292395e9cSLionel Sambuc.Bl -tag -width Ds 7392395e9cSLionel Sambuc.It Ev CACHE_DIR 7492395e9cSLionel SambucThe absolute path of the 7592395e9cSLionel Sambuc.Xr catman 8 7692395e9cSLionel Sambuccache directory. 7792395e9cSLionel SambucThis must not have a trailing slash. 7892395e9cSLionel Sambuc.It Ev CSS_DIR 7992395e9cSLionel SambucPrepended to CSS file links in outputted HTML files. 8092395e9cSLionel SambucThis must not have a trailing slash. 8192395e9cSLionel Sambuc.El 8292395e9cSLionel Sambuc.Sh FILES 8392395e9cSLionel Sambuc.Bl -tag -width Ds 8492395e9cSLionel Sambuc.It Pa etc/catman.conf 8592395e9cSLionel SambucBuilt by 8692395e9cSLionel Sambuc.Xr catman 8 8792395e9cSLionel Sambucand must exist at least once under the configuration directory root. 8892395e9cSLionel Sambuc.It Pa man.css 8992395e9cSLionel SambucShould be visible in the server document root or within 9092395e9cSLionel Sambuc.Ev CSS_DIR . 9192395e9cSLionel SambucIncluded in each page after 9292395e9cSLionel Sambuc.Pa man-cgi.css , 9392395e9cSLionel Sambucostensibly for 9492395e9cSLionel Sambuc.Xr mandoc 1 9592395e9cSLionel SambucHTML output styling. 9692395e9cSLionel Sambuc.It Pa man.cgi.css 9792395e9cSLionel SambucShould be visible in the server document root or within 9892395e9cSLionel Sambuc.Ev CSS_DIR . 9992395e9cSLionel SambucIncluded in each page, ostensibly for general 10092395e9cSLionel Sambuc.Nm 10192395e9cSLionel Sambucstyling. 10292395e9cSLionel Sambuc.El 10392395e9cSLionel Sambuc.Sh COMPATIBILITY 10492395e9cSLionel SambucThe 10592395e9cSLionel Sambuc.Nm 10692395e9cSLionel Sambucscript is call-compatible with queries from the traditional 10792395e9cSLionel Sambuc.Pa man.cgi 10892395e9cSLionel Sambucscript by Wolfram Schneider. 10992395e9cSLionel SambucHowever, the results may not be quite the same. 11092395e9cSLionel Sambuc.Sh SEE ALSO 11192395e9cSLionel Sambuc.Xr catman 8 , 11292395e9cSLionel Sambuc.Xr mandocdb 8 11392395e9cSLionel Sambuc.Sh AUTHORS 11492395e9cSLionel SambucThe 11592395e9cSLionel Sambuc.Nm 11692395e9cSLionel Sambucutility was written by 117*0a6a1f1dSLionel Sambuc.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . 11892395e9cSLionel Sambuc.Sh CAVEATS 11992395e9cSLionel SambucIf you're running in a jailed web-server, make sure the 12092395e9cSLionel Sambuc.Pa /tmp 12192395e9cSLionel Sambucdirectory exists and is writable. 12292395e9cSLionel SambucThe databases may need this for scratch space. 123