Getting the Goods
April 10, 2000
Most sites that run Apache are based on
Unix-like operating systems such as
Linux or FreeBSD, although Apache is also available for the Windows
platforms. You will need to be running an Apache web server,
preferably the newest stable release available (1.3.12 at the time
of writing) to make use of mod_perl, although there are plug-ins
similar to mod_perl for other web servers
(nsapi_perl
for Netscape servers, or the commercial
PerlEx
by ActiveState for O'Reilly, Microsoft, and Netscape servers).
On Apache under a Unix-like operating system, you can download the
source for mod_perl (current version is 1.22). Alternatively,
if you are familiar with the CPAN.pm module the command
install Bundle::Apache will install mod_perl and several
related Perl modules that you may or may not wish to use. You can
also install mod_perl manually, from the source link above,
and then type perldoc Bundle::Apache to view a list of
related modules that you can retrieve and install if you wish.
Apache is also available for Windows, but many Windows Perl coders
use ActiveState's popular port, ActivePerl. This is a problem for
us here, because mod_perl will not (yet) work under Windows with
ActivePerl. There is hope -- you can
freely download a fully bundled set of binaries containing
Apache, mod_perl, and an alternate port of Perl all for Windows
95/98/NT.
While Windows users have downloaded binaries, many Unix-like users
have downloaded source code. The vagaries of compiling anything
under a Unix environment are complex, but in a typical scenario
you can rely on the built-in compilation scripts included with
Apache and mod_perl. The compilation procedure involves building of
mod_perl first, which then in turn builds the Apache binaries --
the end result will be a new Apache httpd binary. The installation
summary below is reproduced from
Stas Bekman's thorough "mod_perl Guide" -- you can
skip the first five lines if you've already downloaded and unpacked
the Apache and mod_perl sources (which is what these lines do).
|
% cd /usr/src
% lwp-download http://www.apache.org/dist/apache_x.x.x.tar.gz
% lwp-download http://perl.apache.org/dist/mod_perl-x.xx.tar.gz
% tar xzvf apache_x.x.x.tar.gz
% tar xzvf mod_perl-x.xx.tar.gz
% cd mod_perl-x.xx
% perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
% make && make test && make install
% cd ../apache_x.x.x
% make install
|
As illustrated, you simply need to unpack the Apache and mod_perl
sources into respective subdirectories, then change into the
mod_perl source directory and execute the "perl Makefile.PL"
command illustrated above. This tells the compiler where to find
the Apache sources and what options to build in -- the above routine
defaults to "everything" which is satisfactory for most
uses and certainly a first time experience. Finally, the sources
are all built while your computer churns and smokes for a few
minutes, and installed into place, typically
/usr/local/apache.
Assuming a /usr/local/apache destination, the new httpd
(the binary for the Apache server) will be found in
/usr/local/apache/bin.
The Story of Forks
The Perl You Need to Know
Gee, it's huge
|