| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: bozohttpd.8,v 1.27 2011/04/02 07:44:15 mbalmer Exp $ | | 1 | .\" $NetBSD: bozohttpd.8,v 1.28 2011/04/24 07:17:02 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 |
| @@ -16,27 +16,27 @@ | | | @@ -16,27 +16,27 @@ |
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 2, 2011 | | 29 | .Dd April 23, 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 |
| @@ -69,226 +69,226 @@ option for virtual hosting.) | | | @@ -69,226 +69,226 @@ option for virtual hosting.) |
69 | .Nm | | 69 | .Nm |
70 | writes logs to | | 70 | writes logs to |
71 | .Xr syslog 3 | | 71 | .Xr syslog 3 |
72 | using the ftp facility (but see the | | 72 | using the ftp facility (but see the |
73 | .Fl s | | 73 | .Fl s |
74 | option for testing.) | | 74 | option for testing.) |
75 | .Nm | | 75 | .Nm |
76 | is designed to be small, simple and relatively featureless, | | 76 | is designed to be small, simple and relatively featureless, |
77 | hopefully increasing its security. | | 77 | hopefully increasing its security. |
78 | .Ss OPTIONS | | 78 | .Ss OPTIONS |
79 | The following options are available: | | 79 | The following options are available: |
80 | .Bl -tag -width xxxcgibin | | 80 | .Bl -tag -width xxxcgibin |
81 | .It Fl b | | 81 | .It Fl b |
82 | This option enables daemon mode, where | | 82 | Enables daemon mode, where |
83 | .Nm | | 83 | .Nm |
84 | detaches from the current terminal, running in the background and | | 84 | detaches from the current terminal, running in the background and |
85 | servicing HTTP requests. | | 85 | servicing HTTP requests. |
86 | .It Fl C Ar suffix cgihandler | | 86 | .It Fl C Ar suffix cgihandler |
87 | This option adds a new CGI handler program for a particular file type. | | 87 | Adds a new CGI handler program for a particular file type. |
88 | The | | 88 | The |
89 | .Ar suffix | | 89 | .Ar suffix |
90 | should be any normal file suffix, and the | | 90 | should be any normal file suffix, and the |
91 | .Ar cgihandler | | 91 | .Ar cgihandler |
92 | should be a full path to an interpreter. | | 92 | should be a full path to an interpreter. |
93 | This option is the only way to enable CGI programs that exist | | 93 | This option is the only way to enable CGI programs that exist |
94 | outside of the cgibin directory to be executed. | | 94 | outside of the cgibin directory to be executed. |
95 | Multiple | | 95 | Multiple |
96 | .Fl C | | 96 | .Fl C |
97 | options may be passed. | | 97 | options may be passed. |
98 | .It Fl c Ar cgibin | | 98 | .It Fl c Ar cgibin |
99 | This option enables the CGI/1.1 interface. | | 99 | Enables the CGI/1.1 interface. |
100 | The | | 100 | The |
101 | .Ar cgibin | | 101 | .Ar cgibin |
102 | directory is expected to contain the CGI programs to be used. | | 102 | directory is expected to contain the CGI programs to be used. |
103 | .Nm | | 103 | .Nm |
104 | looks for URL's in the form of | | 104 | looks for URL's in the form of |
105 | .Em /cgi-bin/\*[Lt]scriptname\*[Gt] | | 105 | .Em /cgi-bin/\*[Lt]scriptname\*[Gt] |
106 | where | | 106 | where |
107 | .Aq scriptname | | 107 | .Aq scriptname |
108 | is a valid CGI program in the | | 108 | is a valid CGI program in the |
109 | .Ar cgibin | | 109 | .Ar cgibin |
110 | directory. | | 110 | directory. |
111 | In other words, all CGI URL's must begin with | | 111 | In other words, all CGI URL's must begin with |
112 | .Em \%/cgi-bin/ . | | 112 | .Em \%/cgi-bin/ . |
113 | Note that the CGI/1.1 interface is not available with | | 113 | Note that the CGI/1.1 interface is not available with |
114 | .Em ~user | | 114 | .Em ~user |
115 | translation. | | 115 | translation. |
116 | .It Fl e | | 116 | .It Fl e |
117 | This option causes | | 117 | Causes |
118 | .Nm | | 118 | .Nm |
119 | to not clear the environment when used with either the | | 119 | to not clear the environment when used with either the |
120 | .Fl t | | 120 | .Fl t |
121 | or | | 121 | or |
122 | .Fl U | | 122 | .Fl U |
123 | options. | | 123 | options. |
124 | .It Fl f | | 124 | .It Fl f |
125 | This option stops the | | 125 | Stops the |
126 | .Fl b | | 126 | .Fl b |
127 | flag from | | 127 | flag from |
128 | .Nm | | 128 | .Nm |
129 | detaching from the tty and going into the background. | | 129 | detaching from the tty and going into the background. |
130 | .It Fl H | | 130 | .It Fl H |
131 | This option causes directory index mode to hide files and directories | | 131 | Causes directory index mode to hide files and directories |
132 | that start with a period, except for | | 132 | that start with a period, except for |
133 | .Pa .. . | | 133 | .Pa .. . |
134 | Also see | | 134 | Also see |
135 | .Fl X . | | 135 | .Fl X . |
136 | .It Fl I Ar port | | 136 | .It Fl I Ar port |
137 | This option is only valid with the | | 137 | Causes |
138 | .Fl b | | | |
139 | option. | | | |
140 | It causes | | | |
141 | .Ar port | | 138 | .Ar port |
142 | to use used as the port to bind daemon mode. | | 139 | to use used as the port to bind daemon mode. |
143 | The default is the | | 140 | The default is the |
144 | .Dq http | | 141 | .Dq http |
145 | port. | | 142 | port. |
146 | .It Fl i Ar address | | | |
147 | This option is only valid with the | | 143 | This option is only valid with the |
148 | .Fl b | | 144 | .Fl b |
149 | option. | | 145 | option. |
150 | It causes | | 146 | .It Fl i Ar address |
| | | 147 | Causes |
151 | .Ar address | | 148 | .Ar address |
152 | to use used as the address to bind daemon mode. | | 149 | to use used as the address to bind daemon mode. |
153 | If otherwise unspecified, the address used to bind is derived from the | | 150 | If otherwise unspecified, the address used to bind is derived from the |
154 | .Ar myname , | | 151 | .Ar myname , |
155 | which defaults to the name returned by | | 152 | which defaults to the name returned by |
156 | .Xr gethostname 3 . | | 153 | .Xr gethostname 3 . |
157 | Only the last | | 154 | Only the last |
158 | .Fl i | | 155 | .Fl i |
159 | option is used. | | 156 | option is used. |
| | | 157 | This option is only valid with the |
| | | 158 | .Fl b |
| | | 159 | option. |
160 | .It Fl M Ar suffix type encoding encoding11 | | 160 | .It Fl M Ar suffix type encoding encoding11 |
161 | This option adds a new entry to the table that converts file suffixes to | | 161 | Adds a new entry to the table that converts file suffixes to |
162 | content type and encoding. | | 162 | content type and encoding. |
163 | This option takes four additional arguments containing | | 163 | This option takes four additional arguments containing |
164 | the file prefix, its | | 164 | the file prefix, its |
165 | .Dq Content-Type , | | 165 | .Dq Content-Type , |
166 | .Dq Content-Encoding , | | 166 | .Dq Content-Encoding , |
167 | and | | 167 | and |
168 | .Dq Content-Encoding | | 168 | .Dq Content-Encoding |
169 | for HTTP/1.1 connections, respectively. | | 169 | for HTTP/1.1 connections, respectively. |
170 | If any of these are a single dash | | 170 | If any of these are a single dash |
171 | .Pq Dq - , | | 171 | .Pq Dq - , |
172 | the empty string is used instead. | | 172 | the empty string is used instead. |
173 | Multiple | | 173 | Multiple |
174 | .Fl M | | 174 | .Fl M |
175 | options may be passed. | | 175 | options may be passed. |
176 | .It Fl n | | 176 | .It Fl n |
177 | This option stops | | 177 | Stops |
178 | .Nm | | 178 | .Nm |
179 | from doing IP address to name resolution of hosts for setting the | | 179 | from doing IP address to name resolution of hosts for setting the |
180 | .Ev REMOTE_HOST | | 180 | .Ev REMOTE_HOST |
181 | variable before running a CGI program. | | 181 | variable before running a CGI program. |
182 | This option has no effect without the | | 182 | This option has no effect without the |
183 | .Fl c | | 183 | .Fl c |
184 | option. | | 184 | option. |
185 | .It Fl P Ar pidfile | | 185 | .It Fl P Ar pidfile |
186 | This option causes | | 186 | Causes |
187 | .Nm | | 187 | .Nm |
188 | to create a pid file in | | 188 | to create a pid file in |
189 | .Ar pidfile | | 189 | .Ar pidfile |
190 | when run in daemon mode with the | | 190 | when run in daemon mode with the |
191 | .Fl b | | 191 | .Fl b |
192 | option. | | 192 | option. |
193 | .It Fl p Ar pubdir | | 193 | .It Fl p Ar pubdir |
194 | This option changes the default user directory for | | 194 | Changes the default user directory for |
195 | .Em /~user/ | | 195 | .Em /~user/ |
196 | translations from | | 196 | translations from |
197 | .Dq public_html | | 197 | .Dq public_html |
198 | to | | 198 | to |
199 | .Ar pubdir . | | 199 | .Ar pubdir . |
200 | .It Fl r | | 200 | .It Fl r |
201 | This option forces pages besides the | | 201 | Forces pages besides the |
202 | .Dq index.html | | 202 | .Dq index.html |
203 | (see the | | 203 | (see the |
204 | .Fl X | | 204 | .Fl X |
205 | option) page to require that the Referrer: header be present and | | 205 | option) page to require that the Referrer: header be present and |
206 | refer to this web server, otherwise a redirect to the | | 206 | refer to this web server, otherwise a redirect to the |
207 | .Dq index.html | | 207 | .Dq index.html |
208 | page will be returned instead. | | 208 | page will be returned instead. |
209 | .It Fl S Ar server_software | | 209 | .It Fl S Ar server_software |
210 | This option sets the internal server version to | | 210 | Sets the internal server version to |
211 | .Ar server_software . | | 211 | .Ar server_software . |
212 | .It Fl s | | 212 | .It Fl s |
213 | This option forces logging to be set to stderr always. | | 213 | Forces logging to be set to stderr always. |
214 | .It Fl t Ar chrootdir | | 214 | .It Fl t Ar chrootdir |
215 | When this option is used, | | 215 | Makes |
216 | .Nm | | 216 | .Nm |
217 | will chroot to the specified directory | | 217 | chroot to the specified directory |
218 | before answering requests. | | 218 | before answering requests. |
219 | Every other path should be specified relative | | 219 | Every other path should be specified relative |
220 | to the new root, if this option is used. | | 220 | to the new root, if this option is used. |
221 | Note that the current environment | | 221 | Note that the current environment |
222 | is normally replaced with an empty environment with this option, unless the | | 222 | is normally replaced with an empty environment with this option, unless the |
223 | .Fl e | | 223 | .Fl e |
224 | option is also used. | | 224 | option is also used. |
225 | .It Fl U Ar username | | 225 | .It Fl U Ar username |
226 | This option causes | | 226 | Causes |
227 | .Nm | | 227 | .Nm |
228 | to switch to the user and the groups of | | 228 | to switch to the user and the groups of |
229 | .Ar username | | 229 | .Ar username |
230 | after initialization. | | 230 | after initialization. |
231 | This option, like | | 231 | This option, like |
232 | .Fl t | | 232 | .Fl t |
233 | above, causes | | 233 | above, causes |
234 | .Nm | | 234 | .Nm |
235 | to clear the environment unless the | | 235 | to clear the environment unless the |
236 | .Fl e | | 236 | .Fl e |
237 | option is given. | | 237 | option is given. |
238 | .It Fl u | | 238 | .It Fl u |
239 | This option enables the transformation of Uniform Resource Locators of | | 239 | Enables the transformation of Uniform Resource Locators of |
240 | the form | | 240 | the form |
241 | .Em /~user/ | | 241 | .Em /~user/ |
242 | into the directory | | 242 | into 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 |
246 | option above). | | 246 | option above). |
247 | .It Fl V | | 247 | .It Fl V |
248 | This option sets the default virtual host directory to | | 248 | Sets the default virtual host directory to |
249 | .Ar slashdir . | | 249 | .Ar slashdir . |
250 | If no directory exists in | | 250 | If no directory exists in |
251 | .Ar virtualroot | | 251 | .Ar virtualroot |
252 | for the request, then | | 252 | for the request, then |
253 | .Ar slashdir | | 253 | .Ar slashdir |
254 | will be used. | | 254 | will be used. |
255 | The default behaviour is to return 404 (Not Found.) | | 255 | The default behaviour is to return 404 (Not Found.) |
256 | .It Fl v Ar virtualroot | | 256 | .It Fl v Ar virtualroot |
257 | This option enables virtual hosting support. | | 257 | Enables virtual hosting support. |
258 | Directories in | | 258 | Directories in |
259 | .Ar virtualroot | | 259 | .Ar virtualroot |
260 | will be searched for a matching virtual host name, when parsing | | 260 | will be searched for a matching virtual host name, when parsing |
261 | the HTML request. | | 261 | the HTML request. |
262 | If a matching name is found, it will be used | | 262 | If a matching name is found, it will be used |
263 | as both the server's real name, | | 263 | as both the server's real name, |
264 | .Op Ar myname , | | 264 | .Op Ar myname , |
265 | and as the | | 265 | and as the |
266 | .Ar slashdir . | | 266 | .Ar slashdir . |
267 | See the | | 267 | See the |
268 | .Sx EXAMPLES | | 268 | .Sx EXAMPLES |
269 | section for an example of using this option. | | 269 | section for an example of using this option. |
270 | .It Fl X | | 270 | .It Fl X |
271 | This option enables directory indexing. | | 271 | Enables directory indexing. |
272 | A directory index will be generated only when the default file (i.e. | | 272 | A directory index will be generated only when the default file (i.e. |
273 | .Pa index.html | | 273 | .Pa index.html |
274 | normally) is not present. | | 274 | normally) is not present. |
275 | .It Fl x Ar index | | 275 | .It Fl x Ar index |
276 | This option changes the default file read for directories from | | 276 | Changes the default file read for directories from |
277 | .Dq index.html | | 277 | .Dq index.html |
278 | to | | 278 | to |
279 | .Ar index . | | 279 | .Ar index . |
280 | .It Fl Z Ar certificate_path privatekey_path | | 280 | .It Fl Z Ar certificate_path privatekey_path |
281 | This option sets the path to the server certificate file and the private key file | | 281 | Sets the path to the server certificate file and the private key file |
282 | in pem format. | | 282 | in pem format. |
283 | It also causes | | 283 | It also causes |
284 | .Nm | | 284 | .Nm |
285 | to start SSL mode. | | 285 | to start SSL mode. |
286 | .El | | 286 | .El |
287 | .Pp | | 287 | .Pp |
288 | Note that in | | 288 | Note that in |
289 | .Nm | | 289 | .Nm |
290 | versions 20031005 and prior that supported the | | 290 | versions 20031005 and prior that supported the |
291 | .Fl C | | 291 | .Fl C |
292 | and | | 292 | and |
293 | .Fl M | | 293 | .Fl M |
294 | options, they took a single space-separated argument that was parsed. | | 294 | options, they took a single space-separated argument that was parsed. |