Book Companion

Apache Tutor is companion site for Application Development with Apache - The Apache Modules Book, and presents supplementary material.

Sources used in the book

Most of the examples used in the book are taken from the author's company's work published at and from the Apache sources at (and in the download packages from

Illustrative complete modules

Modules developed for the book and/or ApacheTutor are:

Real-life modules

Other modules quoted extensively include:


There are a number of problems with alignment of example code listings, particularly in Chapter 5. These are tagged "alignment" in the table. Other errata are simple corrections.

Chapter 2 has some remaining inelegant wording and repetition, but that falls outside the scope of this errata note.

Errata corrected in the second printing
Prefacexxiiiadd comma
111svn -diff should read svn diff
4120How did "programming" as a noun get in there?
8207Missing close bracket
10271authz_dbd_hook_client_session should read authz_dbd_hook_client_login
10275Remove line that depends on other omitted lines

Serious Errors

Readers have drawn my attention to two serious errors, on pages 141 and 195. The first involves a classic loop over a bucket brigade:

	for (b = APR_BRIGADE_FIRST(bbin);
	     b != APR_BRIGADE_SENTINEL(bbin);
	     b = APR_BUCKET_NEXT(b)) {
		/* do things with b that will clobber the APR_BUCKET_NEXT
		 * pointer within the loop.  Like APR_BUCKET_REMOVE.

That won't work at all. A simple fix is to save the next pointer at the start of the loop, before doing anything that might clobber it:

	for (b = APR_BRIGADE_FIRST(bbin);
	     b != APR_BRIGADE_SENTINEL(bbin);
	     b = nextb) {
		nextb = APR_BUCKET_NEXT(b);
		/* now it's safe to clobber b's pointers */

The second is in mod_authnz_day, where the wrong form of the MD5 hash is generated: the binary data returned by apr_md5 needs to be encoded to a string, as in htdigest. This is accomplished very simply by using ap_md5 to compute the MD5 string. The code downloadable from this page has been corrected.