Converted to docbook sgml 5.1 article from 3.0 book, did some language cleanup

and moved copyright to David Merrill from the original author.
This commit is contained in:
david 2001-04-24 19:35:07 +00:00
parent 4fc3b450cf
commit b73729f2c1
1 changed files with 74 additions and 45 deletions

View File

@ -1,13 +1,40 @@
<!DOCTYPE book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>
<book id="index">
<bookinfo>
<title>PHHTTPD</title>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" []>
<article>
<articleinfo>
<title>PHHTTPD Userland HTTP Accelerator HOWTO</title>
<author><firstname>Zach</firstname><surname>Brown</surname></author>
<author><firstname>David</firstname><othername role="mi">C.</othername><surname>Merrill</surname></author>
<copyright><year>2000</year><holder>Zach Brown</holder></copyright>
</bookinfo>
<copyright><year>2001</year><holder>David C. Merrill</holder></copyright>
<pubdate>2001-04-24</pubdate>
<abstract><para>This document explains the use of the phhttpd http server
accelerator under Linux.</para>
<para>As of the later 2.3 kernels, and offically in 2.4 and later, the TUX
http accelerator is included in the standard Linux kernel tree.
Therefore, this document should be considered obsolete for most users.
</para>
</abstract>
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>2001-04-24</date>
<authorinitials>DCM</authorinitials>
<revremark>Converted to DocBook 4.1 article, with some minor language cleanup.
Copyright passed from Zach Brown to David C. Merrill.</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>2000</date>
<authorinitials>ZB</authorinitials>
<revremark>Initial release.</revremark>
</revision>
</revhistory>
</articleinfo>
<!--- ************************************************** -->
<chapter><title>Introduction</title>
<sect1 id="introduction"><title>Introduction</title>
<para>
phhttpd is an HTTP accelerator. It serves fast static HTTP fetches from a
local file-system
@ -15,7 +42,7 @@ and passes slower dynamic requests back to a waiting server. It features
a lean networking I/O core and an aggressive content cache that help it
perform its job efficiently.
</para>
<sect1><title>Architectural Overview</title>
<sect2><title>Architectural Overview</title>
<para>
phhttpd features a very slim I/O core. It does all its networking
work using non-blocking system calls driven by whatever event model
@ -27,9 +54,9 @@ to handle as many client connections as the event model dictates.
phhttpd's job is to serve static content as quickly as it possibly
can. To do this it maintains a cache of content in memory. When
a request is serviced, phhttpd saves a reference to the on disk content
and whatever HTTP headers are dependent on the content. Next time
and whatever HTTP headers are dependent on the content. The next time
a request for this content is received, phhttpd can service it
very quickly. This cache can be prepopulated-populated at run time, or can
very quickly. This cache can be prepopulated (populated at run time), or can
be built dynamically as requests come in. Its size may also be
capped by the administrator so that it doesn't overwhelm a system.
</para>
@ -40,8 +67,8 @@ are evenly balanced among the running threads, regardless of what
content they may be serving. Connections are served by the thread
that accepted them until the transfer is done.
</para>
</sect1>
<sect1><title>Supported Systems</title>
</sect2>
<sect2><title>Supported Systems</title>
<para>
phhttpd is currently only expected to build and run on Linux
systems using glibc2.1 under a kernel that supports passing POLL*
@ -52,11 +79,11 @@ kernels or a 2.2.x kernel that has been patched.
I badly want this to change. If you're interested in doing porting
work to other Operating Systems, please do let me know.
</para>
</sect2>
</sect1>
</chapter>
<!--- ************************************************** -->
<chapter><title>Configuration File</title>
<sect1><title>Overview</title>
<sect1 id="configuration"><title>Configuration File</title>
<sect2><title>Overview</title>
<para>
phhttpd uses an XML config file format to express how it should behave
while running. More information on XML may be found near
@ -74,8 +101,8 @@ that describe properties of that only apply to a virtual server.
There will only be one global section while multiple virtual sections
are allowed.
</para>
</sect1>
<sect1><title>Global config section</title>
</sect2>
<sect2><title>Global Config Section</title>
<para>
The global section defines properties of the running server that don't
apply to a single virtual server. It should be enclosed in
@ -136,11 +163,11 @@ shorten the amount of time it takes to build cached responses.
</variablelist>
</para>
</sect1>
</sect2>
<sect1><title>Virtual Servers</title>
<para>A Virtual Server can be thought of the abstraction of serving up a content tree
( <quote>docroot</quote> in <command>apache</command> speak). There are a set of attributes
<sect2><title>Virtual Servers</title>
<para>A Virtual Server can be thought of as the abstraction serving up a content tree
( <quote>docroot</quote> in <command>Apache</command> speak). There are a set of attributes
that are used to define a virtual server. These attributes are used to decide which
virtual server will process a client's request. Then there are attributes which define
how the content is served.</para>
@ -153,7 +180,7 @@ file has a docroot attribute that must be set.</para>
There can be as many virtual sections in the configuration file as one likes.
</para>
<para>
<variablelist><title>Global config entities</title>
<variablelist><title>Global Config Entities</title>
<varlistentry><term><SGMLTag>
md5
@ -200,25 +227,26 @@ be written to during operation. See the following section on logging.
</para> </listitem> </varlistentry>
</variablelist>
</para>
</sect2>
</sect1>
</chapter>
<!--- ************************************************** -->
<chapter><title>Logging</title>
<sect1 id="logging"><title>Logging</title>
<para><quote>All kids love log!</quote></para>
<sect1><title>Overview</title>
<sect2><title>Overview</title>
<para>
phhttpd maintains log buffers for each log it writes too. Logged events are put in
phhttpd maintains log buffers for each log it writes to. Logged events are put in
these buffers at reporting time rather than being immediately written to disk. These
logs are written as they are filled during normal operation, or at regular intervals.
This greatly reduces the performance impact of keeping detailed logs.
</para>
</>
<sect1><title>Configuration</><para>
phhttpd keeps interesting logs on a virtual server granularity. The action of recording
lots is specified by including an entity in the log section of a virtual for the
log source that wants to be kept. There is an
entity for each source of logging, and attributes to that entity define where it
is logged to. It looks something like this:<programlisting>
</sect2>
<sect2><title>Configuration</><para>
phhttpd keeps interesting logs on a virtual server granularity.
You can specify which logs you wish to keep by including an entity
in the log section of a virtual server for each source you wish to log.
There is an entity for each source of logging, and attributes to that
entity define where it is logged.
It looks something like this:<programlisting>
&lt;logs&gt;
&lt;LOGSOURCE mode=OCTALMODE file=PATH&gt;
...
@ -226,7 +254,7 @@ is logged to. It looks something like this:<programlisting>
</para>
<para><varname>mode</varname> is the octal permissions mode of the file that is
to be opened. As it is parsed by dumb routines, a leading 0 is highly recommended.
<varname>file</varname>is the file the logged events will be written to.
<varname>file</varname> is the file to which the logged events will be written.
The LOG_SOURCE is one of:
<informaltable frame=none><tgroup cols=2><tbody>
<row><entry>access</entry><entry>Successfully answered requests</entry></row>
@ -235,8 +263,9 @@ The value given in the 'User-Agent' HTTP request header</entry></row>
<row><entry>referer</entry><entry>
The string given in the 'Referer' HTTP request header</entry></row>
</tbody></tgroup></informaltable>
</para></sect1>
<sect1><title>Format and Strange Behaviour</title>
</para></sect2>
<sect2><title>Format and Strange Behaviour</title>
<para>
phhttpd log entries are contained with a single line in a text file. They contain
the time the log entry was written, an opaque token that is associated with the connection
@ -262,11 +291,11 @@ multiple threads are sharing an output file the resulting entries may not be wri
in chronological order. It is up to the parsing programs to use the 'time' field
to sort by, if they care about chronological order.
</para>
</sect2>
</sect1>
</chapter>
<!--- ************************************************** -->
<chapter><title>Run Time Facilities</title>
<sect1><title>Overview</title>
<sect1 id="runtime"><title>Run Time Facilities</title>
<sect2><title>Overview</title>
<para>While phhttpd is running it listens to a 'control' socket for messages from the
administrator. The currently provided <command>phhttpd_ctl</command> program allows
the administrator to minimally interact with phhttpd. This provides both control
@ -275,8 +304,8 @@ and status reporting.
<command>phhttpd_ctl</command> always wants a <parameter>--control</parameter> argument
that specifies the control socket of the running phhttpd daemon. This should match
the &lt;control&gt; tag specified in the config file.
</para></sect1>
<sect1><title>Log Rotating</title>
</para></sect2>
<sect2><title>Log Rotating</title>
<para>
phhttpd can be told to rotate its logs so that existing logs may be processed.
</para><para>
@ -291,13 +320,13 @@ to close the existing file logs and reopen the files with the filenames that wer
This implies that an external entity has moved the files to new names and wants phhttpd
to stop using them.
</para>
</sect1>
<sect1><title>Status Reporting</title>
</sect2>
<sect2><title>Status Reporting</title>
<para>
The <parameter>--status</parameter> argument to <command>phhttpd_ctl</command> tells phhttpd
to return a quick status blurb about the server. It contains miscellaneous information
about the running state of the server.
</para> </sect1>
</chapter>
</para> </sect2>
</sect1>
<!--- ************************************************** -->
</book>
</article>