leestretton.com

You are in: > Home > Developers Guides

Perl - Installing mod_perl in Three Steps

Perl Camel

You can install mod_perl in three easy steps: Obtaining the source files required to build mod_perl, building mod_perl, and installing it.

Building mod_perl from source requires a machine with basic development tools. In particular, you will need an ANSI-compliant C compiler (such as gcc) and the make utility. All standard Unix-like distributions include these tools. If a required tool is not already installed, then use the package manager that is provided with the system (rpm, apt, yast, etc.) to install them.

A recent version of Perl is also required, at least version 5.004. Perl is available as an installable package, although most Unix-like distributions will have installed Perl by default. To check that the tools are available and learn about their version numbers, try:

  % make -v
  % gcc -v
  % perl -v

If any of these responds with Command not found, it will need to be installed.

Once all the tools are in place the installation process can begin. Experienced Unix users will need no explanation of the commands that follow and can simply copy and paste them into a terminal window to get the server installed.

Acquire the source code distrubutions of Apache and mod_perl from the Internet, using your favorite web browser or one of the command line clients like wget, lwp-download, etc. These two distributions are available from http://www.apache.org/dist/httpd/ and http://perl.apache.org/dist/.

Remember that mod_perl 1.0 works only with Apache 1.3, and mod_perl 2.0 requires Apache 2.0. In this chapter we talk about mod_perl 1.0/Apache 1.3, hence the packages that you want are named apache_1.3.xx.tar.gz and mod_perl-1.xx.tar.gz, where xx should be replaced with the real version numbers of mod_perl and Apache.

Move the downloaded packages into a directory of your choice, e.g., /home/stas/src/, proceed with the described steps and you will have mod_perl installed:

  % cd /home/stas/src
  % tar -zvxf apache_1.3.xx.tar.gz
  % tar -zvxf mod_perl-1.xx.tar.gz
  % cd mod_perl-1.xx
  % perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \
      APACHE_PREFIX=/home/httpd DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
  % make && make test
  % su
  # make install

That's all!

All that remains is to add a few configuration lines to the Apache configuration file, (/usr/local/apache/conf/httpd.conf), start the server, and enjoy mod_perl.

Problem with this page? Let us know
© Lee Stretton 2005 | powered by linux powered by php 5 powered by MySQL download rss feeds powered by php 5 valid css