This guide describes the installation of mod_perl
to H-Sphere box.
As Apache server is installed without mod_perl support during H-Sphere
installation, the simplest way to include this extension is through
building mod_perl as a DSO outside the Apache source tree via the
new Apache 1.3 support tool apxs (APache eXtension).
WORKFLOW
- Fulfill the following build steps:
% tar xzvf mod_perl-x.xx.tar.gz
% cd mod_perl-x.xx
% perl Makefile.PL \
USE_APXS=1 \
WITH_APXS=/path/to/bin/apxs \
EVERYTHING=1 \
[...]
% make && make install
This will build the DSO libperl.so outside the Apache source tree
with the new Apache 1.3 support tool apxs and install it into
the existing Apache hierarchy. For example, if you want to use
mod_perl for the Control Panel Apache server, you need to set
WITH_APXS=/hsphere/local/home/cpanel/apache/bin/apxs. Following
the successfull installation the following should appear:
a) /hsphere/local/home/cpanel/apache/libexec/libperl.so file;
b) two additional directives in the /hsphere/local/home/cpanel/apache/etc/httpd.conf
file
- LoadModule perl_module libexec/libperl.so
- AddModule mod_perl.c
- To make sure that mod_perl works correctly, you may test it
by entering in the httpd.conf file a test line similar
to the one below:
Alias /perl/ /path_to_directory/
PerlModule Apache::Registry
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Location>
and create the specified above perl script without mentioning
the perl interpreter:
/hsphere/shared/SiteStudio/public_html/perl/test.pl
Next, check if it works correctly by trying out the link:
|