phhttpd-HOWTO(1).pdf
(
21 KB
)
Pobierz
PHHTTPD HTTP Accelerator HOWTO
PHHTTPD HTTP Accelerator HOWTO
Zach Brown
David C. Merrill
Copyright © 2000 by Zach Brown
Copyright © 2001 by David C. Merrill
2001−04−24
Revision History
Revision 1.1 2001−04−24 Revised by: DCM
Converted to DocBook 4.1 article, with some minor language cleanup. Copyright passed from Zach Brown
to David C. Merrill.
Revision 1.0
2000
Revised by: ZB
Initial release.
This document explains the use of the phhttpd http server accelerator under Linux.
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.
PHHTTPD HTTP Accelerator HOWTO
Table of Contents
1. Copyright and License.
...................................................................................................................................1
2. Introduction.
....................................................................................................................................................2
2.1. Architectural Overview.
....................................................................................................................2
2.2. Supported Systems.
...........................................................................................................................2
3. Configuration File.
..........................................................................................................................................3
3.1. Overview.
..........................................................................................................................................3
3.2. Global Config Section
......................................................................................................................3
3.3. Virtual Servers.
.................................................................................................................................4
4. Logging..
...........................................................................................................................................................6
4.1. Overview.
..........................................................................................................................................6
4.2. Configuration.
...................................................................................................................................6
4.3. Format and Strange Behaviour.
........................................................................................................6
5. Run Time Facilities.
........................................................................................................................................8
5.1. Overview.
..........................................................................................................................................8
5.2. Log Rotating.
....................................................................................................................................8
5.3. Status Reporting.
...............................................................................................................................8
i
1. Copyright and License
This document is copyright 2000 by Zach Brown, and 2001 by David C. Merrill. It is released under the
GNU Free Documentation License, which is hereby incorporated by reference.
1. Copyright and License
1
2. Introduction
phhttpd is an HTTP accelerator. It serves fast static HTTP fetches from a local file−system 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.
2.1. Architectural Overview
phhttpd features a very slim I/O core. It does all its networking work using non−blocking system calls driven
by whatever event model is most appropriate for the host operating system. This allows a single execution
context 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. 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 be built dynamically as
requests come in. Its size may also be capped by the administrator so that it doesn't overwhelm a system.
phhttpd is a threaded stand alone daemon. The number of threads is currently statically defined at run time.
Incoming connections 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.
2.2. Supported Systems
phhttpd is currently only expected to build and run on Linux systems using glibc2.1 under a kernel that
supports passing POLL* information over real−time SIGIO signals. This means later 2.3.x 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.
2. Introduction
2
3. Configuration File
3.1. Overview
phhttpd uses an XML config file format to express how it should behave while running. More information on
XML may be found near
http://www.w3.org/XML/
phhttpd's configuration centers around the concept of virtual servers. For us, a virtual server may be thought
of as the merging of a document tree and the actions phhttpd takes while serving that content.
phhttpd.conf may be thought of as having two main sections. The global section, which defines properties
that are consistent across the entire running phhttpd server, and multiple virtual sections that describe
properties of that only apply to a virtual server. There will only be one global section while multiple virtual
sections are allowed.
3.2. Global Config Section
The global section defines properties of the running server that don't apply to a single virtual server. It should
be enclosed in
Global config entities
cache max=NUM
Sets the maximum number of cached responses that will be held in memory. Each cached responses
holds a minimal amount of memory. More importantly, each cached response holds an open file
descriptor to the file with real content and an
mmap()
ed region of that content. phhttpd will start
pruning the cache when it notices either of these two resources coming under pressure, but has no
way to easily deduce that its running low on memory. The administrator may set this value to set an
upper bound on the number of responses to keep in memory.
control file=PATH
This specifies the file that will be used to talk with
phhttpd_ctl
.
globallog file=PATH
This specifies the file to which global messages will be logged.
mime file=PATH
This specifies the file that contains the mapping of file extensions to MIME types. It should be of the
form:
text/sgml sgml sgm
video/mpeg mpeg mpg mpe
timeout inactivity=NUM
3. Configuration File
3
Plik z chomika:
megaskrypty
Inne pliki z tego folderu:
3-Button-Mouse(1).pdf
(58 KB)
XWindow-Overview-HOWTO(1).pdf
(30 KB)
Xterm-Title(1).pdf
(39 KB)
Xterminals(1).pdf
(30 KB)
Xinerama-HOWTO(1).pdf
(33 KB)
Inne foldery tego chomika:
Programowanie
Zgłoś jeśli
naruszono regulamin