Getting Started with mod_perl in
30 Minutes

In the previous article, I passed along quite amazing Web performance
reports from companies that have deployed mod_perl heavily. You might be
surprised by this, but you can quite easily get similarly amazing results if
you move your service to mod_perl as well. In fact, getting started with
mod_perl shouldn't take you more than 30 minutes, the time it takes to compile
and configure the server on a decent machine and get it running.

Intimidated by the prospects of configuring mod_perl on your Apache server? Don't be. Getting started with mod_perl shouldn't take you more than 30 minutes, the time it takes to compile and configure the server on a decent machine and get it running. In this column, Stas Bekman explains how to get mod_perl up and running with a minimum of fuss.

In this article I'll show step-by-step installation and configuration
scenarios, and chances are you will be able to run the basic statically
compiled mod_perl setup without reading any other documents. Of course, you
will want and need to read the documentation later, but I think you will agree
with me that it's ultimately cool to be able to get your feet wet without
knowing much about the new technology up-front.

The mod_perl installation was tested on many mainstream Unix platforms, so
unless you have some very non-standard system you shouldn't have any problems
when building the basic mod_perl server.

If you are a Windows user, the easiest way is to use the binary package
available from http://perl.apache.org/distributions.html.
From the same location you can download the Linux RPM version and CVS
snapshots. However, I recommend to always build the mod_perl from source, and
as you will see in a moment, it's an easy thing to do.

Just as advertised in the previous section--the building time stays the
same: 10 minutes, but if one of the steps didn't work for you or you didn't
have the courage to try it, I will explain each step in fine details here. If
everything was just fine you can skip this section and move on to the next one.

First you have to become a root user in order to install the files in a
protected area. If you don't have root access, you can install all the files
under your home directory as well. We will talk about the nuances of this
approach in a future article. I'll also assume that you have perl and cc or an
equivalent C compiler installed.

I assume that all builds are being done in the /usr/src
directory. So we go into this directory: