2.4. Installing mod_perl on a Unixish System
Problem
You want to install the mod_perl scripting module to allow better Perl script performance and easy integration with the Web server.
Solution
For Apache 1.3, download and unpack the mod_perl 1.0 source package from http://perl.apache.org/. Then use the following command:
%perl Makefile.PL \>USE_APXS=1 \>WITH_APXS=/usr/local/apache/bin/apxs \>EVERYTHING=1 \>PERL_USELARGEFILES=0%make%make install
Restart your server.
For Apache 2.0 and later, the process is similar. Download and unpack the mod_perl 2.0 source package, then use the following command:
% perl Makefile.PL MP_APXS=/usr/local/apach2/bin/apxs Discussion
The mod_perl source package is quite a complex module, and there are several different ways to add it to your server. This recipe is the fastest and lowest-impact one; if it doesn’t suit your needs, check the various README.* files in the package directory after unpacking. Because its primary language is Perl rather than C, the installation instructions are significantly different from those for most other modules.
Once you have restarted your server successfully, mod_perl should be available and configured as part of it. You can test it by making some changes to the httpd.conf file, adding a few scripts, and seeing whether the server processes them correctly. Here is a sample set of steps to test mod_perl’s operation:
Create a directory where your mod_perl scripts can live:
#
cdServerRoot#mkdir lib lib/perl lib/perl/Apache ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access