Sun Apr 24 07:19:00 2011 UTC ()
List myself as a contributor.


(jmmv)
diff -r1.28 -r1.29 src/libexec/httpd/bozohttpd.8

cvs diff -r1.28 -r1.29 src/libexec/httpd/bozohttpd.8 (switch to unified diff)

--- src/libexec/httpd/bozohttpd.8 2011/04/24 07:17:02 1.28
+++ src/libexec/httpd/bozohttpd.8 2011/04/24 07:18:59 1.29
@@ -1,608 +1,610 @@ @@ -1,608 +1,610 @@
1.\" $NetBSD: bozohttpd.8,v 1.28 2011/04/24 07:17:02 jmmv Exp $ 1.\" $NetBSD: bozohttpd.8,v 1.29 2011/04/24 07:18:59 jmmv Exp $
2.\" 2.\"
3.\" $eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $ 3.\" $eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $
4.\" 4.\"
5.\" Copyright (c) 1997-2010 Matthew R. Green 5.\" Copyright (c) 1997-2010 Matthew R. Green
6.\" All rights reserved. 6.\" All rights reserved.
7.\" 7.\"
8.\" Redistribution and use in source and binary forms, with or without 8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions 9.\" modification, are permitted provided that the following conditions
10.\" are met: 10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright 11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer. 12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution. 15.\" documentation and/or other materials provided with the distribution.
16.\" 16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE. 27.\" SUCH DAMAGE.
28.\" 28.\"
29.Dd April 23, 2011 29.Dd April 24, 2011
30.Dt HTTPD 8 30.Dt HTTPD 8
31.Os 31.Os
32.Sh NAME 32.Sh NAME
33.Nm httpd 33.Nm httpd
34.Nd hyper text transfer protocol version 1.1 daemon 34.Nd hyper text transfer protocol version 1.1 daemon
35.Sh SYNOPSIS 35.Sh SYNOPSIS
36.Nm 36.Nm
37.Op Fl befHnrsuVX 37.Op Fl befHnrsuVX
38.Op Fl C Ar suffix cgihandler 38.Op Fl C Ar suffix cgihandler
39.Op Fl c Ar cgibin 39.Op Fl c Ar cgibin
40.Op Fl I Ar port 40.Op Fl I Ar port
41.Op Fl i Ar address 41.Op Fl i Ar address
42.Op Fl M Ar suffix type encoding encoding11 42.Op Fl M Ar suffix type encoding encoding11
43.Op Fl P Ar pidfile 43.Op Fl P Ar pidfile
44.Op Fl p Ar pubdir 44.Op Fl p Ar pubdir
45.Op Fl S Ar server_software 45.Op Fl S Ar server_software
46.Op Fl t Ar chrootdir 46.Op Fl t Ar chrootdir
47.Op Fl v Ar virtualroot 47.Op Fl v Ar virtualroot
48.Op Fl x Ar index 48.Op Fl x Ar index
49.Op Fl Z Ar cert privkey 49.Op Fl Z Ar cert privkey
50.Ar slashdir 50.Ar slashdir
51.Op Ar myname 51.Op Ar myname
52.Sh DESCRIPTION 52.Sh DESCRIPTION
53The 53The
54.Nm 54.Nm
55program reads a 55program reads a
56.Em HTTP 56.Em HTTP
57request from the standard input, and sends a reply to the standard output. 57request from the standard input, and sends a reply to the standard output.
58Besides ~user translation and virtual hosting support (see below), all file 58Besides ~user translation and virtual hosting support (see below), all file
59requests are from 59requests are from
60.Ar slashdir 60.Ar slashdir
61directory. 61directory.
62The server uses 62The server uses
63.Ar myname 63.Ar myname
64as its name, which defaults to the local hostname, obtained from 64as its name, which defaults to the local hostname, obtained from
65.Xr gethostname 3 65.Xr gethostname 3
66(but see the 66(but see the
67.Fl v 67.Fl v
68option for virtual hosting.) 68option for virtual hosting.)
69.Nm 69.Nm
70writes logs to 70writes logs to
71.Xr syslog 3 71.Xr syslog 3
72using the ftp facility (but see the 72using the ftp facility (but see the
73.Fl s 73.Fl s
74option for testing.) 74option for testing.)
75.Nm 75.Nm
76is designed to be small, simple and relatively featureless, 76is designed to be small, simple and relatively featureless,
77hopefully increasing its security. 77hopefully increasing its security.
78.Ss OPTIONS 78.Ss OPTIONS
79The following options are available: 79The following options are available:
80.Bl -tag -width xxxcgibin 80.Bl -tag -width xxxcgibin
81.It Fl b 81.It Fl b
82Enables daemon mode, where 82Enables daemon mode, where
83.Nm 83.Nm
84detaches from the current terminal, running in the background and 84detaches from the current terminal, running in the background and
85servicing HTTP requests. 85servicing HTTP requests.
86.It Fl C Ar suffix cgihandler 86.It Fl C Ar suffix cgihandler
87Adds a new CGI handler program for a particular file type. 87Adds a new CGI handler program for a particular file type.
88The 88The
89.Ar suffix 89.Ar suffix
90should be any normal file suffix, and the 90should be any normal file suffix, and the
91.Ar cgihandler 91.Ar cgihandler
92should be a full path to an interpreter. 92should be a full path to an interpreter.
93This option is the only way to enable CGI programs that exist 93This option is the only way to enable CGI programs that exist
94outside of the cgibin directory to be executed. 94outside of the cgibin directory to be executed.
95Multiple 95Multiple
96.Fl C 96.Fl C
97options may be passed. 97options may be passed.
98.It Fl c Ar cgibin 98.It Fl c Ar cgibin
99Enables the CGI/1.1 interface. 99Enables the CGI/1.1 interface.
100The 100The
101.Ar cgibin 101.Ar cgibin
102directory is expected to contain the CGI programs to be used. 102directory is expected to contain the CGI programs to be used.
103.Nm 103.Nm
104looks for URL's in the form of 104looks for URL's in the form of
105.Em /cgi-bin/\*[Lt]scriptname\*[Gt] 105.Em /cgi-bin/\*[Lt]scriptname\*[Gt]
106where 106where
107.Aq scriptname 107.Aq scriptname
108is a valid CGI program in the 108is a valid CGI program in the
109.Ar cgibin 109.Ar cgibin
110directory. 110directory.
111In other words, all CGI URL's must begin with 111In other words, all CGI URL's must begin with
112.Em \%/cgi-bin/ . 112.Em \%/cgi-bin/ .
113Note that the CGI/1.1 interface is not available with 113Note that the CGI/1.1 interface is not available with
114.Em ~user 114.Em ~user
115translation. 115translation.
116.It Fl e 116.It Fl e
117Causes 117Causes
118.Nm 118.Nm
119to not clear the environment when used with either the 119to not clear the environment when used with either the
120.Fl t 120.Fl t
121or 121or
122.Fl U 122.Fl U
123options. 123options.
124.It Fl f 124.It Fl f
125Stops the 125Stops the
126.Fl b 126.Fl b
127flag from 127flag from
128.Nm 128.Nm
129detaching from the tty and going into the background. 129detaching from the tty and going into the background.
130.It Fl H 130.It Fl H
131Causes directory index mode to hide files and directories 131Causes directory index mode to hide files and directories
132that start with a period, except for 132that start with a period, except for
133.Pa .. . 133.Pa .. .
134Also see 134Also see
135.Fl X . 135.Fl X .
136.It Fl I Ar port 136.It Fl I Ar port
137Causes 137Causes
138.Ar port 138.Ar port
139to use used as the port to bind daemon mode. 139to use used as the port to bind daemon mode.
140The default is the 140The default is the
141.Dq http 141.Dq http
142port. 142port.
143This option is only valid with the 143This option is only valid with the
144.Fl b 144.Fl b
145option. 145option.
146.It Fl i Ar address 146.It Fl i Ar address
147Causes 147Causes
148.Ar address 148.Ar address
149to use used as the address to bind daemon mode. 149to use used as the address to bind daemon mode.
150If otherwise unspecified, the address used to bind is derived from the 150If otherwise unspecified, the address used to bind is derived from the
151.Ar myname , 151.Ar myname ,
152which defaults to the name returned by 152which defaults to the name returned by
153.Xr gethostname 3 . 153.Xr gethostname 3 .
154Only the last 154Only the last
155.Fl i 155.Fl i
156option is used. 156option is used.
157This option is only valid with the 157This option is only valid with the
158.Fl b 158.Fl b
159option. 159option.
160.It Fl M Ar suffix type encoding encoding11 160.It Fl M Ar suffix type encoding encoding11
161Adds a new entry to the table that converts file suffixes to 161Adds a new entry to the table that converts file suffixes to
162content type and encoding. 162content type and encoding.
163This option takes four additional arguments containing 163This option takes four additional arguments containing
164the file prefix, its 164the file prefix, its
165.Dq Content-Type , 165.Dq Content-Type ,
166.Dq Content-Encoding , 166.Dq Content-Encoding ,
167and 167and
168.Dq Content-Encoding 168.Dq Content-Encoding
169for HTTP/1.1 connections, respectively. 169for HTTP/1.1 connections, respectively.
170If any of these are a single dash 170If any of these are a single dash
171.Pq Dq - , 171.Pq Dq - ,
172the empty string is used instead. 172the empty string is used instead.
173Multiple 173Multiple
174.Fl M 174.Fl M
175options may be passed. 175options may be passed.
176.It Fl n 176.It Fl n
177Stops 177Stops
178.Nm 178.Nm
179from doing IP address to name resolution of hosts for setting the 179from doing IP address to name resolution of hosts for setting the
180.Ev REMOTE_HOST 180.Ev REMOTE_HOST
181variable before running a CGI program. 181variable before running a CGI program.
182This option has no effect without the 182This option has no effect without the
183.Fl c 183.Fl c
184option. 184option.
185.It Fl P Ar pidfile 185.It Fl P Ar pidfile
186Causes 186Causes
187.Nm 187.Nm
188to create a pid file in 188to create a pid file in
189.Ar pidfile 189.Ar pidfile
190when run in daemon mode with the 190when run in daemon mode with the
191.Fl b 191.Fl b
192option. 192option.
193.It Fl p Ar pubdir 193.It Fl p Ar pubdir
194Changes the default user directory for 194Changes the default user directory for
195.Em /~user/ 195.Em /~user/
196translations from 196translations from
197.Dq public_html 197.Dq public_html
198to 198to
199.Ar pubdir . 199.Ar pubdir .
200.It Fl r 200.It Fl r
201Forces pages besides the 201Forces pages besides the
202.Dq index.html 202.Dq index.html
203(see the 203(see the
204.Fl X 204.Fl X
205option) page to require that the Referrer: header be present and 205option) page to require that the Referrer: header be present and
206refer to this web server, otherwise a redirect to the 206refer to this web server, otherwise a redirect to the
207.Dq index.html 207.Dq index.html
208page will be returned instead. 208page will be returned instead.
209.It Fl S Ar server_software 209.It Fl S Ar server_software
210Sets the internal server version to 210Sets the internal server version to
211.Ar server_software . 211.Ar server_software .
212.It Fl s 212.It Fl s
213Forces logging to be set to stderr always. 213Forces logging to be set to stderr always.
214.It Fl t Ar chrootdir 214.It Fl t Ar chrootdir
215Makes 215Makes
216.Nm 216.Nm
217chroot to the specified directory 217chroot to the specified directory
218before answering requests. 218before answering requests.
219Every other path should be specified relative 219Every other path should be specified relative
220to the new root, if this option is used. 220to the new root, if this option is used.
221Note that the current environment 221Note that the current environment
222is normally replaced with an empty environment with this option, unless the 222is normally replaced with an empty environment with this option, unless the
223.Fl e 223.Fl e
224option is also used. 224option is also used.
225.It Fl U Ar username 225.It Fl U Ar username
226Causes 226Causes
227.Nm 227.Nm
228to switch to the user and the groups of 228to switch to the user and the groups of
229.Ar username 229.Ar username
230after initialization. 230after initialization.
231This option, like 231This option, like
232.Fl t 232.Fl t
233above, causes 233above, causes
234.Nm 234.Nm
235to clear the environment unless the 235to clear the environment unless the
236.Fl e 236.Fl e
237option is given. 237option is given.
238.It Fl u 238.It Fl u
239Enables the transformation of Uniform Resource Locators of 239Enables the transformation of Uniform Resource Locators of
240the form 240the form
241.Em /~user/ 241.Em /~user/
242into the directory 242into the directory
243.Pa ~user/public_html 243.Pa ~user/public_html
244(but see the 244(but see the
245.Fl p 245.Fl p
246option above). 246option above).
247.It Fl V 247.It Fl V
248Sets the default virtual host directory to 248Sets the default virtual host directory to
249.Ar slashdir . 249.Ar slashdir .
250If no directory exists in 250If no directory exists in
251.Ar virtualroot 251.Ar virtualroot
252for the request, then 252for the request, then
253.Ar slashdir 253.Ar slashdir
254will be used. 254will be used.
255The default behaviour is to return 404 (Not Found.) 255The default behaviour is to return 404 (Not Found.)
256.It Fl v Ar virtualroot 256.It Fl v Ar virtualroot
257Enables virtual hosting support. 257Enables virtual hosting support.
258Directories in 258Directories in
259.Ar virtualroot 259.Ar virtualroot
260will be searched for a matching virtual host name, when parsing 260will be searched for a matching virtual host name, when parsing
261the HTML request. 261the HTML request.
262If a matching name is found, it will be used 262If a matching name is found, it will be used
263as both the server's real name, 263as both the server's real name,
264.Op Ar myname , 264.Op Ar myname ,
265and as the 265and as the
266.Ar slashdir . 266.Ar slashdir .
267See the 267See the
268.Sx EXAMPLES 268.Sx EXAMPLES
269section for an example of using this option. 269section for an example of using this option.
270.It Fl X 270.It Fl X
271Enables directory indexing. 271Enables directory indexing.
272A directory index will be generated only when the default file (i.e. 272A directory index will be generated only when the default file (i.e.
273.Pa index.html 273.Pa index.html
274normally) is not present. 274normally) is not present.
275.It Fl x Ar index 275.It Fl x Ar index
276Changes the default file read for directories from 276Changes the default file read for directories from
277.Dq index.html 277.Dq index.html
278to 278to
279.Ar index . 279.Ar index .
280.It Fl Z Ar certificate_path privatekey_path 280.It Fl Z Ar certificate_path privatekey_path
281Sets the path to the server certificate file and the private key file 281Sets the path to the server certificate file and the private key file
282in pem format. 282in pem format.
283It also causes 283It also causes
284.Nm 284.Nm
285to start SSL mode. 285to start SSL mode.
286.El 286.El
287.Pp 287.Pp
288Note that in 288Note that in
289.Nm 289.Nm
290versions 20031005 and prior that supported the 290versions 20031005 and prior that supported the
291.Fl C 291.Fl C
292and 292and
293.Fl M 293.Fl M
294options, they took a single space-separated argument that was parsed. 294options, they took a single space-separated argument that was parsed.
295since version 20040828, they take multiple options (2 in the case of 295since version 20040828, they take multiple options (2 in the case of
296.Fl C 296.Fl C
297and 4 in the case of 297and 4 in the case of
298.Fl M . ) 298.Fl M . )
299.Ss INETD CONFIGURATION 299.Ss INETD CONFIGURATION
300As 300As
301.Nm 301.Nm
302uses 302uses
303.Xr inetd 8 303.Xr inetd 8
304by default to process incoming TCP connections for HTTP requests 304by default to process incoming TCP connections for HTTP requests
305(but see the 305(but see the
306.Fl b 306.Fl b
307option), 307option),
308.Nm 308.Nm
309has little internal networking knowledge. 309has little internal networking knowledge.
310(Indeed, you can run it on the command line with little change of functionality.) 310(Indeed, you can run it on the command line with little change of functionality.)
311A typical 311A typical
312.Xr inetd.conf 5 312.Xr inetd.conf 5
313entry would be: 313entry would be:
314.Bd -literal 314.Bd -literal
315http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd /var/www 315http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd /var/www
316http stream tcp6 nowait:600 _httpd /usr/libexec/httpd httpd /var/www 316http stream tcp6 nowait:600 _httpd /usr/libexec/httpd httpd /var/www
317.Ed 317.Ed
318.Pp 318.Pp
319This would serve web pages from 319This would serve web pages from
320.Pa /var/www 320.Pa /var/www
321on both IPv4 and IPv6 ports. 321on both IPv4 and IPv6 ports.
322The 322The
323.Em :600 323.Em :600
324changes the 324changes the
325requests per minute to 600, up from the 325requests per minute to 600, up from the
326.Xr inetd 8 326.Xr inetd 8
327default of 40. 327default of 40.
328.Pp 328.Pp
329Using the 329Using the
330.Nx 330.Nx
331.Xr inetd 8 , 331.Xr inetd 8 ,
332you can provide multiple IP-address based HTTP servers by having multiple 332you can provide multiple IP-address based HTTP servers by having multiple
333listening ports with different configurations. 333listening ports with different configurations.
334.Ss NOTES 334.Ss NOTES
335This server supports the 335This server supports the
336.Em HTTP/0.9 , 336.Em HTTP/0.9 ,
337.Em HTTP/1.0 , 337.Em HTTP/1.0 ,
338and 338and
339.Em HTTP/1.1 339.Em HTTP/1.1
340standards. 340standards.
341Support for these protocols is very minimal and many optional features are 341Support for these protocols is very minimal and many optional features are
342not supported. 342not supported.
343.Pp 343.Pp
344.Nm 344.Nm
345can be compiled without CGI support (NO_CGIBIN_SUPPORT), user 345can be compiled without CGI support (NO_CGIBIN_SUPPORT), user
346transformations (NO_USER_SUPPORT), directory index support (NO_DIRINDEX_SUPPORT), 346transformations (NO_USER_SUPPORT), directory index support (NO_DIRINDEX_SUPPORT),
347daemon mode support (NO_DAEMON_MODE), and dynamic MIME content 347daemon mode support (NO_DAEMON_MODE), and dynamic MIME content
348(NO_DYNAMIC_CONTENT), and SSL support (NO_SSL_SUPPORT) by defining the listed 348(NO_DYNAMIC_CONTENT), and SSL support (NO_SSL_SUPPORT) by defining the listed
349macros when building 349macros when building
350.Nm . 350.Nm .
351.Ss HTTP BASIC AUTHORISATION 351.Ss HTTP BASIC AUTHORISATION
352.Nm 352.Nm
353has support for HTTP Basic Authorisation. 353has support for HTTP Basic Authorisation.
354If a file named 354If a file named
355.Pa .htpasswd 355.Pa .htpasswd
356exists in the directory of the current request, 356exists in the directory of the current request,
357.Nm 357.Nm
358will restrict access to documents in that directory 358will restrict access to documents in that directory
359using the RFC 2617 HTTP 359using the RFC 2617 HTTP
360.Dq Basic 360.Dq Basic
361authentication scheme. 361authentication scheme.
362.Pp 362.Pp
363Note: 363Note:
364This does not recursively protect any sub-directories. 364This does not recursively protect any sub-directories.
365.Pp 365.Pp
366The 366The
367.Pa .htpasswd 367.Pa .htpasswd
368file contains lines delimited with a colon containing 368file contains lines delimited with a colon containing
369usernames and passwords hashed with 369usernames and passwords hashed with
370.Xr crypt 3 , 370.Xr crypt 3 ,
371for example: 371for example:
372.Bd -literal 372.Bd -literal
373heather:$1$pZWI4tH/$DzDPl63i6VvVRv2lJNV7k1 373heather:$1$pZWI4tH/$DzDPl63i6VvVRv2lJNV7k1
374jeremy:A.xewbx2DpQ8I 374jeremy:A.xewbx2DpQ8I
375.Ed 375.Ed
376.Pp 376.Pp
377On 377On
378.Nx , 378.Nx ,
379the 379the
380.Xr pwhash 1 380.Xr pwhash 1
381utility may be used to generate hashed passwords. 381utility may be used to generate hashed passwords.
382.Pp 382.Pp
383While 383While
384.Nm 384.Nm
385distributed with 385distributed with
386.Nx 386.Nx
387has support for HTTP Basic Authorisation enabled by default, 387has support for HTTP Basic Authorisation enabled by default,
388in the portable distribution it is excluded. 388in the portable distribution it is excluded.
389Compile 389Compile
390.Nm 390.Nm
391with 391with
392.Dq -DDO_HTPASSWD 392.Dq -DDO_HTPASSWD
393on the compiler command line to enable this support. 393on the compiler command line to enable this support.
394It may require linking with the crypt library, using 394It may require linking with the crypt library, using
395.Dq -lcrypt . 395.Dq -lcrypt .
396.Ss SSL SUPPORT 396.Ss SSL SUPPORT
397.Nm 397.Nm
398has support for SSLv2, SSLv3, and TLSv1 protocols that is included by 398has support for SSLv2, SSLv3, and TLSv1 protocols that is included by
399default. 399default.
400It requires linking with the crypto and ssl library, using 400It requires linking with the crypto and ssl library, using
401.Dq -lcrypto -lssl . 401.Dq -lcrypto -lssl .
402To disable SSL SUPPORT compile 402To disable SSL SUPPORT compile
403.Nm 403.Nm
404with 404with
405.Dq -DNO_SSL_SUPPORT 405.Dq -DNO_SSL_SUPPORT
406on the compiler command line. 406on the compiler command line.
407.Sh FILES 407.Sh FILES
408.Nm 408.Nm
409looks for a couple of special files in directories that allow certain features 409looks for a couple of special files in directories that allow certain features
410to be provided on a per-directory basis. 410to be provided on a per-directory basis.
411In addition to the 411In addition to the
412.Pa .htpasswd 412.Pa .htpasswd
413used by HTTP basic authorisation, 413used by HTTP basic authorisation,
414if a 414if a
415.Pa .bzdirect 415.Pa .bzdirect
416file is found (contents are irrelevant) 416file is found (contents are irrelevant)
417.Nm 417.Nm
418will allow direct access even with the 418will allow direct access even with the
419.Fl r 419.Fl r
420option. 420option.
421If a 421If a
422.Pa .bzredirect 422.Pa .bzredirect
423symbolic link is found, 423symbolic link is found,
424.Nm 424.Nm
425will perform a smart redirect to the target of this symlink. 425will perform a smart redirect to the target of this symlink.
426The target is assumed to live on the same server. 426The target is assumed to live on the same server.
427If a 427If a
428.Pa .bzabsredirect 428.Pa .bzabsredirect
429symbolic link is found, 429symbolic link is found,
430.Nm 430.Nm
431will redirect to the absolute url pointed to by this symlink. 431will redirect to the absolute url pointed to by this symlink.
432This is useful to redirect to different servers. 432This is useful to redirect to different servers.
433.Sh EXAMPLES 433.Sh EXAMPLES
434To configure set of virtual hosts, one would use an 434To configure set of virtual hosts, one would use an
435.Xr inetd.conf 5 435.Xr inetd.conf 5
436entry like: 436entry like:
437.Bd -literal 437.Bd -literal
438http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd -v /var/vroot /var/www 438http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd -v /var/vroot /var/www
439.Ed 439.Ed
440.Pp 440.Pp
441and inside 441and inside
442.Pa /var/vroot 442.Pa /var/vroot
443create a directory (or a symlink to a directory) with the same name as 443create a directory (or a symlink to a directory) with the same name as
444the virtual host, for each virtual host. 444the virtual host, for each virtual host.
445Lookups for these names are done in a case-insensitive manner. 445Lookups for these names are done in a case-insensitive manner.
446.Pp 446.Pp
447To use 447To use
448.Nm 448.Nm
449with PHP, one must use the 449with PHP, one must use the
450.Fl C 450.Fl C
451option to specify a CGI handler for a particular file type. 451option to specify a CGI handler for a particular file type.
452Typically this will be like: 452Typically this will be like:
453.Bd -literal 453.Bd -literal
454httpd -C .php /usr/pkg/bin/php /var/www 454httpd -C .php /usr/pkg/bin/php /var/www
455.Ed 455.Ed
456.Sh SEE ALSO 456.Sh SEE ALSO
457.Xr inetd.conf 5 , 457.Xr inetd.conf 5 ,
458.Xr inetd 8 458.Xr inetd 8
459.Sh HISTORY 459.Sh HISTORY
460The 460The
461.Nm 461.Nm
462program is actually called 462program is actually called
463.Dq bozohttpd . 463.Dq bozohttpd .
464It was first written in perl, based on another perl http server 464It was first written in perl, based on another perl http server
465called 465called
466.Dq tinyhttpd . 466.Dq tinyhttpd .
467It was then rewritten from scratch in perl, and then once again in C. 467It was then rewritten from scratch in perl, and then once again in C.
468From 468From
469.Dq bozohttpd 469.Dq bozohttpd
470version 20060517, it has been integrated into 470version 20060517, it has been integrated into
471.Nx . 471.Nx .
472The focus has always been simplicity and security, with minimal features 472The focus has always been simplicity and security, with minimal features
473and regular code audits. 473and regular code audits.
474This manual documents 474This manual documents
475.Nm 475.Nm
476version 20100920. 476version 20100920.
477.Sh AUTHORS 477.Sh AUTHORS
478.Nm 478.Nm
479was written by Matthew R. Green 479was written by Matthew R. Green
480.Aq mrg@eterna.com.au . 480.Aq mrg@eterna.com.au .
481.Pp 481.Pp
482The large list of contributors includes: 482The large list of contributors includes:
483.Bl -dash 483.Bl -dash
484.It 484.It
485Arnaud Lacombe 485Arnaud Lacombe
486.Aq alc@netbsd.org 486.Aq alc@netbsd.org
487provided some clean up for memory leaks 487provided some clean up for memory leaks
488.It 488.It
489Christoph Badura 489Christoph Badura
490.Aq bad@bsd.de 490.Aq bad@bsd.de
491provided Range: header support 491provided Range: header support
492.It 492.It
493Sean Boudreau 493Sean Boudreau
494.Aq seanb@NetBSD.org 494.Aq seanb@NetBSD.org
495provided a security fix for virtual hosting 495provided a security fix for virtual hosting
496.It 496.It
497Julian Coleman 497Julian Coleman
498.Aq jdc@coris.org.uk 498.Aq jdc@coris.org.uk
499provided an IPv6 bugfix 499provided an IPv6 bugfix
500.It 500.It
501Chuck Cranor 501Chuck Cranor
502.Aq chuck@research.att.com 502.Aq chuck@research.att.com
503provided cgi-bin support fixes, and more 503provided cgi-bin support fixes, and more
504.It 504.It
505DEGROOTE Arnaud 505DEGROOTE Arnaud
506.Aq degroote@netbsd.org 506.Aq degroote@netbsd.org
507provided a fix for daemon mode 507provided a fix for daemon mode
508.It 508.It
509Andrew Doran 509Andrew Doran
510.Aq ad@netbsd.org 510.Aq ad@netbsd.org
511provided directory indexing support 511provided directory indexing support
512.It 512.It
513Per Ekman 513Per Ekman
514.Aq pek@pdc.kth.se 514.Aq pek@pdc.kth.se
515provided a fix for a minor (non-security) buffer overflow condition 515provided a fix for a minor (non-security) buffer overflow condition
516.It 516.It
517Alistair G. Crooks 517Alistair G. Crooks
518.Aq agc@netbsd.org 518.Aq agc@netbsd.org
519cleaned up many internal interfaces, made bozohttpd linkable as a 519cleaned up many internal interfaces, made bozohttpd linkable as a
520library and provided the lua binding. 520library and provided the lua binding.
521.It 521.It
522Jun-ichiro itojun Hagino, KAME 522Jun-ichiro itojun Hagino, KAME
523.Aq itojun@iijlab.net 523.Aq itojun@iijlab.net
524provided initial IPv6 support 524provided initial IPv6 support
525.It 525.It
526Martin Husemann 526Martin Husemann
527.Aq martin@netbsd.org 527.Aq martin@netbsd.org
528provided .bzabsredirect support 528provided .bzabsredirect support
529.It 529.It
530Arto Huusko 530Arto Huusko
531.Aq arto.huusko@pp2.inet.fi 531.Aq arto.huusko@pp2.inet.fi
532provided fixes cgi-bin 532provided fixes cgi-bin
533.It 533.It
534Roland Illig 534Roland Illig
535.Aq roland.illig@gmx.de 535.Aq roland.illig@gmx.de
536provided some off-by-one fixes 536provided some off-by-one fixes
537.It 537.It
538Zak Johnson 538Zak Johnson
539.Aq zakj@nox.cx 539.Aq zakj@nox.cx
540provided cgi-bin enhancements 540provided cgi-bin enhancements
541.It 541.It
542Nicolas Jombart 542Nicolas Jombart
543.Aq ecu@ipv42.net 543.Aq ecu@ipv42.net
544provided fixes for HTTP basic authorisation support 544provided fixes for HTTP basic authorisation support
545.It 545.It
546Thomas Klausner 546Thomas Klausner
547.Aq wiz@danbala.ifoer.tuwien.ac.at 547.Aq wiz@danbala.ifoer.tuwien.ac.at
548provided many fixes and enhancements for the man page 548provided many fixes and enhancements for the man page
549.It 549.It
550Johnny Lam 550Johnny Lam
551.Aq jlam@netbsd.org 551.Aq jlam@netbsd.org
552provided man page fixes 552provided man page fixes
553.It 553.It
554Luke Mewburn 554Luke Mewburn
555.Aq lukem@netbsd.org 555.Aq lukem@netbsd.org
556provided many various fixes, including cgi-bin fixes and enhancements, 556provided many various fixes, including cgi-bin fixes and enhancements,
557HTTP basic authorisation support and much code clean up 557HTTP basic authorisation support and much code clean up
558.It 558.It
559Jeremy C. Reed 559Jeremy C. Reed
560.Aq reed@netbsd.org 560.Aq reed@netbsd.org
561provided several clean up fixes, and man page updates 561provided several clean up fixes, and man page updates
562.It 562.It
563Scott Reynolds 563Scott Reynolds
564.Aq scottr@netbsd.org 564.Aq scottr@netbsd.org
565provided various fixes 565provided various fixes
566.It 566.It
567Tyler Retzlaff 567Tyler Retzlaff
568.Aq rtr@eterna.com.au 568.Aq rtr@eterna.com.au
569provided SSL support, cgi-bin fixes and much other random other stuff 569provided SSL support, cgi-bin fixes and much other random other stuff
570.It 570.It
571rudolf 571rudolf
572.Aq netbsd@eq.cz 572.Aq netbsd@eq.cz
573provided minor compile fixes and a CGI content map fix 573provided minor compile fixes and a CGI content map fix
574.It 574.It
575Steve Rumble 575Steve Rumble
576.Aq rumble@ephemeral.org 576.Aq rumble@ephemeral.org
577provided the 577provided the
578.Fl V 578.Fl V
579option. 579option.
580.It 580.It
581Joerg Sonnenberger 581Joerg Sonnenberger
582.Aq joerg@netbsd.org 582.Aq joerg@netbsd.org
583implemented If-Modified-Since support 583implemented If-Modified-Since support
584.It 584.It
585ISIHARA Takanori 585ISIHARA Takanori
586.Aq ishit@oak.dti.ne.jp 586.Aq ishit@oak.dti.ne.jp
587provided a man page fix 587provided a man page fix
588.It 588.It
589Holger Weiss 589Holger Weiss
590.Aq holger@CIS.FU-Berlin.DE 590.Aq holger@CIS.FU-Berlin.DE
591provided http authorisation fixes 591provided http authorisation fixes
592.It 592.It
593.Aq xs@kittenz.org 593.Aq xs@kittenz.org
594provided chroot and change-to-user support, and other various fixes 594provided chroot and change-to-user support, and other various fixes
595.It 595.It
596Coyote Point provided various CGI fixes 596Coyote Point provided various CGI fixes
 597.It
 598Julio Merino added pidfile support and provided some man page fixes
597.El 599.El
598.Pp 600.Pp
599There are probably others I have forgotten (let me know if you care) 601There are probably others I have forgotten (let me know if you care)
600.Pp 602.Pp
601Please send all updates to 603Please send all updates to
602.Nm 604.Nm
603to 605to
604.Aq mrg@eterna.com.au 606.Aq mrg@eterna.com.au
605for inclusion in future releaases. 607for inclusion in future releaases.
606.Sh BUGS 608.Sh BUGS
607.Nm 609.Nm
608does not handle HTTP/1.1 chunked input from the client yet. 610does not handle HTTP/1.1 chunked input from the client yet.