Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd initial import of bozohttpd 20100920. the onl...
details: https://anonhg.NetBSD.org/src/rev/2404e7a02fa0
branches: trunk
changeset: 757753:2404e7a02fa0
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Sep 20 23:07:21 2010 +0000
description:
initial import of bozohttpd 20100920. the only change missing in here is:
o fix dynamic CGI content maps, from rudolf
diffstat:
libexec/httpd/bozohttpd.html8 | 618 ++++++++++++++++++++++++++++++++++++++++++
libexec/httpd/main.c | 10 +-
2 files changed, 623 insertions(+), 5 deletions(-)
diffs (truncated from 656 to 300 lines):
diff -r 455693822e91 -r 2404e7a02fa0 libexec/httpd/bozohttpd.html8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libexec/httpd/bozohttpd.html8 Mon Sep 20 23:07:21 2010 +0000
@@ -0,0 +1,618 @@
+<html>
+<head>
+ <title>
+ September 20, 2010 BOZOHTTPD 8 BOZOS
+
+ </title>
+ <style type="text/css">
+ <!--
+ body { margin-left:4%; }
+ H1, H2, H3, H4, H5 {
+ color: maroon; padding: 4pt; margin-left: -4%;
+ border: solid; border-width: thin; width: 100%;
+ background: rgb(204,204,255)
+ }
+ -->
+ </style>
+</head>
+<body bgcolor="#FFFFFF" text="#000000">
+ <h3 id="NAME">
+ NAME
+ </h3>
+<b>bozohttpd</b>
+- hyper text transfer protocol version 1.1 daemon
+ <h3 id="SYNOPSIS">
+ SYNOPSIS
+ </h3>
+<b>bozohttpd</b>
+[<b>-</b><b>HVXbefnrus</b>]
+[<b>-</b><b>C</b><i></i><i> suffix</i><i> cgihandler</i>]
+[<b>-</b><b>I</b><i></i><i> port</i>]
+[<b>-</b><b>M</b><i></i><i> suffix</i><i> type</i><i> encoding</i><i> encoding11</i>]
+[<b>-</b><b>S</b><i></i><i> server_software</i>]
+[<b>-</b><b>c</b><i></i><i> cgibin</i>]
+[<b>-</b><b>i</b><i></i><i> address</i>]
+[<b>-</b><b>p</b><i></i><i> pubdir</i>]
+[<b>-</b><b>t</b><i></i><i> chrootdir</i>]
+[<b>-</b><b>v</b><i></i><i> virtualroot</i>]
+[<b>-</b><b>x</b><i></i><i> index</i>]
+[<b>-</b><b>Z</b><i></i><i> cert</i><i> privkey</i>]
+<i></i><i>slashdir</i>
+[<i></i><i>myname</i>]
+ <h3 id="DESCRIPTION">
+ DESCRIPTION
+ </h3>
+The
+<b>bozohttpd</b>
+program reads a
+<em></em><em>HTTP</em>
+request from the standard input, and sends a reply to the standard output.
+Besides ~user translation and virtual hosting support (see below), all file
+requests are from
+<i></i><i>slashdir</i>
+directory.
+The server uses
+<i></i><i>myname</i>
+as its name, which defaults to the local hostname, obtained from
+<a href="../html3/gethostname.html">gethostname(3)</a>
+(but see the
+<b>-</b><b>v</b>
+option for virtual hosting.)
+<b>bozohttpd</b>
+writes logs to
+<a href="../html3/syslog.html">syslog(3)</a>
+using the ftp facaility (but see the
+<b>-</b><b>s</b>
+option for testing.)
+<b>bozohttpd</b>
+is designed to be small, simple and relatively featureless,
+hopefully increasing its security.
+ <h4 id="OPTIONS">
+ OPTIONS
+ </h4>
+The following options are available:
+<dl compact>
+<p><dt><b>-</b><b>b</b><dd>
+This option enables daemon mode, where
+<b>bozohttpd</b>
+detaches from the current terminal, running in the background and
+servicing HTTP requests.
+<p><dt><b>-</b><b>C</b><i></i><i> suffix</i><i> cgihandler</i><dd>
+This option adds a new CGI handler program for a particular file type.
+The
+<i></i><i>suffix</i>
+should be any normal file suffix, and the
+<i></i><i>cgihandler</i>
+should be a full path to an interpreter.
+This option is the only way to enable CGI programs that exist
+outside of the cgibin directory to be executed.
+Multiple
+<b>-</b><b>C</b>
+options may be passed.
+<p><dt><b>-</b><b>c</b><i></i><i> cgibin</i><dd>
+This option enables the CGI/1.1 interface.
+The
+<i></i><i>cgibin</i>
+directory is expected to contain the CGI programs to be used.
+<b>bozohttpd</b>
+looks for URL's in the form of
+<em></em><em>/cgi-bin/<scriptname></em>
+where
+<scriptname>
+is a valid CGI program in the
+<i></i><i>cgibin</i>
+directory.
+In other words, all CGI URL's must begin with
+<em></em><em>/cgi-bin/</em>.
+Note that the CGI/1.1 interface is not available with
+<em></em><em>~user</em>
+translation.
+<p><dt><b>-</b><b>e</b><dd>
+This option causes
+<b>bozohttpd</b>
+to not clear the environment when used with either the
+<b>-</b><b>t</b>
+or
+<b>-</b><b>U</b>
+options.
+<p><dt><b>-</b><b>f</b><dd>
+This option stops the
+<b>-</b><b>b</b>
+flag from
+<b>bozohttpd</b>
+detaching from the tty and going into the background.
+<p><dt><b>-</b><b>H</b><dd>
+This option causes directory index mode to hide files and directories
+that start with a period, except for
+<code></code><code>..</code>.
+Also see
+<b>-</b><b>X</b>.
+<p><dt><b>-</b><b>I</b><i></i><i> port</i><dd>
+This option is only valid with the
+<b>-</b><b>b</b>
+option.
+It causes
+<i></i><i>port</i>
+to use used as the port to bind daemon mode.
+The default is the
+``http''
+port.
+<p><dt><b>-</b><b>i</b><i></i><i> address</i><dd>
+This option is only valid with the
+<b>-</b><b>b</b>
+option.
+It causes
+<i></i><i>address</i>
+to use used as the address to bind daemon mode.
+If otherwise unspecified, the address used to bind is derived from the
+<i></i><i>myname</i>,
+which defaults to the name returned by
+<a href="../html3/gethostname.html">gethostname(3)</a>.
+Only the last
+<b>-</b><b>i</b>
+option is used.
+<p><dt><b>-</b><b>M</b><i></i><i> suffix</i><i> type</i><i> encoding</i><i> encoding11</i><dd>
+This option adds a new entry to the table that converts file suffixes to
+content type and encoding.
+This option takes four additional arguments containing
+the file prefix, its
+``Content-Type'',
+``Content-Encoding'',
+and
+``Content-Encoding''
+for HTTP/1.1 connections, respectively.
+If any of these are a single dash
+(``-''),
+the empty string is used instead.
+Multiple
+<b>-</b><b>M</b>
+options may be passed.
+<p><dt><b>-</b><b>n</b><dd>
+This option stops
+<b>bozohttpd</b>
+from doing IP address to name resolution of hosts for setting the
+<code></code><code>REMOTE_HOST</code>
+variable before running a CGI program.
+This option has no effect without the
+<b>-</b><b>c</b>
+option.
+<p><dt><b>-</b><b>p</b><i></i><i> pubdir</i><dd>
+This option changes the default user directory for
+<em></em><em>/~user/</em>
+translations from
+``public_html''
+to
+<i></i><i>pubdir</i>.
+<p><dt><b>-</b><b>r</b><dd>
+This option forces pages besides the
+``index.html''
+(see the
+<b>-</b><b>X</b>
+option) page to require that the Referrer: header be present and
+refer to this web server, otherwise a redirect to the
+``index.html''
+page will be returned instead.
+<p><dt><b>-</b><b>S</b><i></i><i> server_software</i><dd>
+This option sets the internal server version to
+<i></i><i>server_software</i>.
+<p><dt><b>-</b><b>s</b><dd>
+This option forces logging to be set to stderr always.
+<p><dt><b>-</b><b>t</b><i></i><i> chrootdir</i><dd>
+When this option is used,
+<b>bozohttpd</b>
+will chroot to the specified directory
+before answering requests.
+Every other path should be specified relative
+to the new root, if this option is used.
+Note that the current environment
+is normally replaced with an empty environment with this option, unless the
+<b>-</b><b>e</b>
+option is also used.
+<p><dt><b>-</b><b>U</b><i></i><i> username</i><dd>
+This option causes
+<b>bozohttpd</b>
+to switch to the user and the groups of
+<i></i><i>username</i>
+after initialization.
+This option, like
+<b>-</b><b>t</b>
+above, causes
+<b>bozohttpd</b>
+to clear the environment unless the
+<b>-</b><b>e</b>
+option is given.
+<p><dt><b>-</b><b>u</b><dd>
+This option enables the transformation of Uniform Resource Locators of
+the form
+<em></em><em>/~user/</em>
+into the the directory
+<code></code><code>~user/public_html</code>
+(but see the
+<b>-</b><b>p</b>
+option above).
+<p><dt><b>-</b><b>V</b><dd>
+This option sets the default virtual host directory to
+<i></i><i>slashdir</i>.
+If no directory exists in
+<i></i><i>virtualroot</i>
+for the request, then
+<i></i><i>slashdir</i>
+will be used.
+The default behaviour is to return 404 (Not Found.)
+<p><dt><b>-</b><b>v</b><i></i><i> virtualroot</i><dd>
+This option enables virtual hosting support.
+Directories in
+<i></i><i>virtualroot</i>
+will be searched for a matching virtual host name, when parsing
+the HTML request.
+If a matching name is found, it will be used
+as both the server's real name,
+[<i></i><i>myname</i>],
+and as the
+<i></i><i>slashdir</i>.
+See the
+<a href="#EXAMPLES">EXAMPLES</a>
+section for an example of using this option.
+<p><dt><b>-</b><b>X</b><dd>
+This option enables directory indexing.
+A directory index will be generated only when the default file (i.e.
+<code></code><code>index.html</code>
+normally) is not present.
+<p><dt><b>-</b><b>x</b><i></i><i> index</i><dd>
+This option changes the default file read for directories from
+``index.html''
+to
+<i></i><i>index</i>.
+<p><dt><b>-</b><b>Z</b><i></i><i> certificate_path</i><i> privatekey_path</i><dd>
+This option sets the path to the server certificate file and the private key file
+in pem format.
+It also causes
+<b>bozohttpd</b>
+to start SSL mode.
+</dl>
+ <p>
+Note that in
+<b>bozohttpd</b>
+versions 20031005 and prior that supported the
+<b>-</b><b>C</b>
+and
+<b>-</b><b>M</b>
+options, they took a single space-separated argument that was parsed.
+since version 20040828, they take multiple options (2 in the case of
+<b>-</b><b>C</b>
+and 4 in the case of
+<b>-</b><b>M</b>.)
+ <h4 id="INETD CONFIGURATION">
+ INETD CONFIGURATION
+ </h4>
+As
+<b>bozohttpd</b>
+uses
+<a href="../html8/inetd.html">inetd(8)</a>
+by default to process incoming TCP connections for HTTP requests
+(but see the
+<b>-</b><b>b</b>
+option),
+<b>bozohttpd</b>
Home |
Main Index |
Thread Index |
Old Index