NAME

INSTALL.win32 - Apache mod_perl installation instructions for Win32

DESCRIPTION

How to build, test, configure and install mod_perl under Win32

PREREQUISITES

    patience - mod_perl is considered alpha under NT and Windows9x.

    MSVC++ 5.0+, Apache version 1.3-dev or higher and Perl 5.004_02 or higher.

    As of version 1.24_01, mod_perl will build on Win32 ActivePerls based on Perl-5.6.0 (builds 6xx).

BINARIES

See http://perl.apache.org/distributions.html for Win32 binaries, including ActivePerl ppms of mod_perl and some Apache::* packages.

CHANGES

Beginning with version 1.3.15, Apache has changed the convention for naming Win32 modules in order to follow that for Unix systems. Consequently, the name of the mod_perl module built here has been changed from ApacheModulePerl.dll to mod_perl.so. This is just a change in convention; if you are building mod_perl against pre-1.3.15 Apache sources, and wish to follow the old convention, simply copy mod_perl.so to your Apache modules directory as ApacheModulePerl.dll.

BUILDING

There are two ways to build mod_perl - with MS Developer Studio, and through command-line arguments to 'perl Makefile.PL'.

Building with MS Developer Studio

Setup the Perl side

Run

perl Makefile.PL
nmake install

This will install the Perl side of mod_perl and setup files for the library build.

Build mod_perl.so

Using MS developer studio,

select "File -> Open Workspace ...", 
select "Files of type [Projects (*.dsp)]"
open mod_perl-x.xx/src/modules/win32/mod_perl.dsp
Settings
select "Tools -> Options -> [Directories]"

select "Show directories for: [Include files]"

You'll need to add the following paths:

C:\apache_x.xx\src\include
.  (should expand to C:\...\mod_perl-x.xx\src\modules\perl)
C:\perl\lib\Core

select "Project -> Add to Project -> Files" adding:

perl.lib (or perl56.lib)   (e.g. C:\perl\lib\Core\perl.lib)
ApacheCore.lib (e.g. C:\Apache\ApacheCore.lib)

select "Build -> Set Active Configuration... -> 
[mod_perl - Win32 Release]"

select "Build -> Build mod_perl.so"

You may see some harmless warnings, which can be reduced (along with the size of the DLL), by setting:

"Project -> Settings -> [C/C++] -> Category: [Code Generation] -> 
 Use runtime library: [Multithreaded DLL]
Testing

Once mod_perl.so is built and apache.exe is installed you may test mod_perl with:

nmake test
Apache setup

You do not need to rebuild apache, just copy mod_perl.so to $SERVER_ROOT/modules

Building with arguments to 'perl Makefile.PL'

Generating the Makefile as, for example,

perl Makefile.PL APACHE_SRC=..\apache_1.3.xx INSTALL_DLL=\Apache\modules

will build mod_perl (including mod_perl.so) entirely from the command line. The arguments accepted include

APACHE_SRC

This can be one of two values: either the path to the Apache build directory (eg, ..\apache_1.3.xx), or to the installed Apache location (eg, \Apache). This is used to set the locations of ApacheCore.lib and the Apache header files.

INSTALL_DLL

This gives the location of where to install mod_perl.so (eg, \Apache\modules). No default is assumed - if this argument is not given, mod_perl.so must be copied manually.

DEBUG

If true (DEBUG=1), a Debug version will be built (this assumes that a Debug Apache has been built). If false, or not given, a Release version will be built.

EAPI

If true (EAPI=1), EAPI (Extended API) will be defined when compiling. This is useful when building mod_perl against mod_ssl patched Apache sources. If false, or not given, EAPI will not be defined.

After this, running

nmake
nmake test
nmake install

will complete the installation.

This latter method of building mod_perl will also install the Apache and mod_perl header files, which can then be accessed through the Apache::src module.

CONFIGURATION

Add this line to httpd.conf:

LoadModule perl_module modules/mod_perl.so

Be sure that 'C:\perl\bin' is in your path so apache can find perl.dll

See the cgi_to_mod_perl.pod and mod_perl.pod documents for general configuration.

NOTES

mod_perl-win32 is considered alpha, at the time of this writing, so is Apache-NT (1.3a1)

CGI::Switch does not work with apache_1.3a1 because basic_http_header() is not exported by the ApacheCore.dll For now, just change:

use CGI::Switch ();
my $q = CGI::Switch->new;

- to -

use CGI ();
my $q = CGI->new;