Writing Apache Modules with Perl and C

  Author:    Lincoln Stein, Doug MacEachern
  ISBN:    156592567X
  Sales Rank:    621864
  Published:    1999-03
  Publisher:    O'Reilly
  # Pages:    724
  Binding:    Paperback
  Avg. Rating:    5.0 based on 23 reviews
  Used Offers:    35 from $9.99
  Amazon Price:    $26.37
  (Data above last updated:  2008-09-07 05:48:28 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
Writing Apache Modules with Perl and C
  
Apache is the most popular web server on the Internet because it is free, reliable, and extensible. The availability of the source code and the modular design of Apache makes it possible to extend web server functionality through the Apache API. For the most part, however, the Apache API has only been available to C programmers, and requires rebuilding the Apache server from source. mod_perl, the popular Apache module used primarily for enhanced CGI performance, changed all that by making the Apache API available to Perl programmers. With mod_perl, it becomes simple to develop Apache modules with Perl and install them without having to rebuild the web server. Writing Apache Modules with Perl and C shows how to extend web server capabilities regardless of whether the programming language is Perl or C. The book explains the design of Apache, mod_perl, and the Apache API. It then demonstrates how to use them to perform for tasks like the following:
  • Rewriting CGI scripts as Apache modules to vastly improve performance
  • Server-side filtering of HTML documents, to embed special markup or code (much like SSI)
  • Enhancing server log functionality
  • Converting file formats on the fly
  • Implementing dynamic navigation bars
  • Incorporating database access into CGI scripts
  • Customizing access control and authorization to block robots or to use an external database for passwords
The authors are Lincoln Stein and Doug MacEachern. Lincoln is the successful author of How to Set Up and Maintain a World Wide web Site and the developer of the widely used Perl CGI.pm module. Doug is a consultant and the creator of the innovative mod_perl Apache module.
Writing Apache Modules with Perl and C will allow you to enhance your Apache HTTP server in just about any way you'd like. Overall, it is an excellent book, and it has a lot of good information and terrific examples on everything from "Content Handlers" to customizing the Apache server configuration process.

It's quickly apparent that Lincoln Stein and Doug MacEachern spent valuable time writing this book considering the breadth of their subject and the depth they devote to it. The only downside to the book is that it's kind of hard to explain all of the API functionality without assuming a minimum level of competence from the audience. For that reason, this book might be a bit intimidating to novice programmers, but it really rewards you if you put time into it and tinker with things.

The book also works well as a source of ideas and inspiration for when you have to write your own server modules, and I'd recommend it if you want to customize your Apache server or speed up your Perl CGI programs. --Doug Beaver

                  Reader Reviews 1 - 14 of 14                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
01-24-07 3 (NA)
(Hide Review...)  Outdated, but still helpful
Reviewer Permalink
Helpful for getting your head around the principles of Apache modules, but for modern API reference, see Apache's online docs.
(Review Data Last Updated: 2008-09-05 05:46:06 EST)
01-23-07 3 (NA)
(Hide Review...)  Outdated, but still helpful
Reviewer Permalink
Helpful for getting your head around the principles of Apache modules, but for modern API reference, see Apache's online docs.
(Review Data Last Updated: 2007-04-11 10:21:34 EST)
09-20-06 4 (NA)
(Hide Review...)  Good Perl Apache Module Reference
Reviewer Permalink
While this book is a bit outdated and technology has greatly changed since this text was released in 1999, this is still a solid reference for anyone that works with Apache and still needs to support writing modules with Perl (not as much with C). At a hefty size of over 700+ pages, this text will certainly help you do the job and it's a great bargain for this specialty text.

Chapter Overview

01. Server-Side Programming with Apache
02. First Module
03. Apache Module Architecture and API
04. Content Handlers
05. Maintaining State
06. Authentication & Authorization
07. Other Request Phases
08. Customizing the Apache Configuration Process
09. Perl API Reference Guide
10. C API Reference, Part I
11. C API Reference, Part II

**** RECOMMENDED
(Review Data Last Updated: 2007-01-25 12:14:08 EST)
05-26-06 5 (NA)
(Hide Review...)  best $2.00 I ever spent!
Reviewer Permalink
I bought this book awhile ago USED here on Amazon (for $2.00!), and it was worth every penny!

Although this book is old, it has some useful reference material that can still be applied today.

It doesn't mention as much about C as it does PERL, but it does cover the basic fundamental principles of using either language to create your own apache modules, which was more of what I was interested in.
(Review Data Last Updated: 2006-09-18 08:17:59 EST)
05-11-03 4 1\1
(Hide Review...)  A good book for Perl modules for Apache.
Reviewer Permalink
Not much there for C, although it's not too difficult to make use of the Perl topics and covert them to C, it's more geared towards Perl (much more). That's too bad. Still, it's a good book and is very useful for referencing as well as for people looking to learn more about this topic.
(Review Data Last Updated: 2006-07-07 10:54:04 EST)
03-02-03 1 14\18
(Hide Review...)  If you want C don't bother with this book
Reviewer Permalink
It's all in Perl. The book says "Apache Modules with Perl and C" but really, it's all in Perl. The only mentions I've seen in C are the very very beginning, and the end that restates the Apache documentation.

If you bought this book thinking it will have sample C code, you would be wrong.

If you like Perl, then this is the book for you, but if you prefer C, as I do, then you will have wasted your money.

(Review Data Last Updated: 2006-07-07 10:54:04 EST)
12-19-02 5 (NA)
(Hide Review...)  My personal favorite reference
Reviewer Permalink
_Writing Apache Modules_ (WAM) is a high quality work, even amongst other O'Reilly books. Few/no typos and articulate writing, very usable index and good content organization, accurate and complete information, top notch Perl code. Yes, only about 5% of the code are in C, but the C API reference is there. I write Perl and C modules and I can use this book for both (though for specific C techniques, you'll probably be better off by reading the Apache developers and apache-modules mailing lists).

I haven't actually read the other mod_perl and developer-oriented Apache books out there but in my opinion this book is still indispensable if you plan to write Apache modules, either in Perl, C, or other languages. Especially if you write for mod_perl, this book is a great complement to the mod_perl guide. Stas' guide focuses on deployment and tuning issues (memory usage, speed, etc) while WAM focuses on the Apache API and how Apache can help you do the job by writing modules.

Personally, _Writing Apache Modules_ is still the most useful reference book to date. It's one that spends the largest amount of time on my desk.

And, oh yes, Amazon gives a good deal on this one ... .

Can't wait for the Apache 2 counterpart.

(Review Data Last Updated: 2006-07-07 10:54:04 EST)
04-08-02 3 12\16
(Hide Review...)  A 5,000 piece jigsaw puzzle for you to assemble yourself
Reviewer Permalink
A good tutorial starts out with something basic and gradually builds on it. This book starts out with three chapters of pure reference material. Granted some of this is a half-assed description of setting up Apache and compiling in mod_perl. I found the docs that come with the Apache and mod_perl source code to be far more useful (and accurate). Then you get this long list of Perl API classes, request object functions, Perl handlers, etc. All of which is wonderfully useful information ... presented at the wrong time ... we have yet to begin writing a useful module.

When we do begin the writing of a module, it isn't a basic, stand-alone module, but a module to add footers to other content. So, the text digresses into a long and technical discussion of the various ways to configure Apache and associate MIME types so that this module will work with documents that we might or might not have on hand (It's just assumed that you have these laying around handy). During this discussion, we get bounced off of other Apache::xyz modules that apparently popped into the author's head in a moment of "As long as we're at it, why don't we throw this in too" inspiration. Wonderful information ... presented at the wrong time.

To give an example: A logical place to start learning Oracle SQL (or any other SQL) would be with the SELECT statement. However, the authors of this book would begin with a detailed discussion of PL/SQL exception handling, a listing of most of the built-in PL/SQL exceptions, and a listing of a number of the built-in Oracle packages. (Recall we were just starting with SQL. But what the heck! PL/SQL is cool, so why not talk about it now? We're going to use it eventually anyway.) Then for your first select statement, you would write something that used a complex join, a correlated subquery, and a few built-in functions. Well, obviously, we can't just throw this extra stuff in there and not talk about it. So we go whirling off into a discussion of complex joins, correlated subqueries and any other tangents that happen to pop into our head. And when it is all said and done, we still don't know how to display the entire contents of the EMP table.

This is a classic of case of making it difficult to see the forrest because of all the trees. The authors of this book have made no attempt to devise a progressive model for building knowledge. Instead, information is dumped on the reader apparently in the order it came to mind. Maybe this is a problem with having multiple authors. Perhaps the parts were written independently, then slung together. That's what it looks like.

I suppose this book will get you to where you are going ... eventually. But I suspect you will spend considerable time flipping back and forth between chapters re-reading and re-re-reading sections in order to re-assemble the information in a somewhat logical pattern; hence the comparison to a 5,000 piece puzzle.

For those who might be wondering: This book assumes you already know the Perl language. If you don't, the "Learning Perl" book is a good starting point (you do NOT want "Programming Perl" at this point). You will probably also want to get some knowledge of HTML and building web documents. And you will probably want to get at least a basic knowledge of custom configuring an Apache installation.

(Review Data Last Updated: 2006-07-07 10:54:04 EST)
10-18-01 5 13\13
(Hide Review...)  A web programming marvel
Reviewer Permalink
I once read that you could not consider yourself a Unix Wizard until you had hand written a SendMail configure script once, and that no sane person ever did it twice.

The first part of that truism can perhaps be said of Web Wizards and Apache modules. Fortunately Apache modules are a little easier to write than Sendmail configurations and this book makes it easier still.

Let's not mince words. Perl scripts and other CGI software can quickly become performance bottlenecks on any server, no matter the size of your hardware. The most powerful way of fixing this is to fold a fair amount of that programming inside the server where the overhead of loading interpreters, libraries and code is already taken care of, not to mention you find yourself with much more power and control over the dialogue between server and browser.

Unfortunately writing to an API as large and complex as that in Apache is not always easy. MacEachern and Stein go to a great deal of trouble and exert a fair degree of skill in breaking the learning down into manageable chunks and explaining it all with a large number of examples.

This was the first book I read that really made me understand the process going on, both between the two pieces of software and inside Apache, when a page is requested. From there the book goes on to give you a marvellous understanding of how to write a module in Perl that fits into that process. Finally the last three chapters are excellent API reference guides, one on the Perl API and two on the C API, and an excellent index (which indexes every function in the API's as well as key concepts) make this a superb tool when you get down to writing.

The book does not cover using C in any where near as much depth, but the vital conceptual understanding required and explained in the Perl chapters means that once you have written a module in Perl I don't believe you will find it a problem to do it in C. I have to say though, as a C programmer I am yet to do it, I get so much performance out of a module in Perl I've yet to find the need.

I read this book before starting my first module and I have now written three. I would never have even contemplated the task before reading this volume. I would recommend this book to anyone who wants to get a full understanding of writing software for the web and anyone who wants a quantum leap in the performance of their web software. You will need some fair Perl skills and preferably written a few CGI scripts as this book does not cover the language skills required at all.

(Review Data Last Updated: 2006-07-07 10:54:04 EST)
10-16-01 3 7\9
(Hide Review...)  Its all Perl :-(
Reviewer Permalink
The book in and of itself, is great. Typical O'Reilly fare. But this book is 99% Perl.. anyone writing Apache Modules, isn't writing them in Perl. Perl is great since it works as an add-on thats written in "C"! This book is more a mod_Perl users guide.
(Review Data Last Updated: 2006-07-07 10:54:06 EST)
05-23-01 5 2\2
(Hide Review...)  unique and well done
Reviewer Permalink
Writing Apache Modules is a rather arcane specialty; with so many excellent free modules already available, most people can find more than the need with some simple configuration... but if you do end up with a more hardcore need, you simply have to have this book - and unlike many other books which are the first or only books to cover their subject, this one is clear, well thought out, and very helpful for the task at hand. Even with the full source and lots of examples handy online, this book and a handful of bookmarks made a huge difference to me. (It sits on a shelf now, project completed, but I wouldn't give it up!)
(Review Data Last Updated: 2006-07-07 10:54:06 EST)
03-25-01 5 2\3
(Hide Review...)  An Education for Web Developers
Reviewer Permalink
This book is a pleasure to read. It provides information on web development on the Apache/Perl platform in a very accessible and entertaining form without being dumbed down. It convinced me that Apache/Perl was clearly the correct platform for my projects, where power and felxibility take precedence over performance i.e. who cares if IIS/NT is really a better high volume platform as M$ consistently claim.

In addition, the book provides insights into the world of web servers and HTTP, examples of real problems and how they can be solved and first class examples of readable yet succint Perl code.

I would recommend reading Randal Schwarz's Perl columns in for more real world applications.

(Review Data Last Updated: 2006-07-07 10:54:06 EST)
02-03-00 5 13\15
(Hide Review...)  Great book!
Reviewer Permalink
Anybody who is interested in writing apache modules, MUST buy this book...

Its very straight forward, focuses only on things that are related to writing modules in both Perl and C, and has very useful functions index, you can look up a function or a constant, the book explains all methods and gives examples on how to use tricky ones...

I mostly use it for my C modules, and found very easy example of parsing ARGs of query strings, which is to my surprise not in apache lib...

I am impressed.

(Review Data Last Updated: 2006-07-07 10:54:06 EST)
09-10-99 5 9\10
(Hide Review...)  Excellent book
Reviewer Permalink
Doug and Lincoln's book is outstanding. I had no idea Apache could do so much. The book is also wonderful simply for the perl parts of the examples. The way the code is written is illuminating for many non modperl related programming issues.
(Review Data Last Updated: 2006-05-25 13:03:18 EST)
  
                  Reader Reviews 1 - 14 of 14                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)