1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
--- bozohttpd.8.orig 2024-02-04 05:55:04 UTC
+++ bozohttpd.8
@@ -373,12 +373,26 @@ and 4 in the case of
.Fl C
and 4 in the case of
.Fl M . )
+.Ss DEFAULT CONFIGURATION
+On
+.Fx ,
+.Nm
+can be enabled as the default web server by adding the following options to
+.Pa /etc/rc.conf
+:
+.Bd -literal
+bozohttpd_enable (bool): Set it to "YES" to enable bozohttpd.
+ Default is "NO".
+bozohttpd_flags (str): Options to pass to bozohttpd.
+ Default is "-b -t /var/empty -U nobody /".
+ The last argument, slashdir, is required.
+.Ed
.Ss INETD CONFIGURATION
As
.Nm
-uses
+normally uses
.Xr inetd 8
-by default to process incoming TCP connections for HTTP requests
+to process incoming TCP connections for HTTP requests
(but see the
.Fl b
option),
@@ -390,8 +404,8 @@ entry would be:
.Xr inetd.conf 5
entry would be:
.Bd -literal
-http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd /var/www
-http stream tcp6 nowait:600 _httpd /usr/libexec/httpd httpd /var/www
+http stream tcp nowait:600 www /usr/local/bin/bozohttpd httpd /var/www
+http stream tcp6 nowait:600 www /usr/local/bin/bozohttpd httpd /var/www
.Ed
.Pp
This would serve web pages from
@@ -405,7 +419,7 @@ Using the
default of 40.
.Pp
Using the
-.Nx
+.Fx
.Xr inetd 8 ,
you can provide multiple IP-address based HTTP servers by having multiple
listening ports with different configurations.
@@ -457,15 +471,15 @@ On
.Ed
.Pp
On
-.Nx ,
+.Fx ,
the
-.Xr pwhash 1
+.Xr openssl-passwd 1
utility may be used to generate hashed passwords.
.Pp
-While
+While the
+.Fx
+port of
.Nm
-distributed with
-.Nx
has support for HTTP Basic Authorization enabled by default,
in the portable distribution it is excluded.
Compile
@@ -475,21 +489,21 @@ It may require linking with the crypt library, using
on the compiler command line to enable this support.
It may require linking with the crypt library, using
.Dq -lcrypt .
-.Ss BLOCKLIST SUPPORT
+.Ss BLACKLIST SUPPORT
On
-.Nx ,
+.Fx ,
.Nm
supports
-.Xr blocklistd 8
+.Xr blacklistd 8
by default.
The support can be disabled with the
-.Dq -DNO_BLOCKLIST_SUPPORT
+.Dq -DNO_BLACKLIST_SUPPORT
compilation option.
.Pp
Upon occurrence,
.Nm
reports two HTTP status codes to
-.Xr blocklistd 8
+.Xr blacklistd 8
as failures:
.Em 401
(``Unauthorized'')
@@ -501,7 +515,7 @@ A successful authorization decreases the counter kept
is the one received upon authorization failure with the
HTTP Basic Authorization mechanism.
A successful authorization decreases the counter kept by
-.Xr blocklistd 8 .
+.Xr blacklistd 8 .
.Pp
Note that the implementation of the HTTP Basic Authorization mechanism
uses a redirection; a status code
@@ -510,7 +524,7 @@ is reported as two failures to
Therefore, a single authorization failure of
.Pa .htpasswd
is reported as two failures to
-.Xr blocklistd 8 ,
+.Xr blacklistd 8 ,
but no failures are recorded upon successful authorization
due to the decrease of the failure counter.
.Ss SSL SUPPORT
@@ -603,7 +617,7 @@ entry like:
.Xr inetd.conf 5
entry like:
.Bd -literal
-http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd -v /var/vroot /var/www
+http stream tcp nowait:600 www /usr/local/bin/bozohttpd httpd -v /var/vroot /var/www
.Ed
.Pp
and inside
@@ -621,7 +635,7 @@ Typically this will be like:
option to specify a CGI handler for a particular file type.
Typically this will be like:
.Bd -literal
-httpd -C .php /usr/pkg/bin/php-cgi /var/www
+bozohttpd -C .php /usr/pkg/bin/php-cgi /var/www
.Ed
.Pp
Note that a plain script interpreter can not be used directly as a cgihandler,
@@ -634,7 +648,7 @@ It would be invoked like:
.Pp
It would be invoked like:
.Bd -literal
-httpd -C .pl /www-scripts/bin/run.perl /var/www
+bozohttpd -C .pl /www-scripts/bin/run.perl /var/www
.Ed
and the script could look like:
.Bd -literal
@@ -821,7 +835,7 @@ provided support for
.An Jukka Ruohonen
.Aq Mt jruoho@NetBSD.org
provided support for
-.Xr blocklistd 8
+.Xr blacklistd 8
.It
.An Thor Lancelot Simon
.Aq Mt tls@NetBSD.org
|