The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

install - installing mod_perl-2 for Win32

Description

As described in the discussion of issues in multithreaded win32, a mod_perl-1 enabled server based on Apache-1 on Win32 is limited to a single thread serving a request at a time. This effectively prevents concurrent processing, which can have serious implications for busy sites. This problem is addressed in the multi-thread/multi-process approach of mod_perl-2/Apache-2. This document discusses how to obtain mod_perl-2.

Installing

Apache-2 and mod_perl-2 can be obtained in two ways - either as binaries, or through building from the sources. As with most packages of a more complex nature, it is best, when possible, to build things from the sources. However, this requires some experience with using Visual C++.

Building from sources

If you are building mod_perl-2 from sources, it is probably also best to do the same for Apache-2. The Apache-2 sources can be obtained from http://httpd.apache.org/, which when unpacked will contain at the top-level a Visual Studio project file. Choose the InstallBin - Win32 Release target to build and install Apache-2, which by default will be placed in /Apache2.

Having built and installed Apache-2, next obtain the mod_perl-2 sources from http://www.cpan.org/authors/id/D/DO/DOUGM/. After unpacking, run the command

    C:\modperl_src> perl Makefile.PL MP_AP_PREFIX=\Path\to\Apache2

where \Path\to\Apache2 is the path to the Apache-2 package you earlier built. Then

    C:\modperl_src> nmake
    C:\modperl_src> nmake test

will build and test mod_perl-2. mod_perl-2 on Win32 is considered at an alpha stage of development, so not all the tests may pass.

The final command,

    C:\modperl_src> nmake install

will install the necessary mod_perl-2 files into your Perl directory tree (you will also need to copy src/modules/perl/mod_perl.so into your /Path/to/Apache2/modules/ directory). If you are installing mod_perl-2 on a system that also contains mod_perl-1, then some mod_perl-1 files will be overwritten by this procedure. This can be avoided by preparing the build as

  C:\modperl_src> perl Makefile.PL MP_AP_PREFIX=\Path\to\Apache2 MP_INST_APACHE2=1

which will subsequently lead to the mod_perl-2 files being installed under an Apache2 subdirectory in your Perl tree. You will then have to employ either a use Apache2; line in your scripts/packages or else a PerlModule Apache2 directive in Apache's httpd.conf.

If this build fails, you may want to try the latest cvs sources - see http://perl.apache.org/mod_perl_cvs.html for details. If you do try this, it is generally a good idea to also use the cvs Apache-2 sources - see http://httpd.apache.org/dev/ for information. Be aware, though, that as well as providing bug fixes, there may be new features being added and tested in the cvs versions, so at any given time there are no guarantees that these packages will build and test successfully.

Binary packages

There are two ways of obtaining a binary mod_perl-2 package.

PPM

The first, for ActivePerl users, is through PPM - this assumes you already have ActivePerl (build 6xx) from http://www.activestate.com/ and a Win32 Apache-2 binary from http://httpd.apache.org/. In installing this, you may find it convenient when transcribing any Unix-oriented documentation to choose installation directories that do not have spaces in their names (eg, C:/Apache2).

After installing Perl and Apache-2, you can then install mod_perl via the PPM utility. ActiveState does not maintain mod_perl in their ppm repository, so you must get it from a different location other than ActiveState's site. One way is simply as (broken over two lines for readability)

  C:\> ppm install
       http://theoryx5.uwinnipeg.ca/ppmpackages/mod_perl-2.ppd

Another way, which will be useful if you plan on installing additional Apache modules, is to set the repository within the ppm shell utility as (broken over 2 lines for readability)

   PPM> set repository theoryx5 
         http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer

or, for ppm3,

   PPM> rep add theoryx5 
         http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer

mod_perl-2 can then be installed as

   PPM> install mod_perl-2

This will install the necessary modules under an Apache2 subdirectory in your Perl tree, so as not to disturb an existing Apache directory from mod_perl-1. See the section below on configuring mod_perl to add this directory to the @INC path for searching for modules.

The mod_perl PPM package also includes the necessary Apache DLL mod_perl.so; a post-installation script should be run which will offer to copy this file to your Apache2 modules directory (eg, C:/Apache2/modules/). If this is not done, you can get the file mod_perl-2.tar.gz from http://theoryx5.uwinnipeg.ca/ppmpackages/x86/ which, when unpacked, contains mod_perl.so in the top-level directory.

Note that the mod_perl package available from this site will always use the latest mod_perl sources compiled against the latest official Apache release; depending on changes made in Apache, you may or may not be able to use an earlier Apache binary. However, in the Apache Win32 world it is particularly a good idea to use the latest version, for bug and security fixes.

Apache/mod_perl binary

At ftp://theoryx5.uwinnipeg.ca/pub/other/ one can find an archive Apache2.tar.gz containing a binary version of Apache-2/mod_perl-2 - see the Apache2.readme file for further information. This archive unpacks into an Apache2 directory, underneath which is a blib subdirectory containing the necessary mod_perl files (enabled with a PerlSwitches directive in httpd.conf). Some editing of httpd.conf will be necessary to reflect the location of the installed directory.

This package, which is updated periodically, is compiled against recent cvs sources of Apache-2 and mod_perl-2. As such, it may contain features, and bugs, not present in the current official releases. Also for this reason, these may not be binary compatible with other versions of Apache-2/mod_perl-2.

See Also

The directions for <configuring mod_perl-2 on Win32|docs::1.0::os::win32::config>, the mod_perl documentation, http://take23.org/, http://httpd.apache.org/, and http://www.activestate.com/. Help on setting up and configuring mod_perl-2 can be found by subscribing to the mod_perl mailing list, details of which are at http://perl.apache.org/.

Maintainers

Maintainer is the person(s) you should contact with updates, corrections and patches.

  • Randy Kobes <randy@theoryx5.uwinnipeg.ca>

Authors

  • Randy Kobes <randy@theoryx5.uwinnipeg.ca>

Only the major authors are listed above. For contributors see the Changes file.