Home arrow Perl Programming arrow Introduction to mod_perl (part 2): mod_perl Quickstart

Introduction to mod_perl (part 2): mod_perl Quickstart

Last week you found out all sorts of good things about mod_perl, but you may be wondering how you get started using it. Let this article be your guide.

  1. Introduction to mod_perl (part 2): mod_perl Quickstart
  2. Installing mod_perl Detailed
  3. Configuring and Starting mod_perl Server
  4. The "mod_perl rules" Apache::Registry Script
  5. The "mod_perl rules" Apache Perl Module
  6. Is This All I Need to Know About mod_perl?
  7. Acknowledgements
  8. References
By: Stas Bekman
Rating: starstarstarstarstar / 2
May 07, 2002

print this article


In the previous article, I've shown quite amazing web performance reports from companies that have deployed mod_perl heavily. You might be surprised 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.

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.{mospagebreak title=Installing mod_perl} So let's start with the installation process. If you are an experienced Unix user, you need no explanation for the following commands. Just copy and paste them and you will get the server installed.

I'll use a % sign as the shell program's prompt.

% cd /usr/src % lwp-download http://www.apache.org/dist/httpd/apache_1.3.20.tar.gz % lwp-download http://perl.apache.org/dist/mod_perl-1.26.tar.gz % tar -zvxf apache_1.3.20.tar.gz % tar -zvxf mod_perl-1.26.tar.gz % cd mod_perl-1.26 % perl Makefile.PL APACHE_SRC=../apache_1.3.20/src \ DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 % make && make test && make install % cd ../apache_1.3.20 % make install
That's all!

What's left is to add a few configuration lines to httpd.conf, an Apache configuration file, start the server and enjoy mod_perl.

If you have stumbled upon a problem at any of the above steps, don't despair -- the next section will explain in detail each and every step.

>>> More Perl Programming Articles          >>> More By Stas Bekman

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Perl Turns 25
- Lists and Arguments in Perl
- Variables and Arguments in Perl
- Understanding Scope and Packages in Perl
- Arguments and Return Values in Perl
- Invoking Perl Subroutines and Functions
- Subroutines and Functions in Perl
- Perl Basics: Writing and Debugging Programs
- Structure and Statements in Perl
- First Steps in Perl
- Completing Regular Expression Basics
- Modifiers, Boundaries, and Regular Expressio...
- Quantifiers and Other Regular Expression Bas...
- Parsing and Regular Expression Basics
- Hash Functions

Developer Shed Affiliates


Dev Shed Tutorial Topics: