version 1.15, 2016/03/18 13:22:27 |
version 1.24, 2022/07/06 15:47:28 |
|
|
.\" $Id$ |
.\" $Id$ |
.\" |
.\" |
.\" Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org> |
.\" Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org> |
.\" |
.\" |
|
|
CGI program searches for manual pages on a WWW server |
CGI program searches for manual pages on a WWW server |
and displays them to HTTP clients, |
and displays them to HTTP clients, |
providing functionality equivalent to the |
providing functionality equivalent to the |
.Xr apropos 1 |
|
and |
|
.Xr man 1 |
.Xr man 1 |
|
and |
|
.Xr apropos 1 |
utilities. |
utilities. |
It can use multiple manual trees in parallel. |
It can use multiple manual trees in parallel. |
.Ss HTML search interface |
.Ss HTML search interface |
Line 51 The effect of prepending a backslash to another charac |
|
Line 51 The effect of prepending a backslash to another charac |
|
in the current implementation, it has no effect. |
in the current implementation, it has no effect. |
.It |
.It |
A |
A |
.Dq Submit |
|
button to send a search request from the client to the server. |
|
.It |
|
A |
|
.Dq Reset |
|
button to undo any changes to the input boxes and the dropdown menus |
|
and reset them to the values contained in the |
|
.Ev QUERY_STRING . |
|
.It |
|
Radio buttons to select pages either by name like in |
|
.Xr man 1 |
.Xr man 1 |
or using |
submit button. |
|
The string in the input box is interpreted as the name of a manual page. |
|
.It |
|
An |
.Xr apropos 1 |
.Xr apropos 1 |
queries. |
submit button. |
|
The string in the input box is interpreted as a search |
|
.Ar expression . |
.It |
.It |
A dropdown menu to optionally select a manual section. |
A dropdown menu to optionally select a manual section. |
If one is provided, it has the same effect as the |
If one is provided, it has the same effect as the |
Line 109 Lists are returned when searches match more than one m |
|
Line 104 Lists are returned when searches match more than one m |
|
The first column shows the names and section numbers of manuals |
The first column shows the names and section numbers of manuals |
as clickable links. |
as clickable links. |
The second column shows the one-line descriptions of the manuals. |
The second column shows the one-line descriptions of the manuals. |
|
For |
|
.Xr man 1 |
|
style searches, the content of the first manual page follows the list. |
.It A manual page. |
.It A manual page. |
This output format is used when a search matches exactly one |
This output format is used when a search matches exactly one |
manual page, or when a link on a list page or an |
manual page, or when a link on a list page or an |
Line 116 manual page, or when a link on a list page or an |
|
Line 114 manual page, or when a link on a list page or an |
|
link on another manual page is followed. |
link on another manual page is followed. |
.It A no-result page. |
.It A no-result page. |
This is shown when a search request returns no results - |
This is shown when a search request returns no results - |
eiher because it violates the query syntax, or because |
either because it violates the query syntax, or because |
the search does not match any manual pages. |
the search does not match any manual pages. |
.It \&An error page. |
.It \&An error page. |
This cannot happen by merely clicking the |
This cannot happen by merely clicking the |
Line 162 Configure your web server to execute CGI programs loca |
|
Line 160 Configure your web server to execute CGI programs loca |
|
.Pa /cgi-bin . |
.Pa /cgi-bin . |
When using |
When using |
.Ox |
.Ox |
.Xr httpd 8 |
.Xr httpd 8 , |
or |
|
.Xr nginx 8 , |
|
the |
the |
.Xr slowcgi 8 |
.Xr slowcgi 8 |
proxy daemon is needed to translate FastCGI requests to plain old CGI. |
proxy daemon is needed to translate FastCGI requests to plain old CGI. |
Line 193 Otherwise, a leading slash is needed. |
|
Line 189 Otherwise, a leading slash is needed. |
|
This is used in generated HTML code. |
This is used in generated HTML code. |
.It Dv CUSTOMIZE_TITLE |
.It Dv CUSTOMIZE_TITLE |
An ASCII string to be used for the HTML <TITLE> element. |
An ASCII string to be used for the HTML <TITLE> element. |
.It Dv HTTP_HOST |
|
The FQDN of the (possibly virtual) host the HTTP server is running on. |
|
This is used for |
|
.Ic Location: |
|
headers in HTTP 303 responses. |
|
.It Dv MAN_DIR |
.It Dv MAN_DIR |
A file system path to the |
A file system path to the |
.Nm |
.Nm |
|
|
.Pp |
.Pp |
.Dl make man.cgi |
.Dl make man.cgi |
.Pp |
.Pp |
and copy the files to the proper locations. |
and copy the resulting binary to the proper location, |
Reading the |
for example using the command: |
.Cm installcgi |
.Pp |
target in the |
.Dl make installcgi |
.Pa Makefile |
.Pp |
can help with that, but do not run it without carefully checking it |
In addition to that, make sure the default manpath contains the files |
because the directory layouts of web servers vary greatly. |
.Pa man1/apropos.1 |
|
and |
|
.Pa man8/man.cgi.8 , |
|
or the documentation links at the bottom of the index page will not work. |
.Ss URI interface |
.Ss URI interface |
.Nm |
.Nm |
uniform resource identifiers are not needed for interactive use, |
uniform resource identifiers are not needed for interactive use, |
Line 243 They consist of: |
|
Line 237 They consist of: |
|
.It |
.It |
The |
The |
.Cm http:// |
.Cm http:// |
|
or |
|
.Cm https:// |
protocol specifier. |
protocol specifier. |
.It |
.It |
The host name. |
The host name. |
Line 256 and the name of the requested file, for example |
|
Line 252 and the name of the requested file, for example |
|
.Pa /OpenBSD-current/man1/mandoc.1 . |
.Pa /OpenBSD-current/man1/mandoc.1 . |
This can be abbreviated according to the following syntax: |
This can be abbreviated according to the following syntax: |
.Sm off |
.Sm off |
.Op / Ar manpath Oo / Cm man Ar sec Oc Op / Ar arch |
.Op / Ar manpath |
|
.Op / Cm man Ar sec |
|
.Op / Ar arch |
.Pf / Ar name Op \&. Ar sec |
.Pf / Ar name Op \&. Ar sec |
.Sm on |
.Sm on |
.It |
.It |
Line 318 The web server may pass the following CGI variables to |
|
Line 316 The web server may pass the following CGI variables to |
|
.Nm : |
.Nm : |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Ev SCRIPT_NAME |
.It Ev SCRIPT_NAME |
The initial part of the the URI passed from the client to the server, |
The initial part of the URI passed from the client to the server, |
starting after the server's host name and ending before |
starting after the server's host name and ending before |
.Ev PATH_INFO . |
.Ev PATH_INFO . |
This is ignored by |
This is ignored by |
|
|
data directory containing all the manual trees. |
data directory containing all the manual trees. |
Can be overridden by |
Can be overridden by |
.Dv MAN_DIR . |
.Dv MAN_DIR . |
.It Pa /man/mandoc/man1/apropos.1 , /man/mandoc/man8/man.cgi.8 |
|
Manual pages documenting |
|
.Nm |
|
itself, linked from the index page. |
|
.It Pa /man/manpath.conf |
.It Pa /man/manpath.conf |
The list of available manpaths, one per line. |
The list of available manpaths, one per line. |
If any of the lines in this file contains a slash |
If any of the lines in this file contains a slash |
Line 387 or any character not contained in the |
|
Line 381 or any character not contained in the |
|
.Nm |
.Nm |
reports an internal server error and exits without doing anything. |
reports an internal server error and exits without doing anything. |
.It Pa /man/header.html |
.It Pa /man/header.html |
An optional file containing static HTML code to be inserted right |
An optional file containing static HTML code to be wrapped in |
after opening the <BODY> element. |
a <HEADER> element and inserted right after opening the <BODY> element. |
|
For example, it can contain an <H1> element |
|
specifying the name of the website. |
.It Pa /man/footer.html |
.It Pa /man/footer.html |
An optional file containing static HTML code to be inserted right |
An optional file containing static HTML code to be wrapped in |
before closing the <BODY> element. |
a <FOOTER> element and inserted right before closing the <BODY> element. |
.It Pa /man/OpenBSD-current/man1/mandoc.1 |
.It Pa /man/OpenBSD-current/man1/mandoc.1 |
An example |
An example |
.Xr mdoc 7 |
.Xr mdoc 7 |
|
|
CGI program is call-compatible with queries from the traditional |
CGI program is call-compatible with queries from the traditional |
.Pa man.cgi |
.Pa man.cgi |
script by Wolfram Schneider. |
script by Wolfram Schneider. |
However, the output may not be quite the same. |
However, the output looks quite different. |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr apropos 1 , |
.Xr apropos 1 , |
.Xr mandoc.db 5 , |
.Xr mandoc.db 5 , |
|
|
based on |
based on |
.Xr mandoc 1 |
.Xr mandoc 1 |
first appeared in mdocml-1.12.1 (March 2012). |
first appeared in mdocml-1.12.1 (March 2012). |
The current SQLite3-based version first appeared in |
The current |
.Ox 5.6 . |
.Xr mandoc.db 5 |
|
database format first appeared in |
|
.Ox 6.1 . |
.Sh AUTHORS |
.Sh AUTHORS |
.An -nosplit |
.An -nosplit |
The |
The |
.Nm |
.Nm |
program was written by |
program was written by |
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv |
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv |
and ported to the SQLite3-based |
and is maintained by |
.Xr mandoc.db 5 |
.An Ingo Schwarze Aq Mt schwarze@openbsd.org , |
backend by |
who also designed and implemented the database format. |
.An Ingo Schwarze Aq Mt schwarze@openbsd.org . |
|