REVIEW - Writing Apache Modules with Perl and C - The Apache API and Mod_perl


Title:

Writing Apache Modules with Perl and C

The Apache API and Mod_perl

Author:

Lincoln Stein, Doug MacEachern

Publisher:

O'Reilly (1999)

Pages:

724pp

Reviewer:

Rick Stones

Reviewed:

December 1999

Rating:

★★★☆☆


There is a huge amount to the Apache API, and this book covers it in detail, with good explanations and loads of examples.

Apache, for anyone that doesn't know, is justifiably the Internet's number one web server (see the Web Server Survey onhttp://www.netcraft.com/). It's fast, configurable, rock solid, runs on a wide range of UN*X versions (and, of course, Linux), Win32 systems and comes complete with source code. What more could you ask? Well one think you could ask for is a way of extending the functionality in a CGI like way, but more efficient and with better access to the internals of the web server. You can have that too - with Apache Modules.

Apache modules are code written outside the web server main source, but to a defined API. The original interface was 'C' only, and whilst valuable, did require some programming care. More recently mod_perl has been implemented, which embeds a Perl interpreter in the web server, so you can write your modules in Perl, and still have full access to the Apache module API. The main drawback is the process sizes, which can get a little large, but hey, memory is cheap at the moment.

This book starts from the assumption that either you are on a UN*X/Linux machine and have the Apache sources (http://www.apache.org/), or have a running binary on Win32 systems. To get mod_perl installed on UN*X/Linux you do need to re-compile the Apache sources, which is a minor drawback, but hardly a major problem; then you need to fetch and link in the mod_perl code, also available from links on the Apache web site. Win32 users, for once, get it slightly easier and just need to fetch a .dll. All this is clearly explained in the book, though I did have a slight problem when one of the installation tests for mod_perl failed, and it took me a while to discover I had actually built myself a working mod_perl enabled Apache at the first attempt.

The initial chapters of the book walk you carefully through your first Perl and 'C' modules, before the main body of the book gets down to more detail. The book doesn't tell you how to configure Apache, but does tell you just enough so you can manually start and stop the server. Apache's default configuration file is usually enough to get started on, so this is not a problem. There is a huge amount to the Apache API, and this book covers it in detail, with good explanations and loads of examples. The only drawback might be for 'C' programmers, who will be disappointed that almost all the examples are in Perl, though the 'C' API is very similar, and documented separately towards the end of the book. I think after the initial shock of all those Perl examples, 'C' programmers with either decide Perl isn't so bad after all, or discover that converting the examples to 'C' is actually pretty easy. Either way, I think both groups will be pretty happy with this book. Recommended.


Book cover image courtesy of Open Library.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.