 |
Writing
Apache Modules
with Perl and C
|
|
This is the home site of Writing Apache Modules with Perl and C,
a book about creating Web server modules using the Apache API,
written by Lincoln Stein and
Doug MacEachern.
The book (ISBN 1-56592-567-X) is published by
O'Reilly & Associates and was released on April 2nd, 1999.
It can be purchased online from
O'Reilly
and
Amazon.com.
Online Chapters
We have made several of the chapters available online:
- Chapter 1 - Server-Side Programming with Apache
- Chapter 2 - A First Module
- Chapter 3 - The Apache Module Architecture and API
- Chapter 4 - Content Handlers
- Chapter 5 - Maintaining State
- Chapter 6 - Authentication & Authorization
- Chapter 7 - Handling Other Request Phases
- Chapter 8 - Customizing the Apache Configuration Process
- Chapter 9 - Perl API Reference Guide
- Chapter 10 - C API and Reference Guide, Part I
- Chapter 11 - C API and Reference Guide, Part II
Source Code
The source code from the book, including modules, scripts and other items is
available for download.
We have ported several Perl modules from the book to
C modules that are not included in the book.
Online demos
- Apache::Magick
- From Chapter 4: Content Handlers, a cool demo of Apache::Magick, an
automatic image file format conversion module.
- TreeBrowser
- From Chapter 4: Content Handlers, Apache::TreeBrowser, a virtual document tree
managed by clever use of the path() field.
- Hangman
- From Chapter 5: Maintaining State,
check out the on-line hangman games.
- Gender-Based Authentication
- From Chapter 6: Authentication & Authorization,
a custom authorization module that authorizes on the basis of
the apparent gender of the user name. To test this module,
try to fetch the URL http://www.modperl.com/ladies_only.
When the authorization dialog comes up, first try a few men's names, like
Fred or James (with any non-empty password). Then try a woman's name,
like Wendy. After successfully authenticating, you will need to exit
the browser if you wish to try again. Otherwise the browser
will remember your username and password and you will not see
the authentication dialog again.
Other demos
Check
out the new Apache::MP3 module, which allows you
to stream MP3 files and construct playlists. Turn your Web server
into your very own MP3.com (for personal use only, of course)!
Source can be found in Lincoln's
directory on CPAN.
See also:
Webmaster
Last modified: Sun Jan 7 22:27:42 EST 2001