Added an asciidoc page for htparser as well.
[ashd.git] / doc / htparser.doc
CommitLineData
573c55e5
FT
1htparser(1)
2===========
3
4NAME
5----
6htparser - Root HTTP server for use with *ashd*(7)
7
8SYNOPSIS
9--------
10*htparser* [*-hSf*] [*-u* 'USER'] [*-r* 'ROOT'] [*-p* 'PIDFILE'] 'PORTSPEC'... `--` 'ROOT' ['ARGS'...]
11
12DESCRIPTION
13-----------
14
15The *htparser* program is the root HTTP server of *ashd*(7). It
16listens to specified TCP ports, speaks HTTP with connecting clients,
17and passes requests on to the root handler program.
18
19When *htparser* starts, it will first begin listening to all ports
20specified by 'PORTSPEC'. Once all ports have been bound successfully,
21it will fork off and start the root handler specified by 'ROOT',
22searching the *PATH* environment variable if necessary, and passing it
23all the 'ARGS' as command-line arguments. Only after that will
24*htparser* do any daemonizing or chrooting as specified by options.
25
26The root handler must be a persistent program as specified in
27*ashd*(7). If the handler program exits, *htparser* will exit too.
28
29PORT SPECIFICATION
30------------------
31
32'PORTSPEC' is given in the form
33'HANDLER'[*:*'PAR'[*=*'VAL'][(*,*'PAR'[*=*'VAL'])...]]. The
34'PAR'='VAL' pairs are used for specifying key-value arguments to the
35'HANDLER'. An example of a valid 'PORTSPEC' is `plain:port=8080`.
36
37Currently, the available 'HANDLERs' are *plain* and *ssl*, for
38handling plain TCP connections and SSL/TLS-protected connections,
39respectively. For details regarding the arguments that each handler
40accept, simply run *htparser* with 'HANDLER':*help*. For example, the
41command "`htparser ssl:help`" will display help for the *ssl* handler to
42standard output and then exit.
43
44The port specifications must be followed by the `--` argument to
45distinguish them from the root handler specification.
46
47OPTIONS
48-------
49
50*-h*::
51
52 Print a brief usage message on standard output and exit.
53
54*-S*::
55
56 Log messages to *syslog*(3) instead of standard error.
57
58*-f*::
59
60 Daemonize after all specified ports have been successfully
61 bound and the root handler has been started.
62
63*-u*::
64
65 Change UID to 'USER' once all specified ports have been
66 successfully bound and the root handler has been
67 started. 'USER' must be specified symbolically (i.e. not as a
68 numeric UID).
69
70*-r*::
71
72 Change root directory to 'ROOT' once all specified ports have
73 been successfully bound and the root handler has been started.
74
75*-p*::
76
77 After having daemonized, write the PID of the new process to
78 'PIDFILE'.
79
80AUTHOR
81------
82Fredrik Tolf <fredrik@dolda2000.com>
83
84SEE ALSO
85--------
86*ashd*(7)