magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1999 > 09 > Programming with Perl

Embedding Perl into Apache

Back in my column titled "A Smart Picture Album" (see Web Techniques, January 1999), I demonstrated a nice little CGI "DirectoryIndex" handler that let users step through thumbnails of images on my site. Well, I now have 3500 images from my digital camera, totaling some 500MB available for download, and all those people wandering through the pictures were firing off quite a few CGI processes.

So, I decided to start using Perl embedded in my Apache Web server to reduce the number of new Perl compilations and separate processes, as well as give back not modified (304) return codes more often if a visitor were about to view a page he or she had seen before. Going one step further, I added a "reduce 50 percent" link for each picture that scales the image on the fly with ImageMagick's Perl interface (www.wizards.dupont.com/cristy/www/perl.html), because some people were complaining that the pictures were mostly too large.

Perl-enabled Apache (better known as mod_perl) is described at perl.apache.org, and is actively supported by Doug MacEachern and a volunteer crew distributed all over the world. Doug and fellow Web Techniques columnist Lincoln Stein have released the excellent book, Writing Apache Modules with Perl and C. For details about this publication, see www.modperl.com.

Special Handling

First, mod_perl needs to be told that we're going to have a special content handler for a section of the directory tree.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2