Configuring mod_perl

If you have just finished installing Apache, change back to your home directory by typing cd ..

To configure mod_perl, change directories to the mod_perl source directory, and have the perl interpreter execute the Makefile.PL program.  The below options specify the location of Apache's APXS program (should be in the bin subdirectory of the location you installed Apache to) which is used to integrate mod_perl into the Apache server, and enables all the functions mod_perl provides.
 
 

 
lamonml@hespera> cd mod_perl-1.24
lamonml@hespera> perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs \
                 EVERYTHING=1

This will configure the mod_perl source for compilation on your system.

Compiling mod_perl

To compile mod_perl, use the make command after the configuration process has completed.
 

 
lamonml@hespera> make

Installing mod_perl

After mod_perl has finished compiling, install it by becoming root using the su or sudo command and calling make install.
 

 
lamonml@hespera> sudo make install

If you are using a previously installed copy of Apache, this simply copies the mod_perl files to the proper directories in your Apache directory, and adds the appropriate lines to your Apache configuration files for you.  You don't have to shut down the Apache server to perform this step.

Creating The Module Directory

After mod_perl has installed, you must manually create the directory where your perl modules will live.  As a general rule, this is a perl subdirectory of a lib subdirectory from the location that you installed Apache to.  You will probably have to become root using su or sudo to do this.
 
 
lamonml@hespera> cd /usr/local/apache
lamonml@hespera> sudo mkdir lib
lamonml@hespera> cd lib
lamonml@hespera> sudo mkdir perl