python: Rewrote SSI handler as a reusable module, and in Python3.
[ashd.git] / doc / callcgi.doc
1 callcgi(1)
2 ==========
3
4 NAME
5 ----
6 callcgi - CGI request handler for ashd(7)
7
8 SYNOPSIS
9 --------
10 *callcgi* [*-c*] [*-p* 'PROGRAM'] 'METHOD' 'URL' 'REST'
11
12 DESCRIPTION
13 -----------
14
15 *callcgi* serves CGI scripts by translating the *ashd*(7) request
16 environment into a standard CGI environment and executing the target
17 file. It needs to be called with the `X-Ash-File` header added to the
18 request, as *dirplex*(1) does.
19
20 *callcgi* is a transient handler, as defined in *ashd*(7), and the
21 'METHOD', 'URL' and 'REST' arguments will normally be added by the
22 parent handler.
23
24 The CGI script is called with its own filename as the first and only
25 command-line parameter.
26
27 OPTIONS
28 -------
29
30 *-c*::
31
32         Change directory to the directory containing the CGI script
33         before running it. This behavior is encouraged by the CGI
34         specification, but is not used by *callcgi* by default.
35
36 *-p* 'PROGRAM'::
37
38         Call 'PROGRAM' instead of the file itself. This mechanism can
39         be used to serve e.g. PHP scripts and other programs that have
40         an interpreter that can act as a CGI script. The filename of
41         the actual script is still passed as the first and only
42         command-line parameter to the program.
43
44 AUTHOR
45 ------
46 Fredrik Tolf <fredrik@dolda2000.com>
47
48 SEE ALSO
49 --------
50 *dirplex*(1), *ashd*(7), *callscgi*(1), *callfcgi*(1), RFC 3875