Datasheet
“main” (Installation and Administration) — 2004/6/25 — 13:29 — page 545 — #571
i
i
i
i
i
i
i
i
22
The Apache Web Server
Setting up mod_perl
To set up mod_perl in SUSE LINUX, simply install the respective pack-
age (see Section 22.6 on page 534). Following the installation, the Apache
configuration file includes the necessary entries (see /etc/apache2/
mod_perl-startup.pl). Information about mod_perl is available at
http://perl.apache.org/.
mod_perl versus CGI
In the simplest case, run a previous CGI script as a mod_perl script by re-
questing it with a different URL. The configuration file contains aliases that
point to the same directory and execute any scripts it contains either via
CGI or via mod_perl. All these entries already exist in the configuration
file. The alias entry for CGI is:
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
The entries for mod_perl are:
<IfModule mod_perl.c>
# Provide two aliases to the same cgi-bin directory,
# to see the effects of the 2 different mod_perl modes.
# for Apache::Registry Mode
ScriptAlias /perl/ "/srv/www/cgi-bin/"
# for Apache::Perlrun Mode
ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
</IfModule>
The following entries are also needed for mod_perl. These entries already
exist in the configuration file.
#
# If mod_perl is activated, load configuration information
#
<IfModule mod_perl.c>
Perlrequire /usr/include/apache/modules/perl/startup.perl
PerlModule Apache::Registry
#
# set Apache::Registry Mode for /perl Alias
#
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
545
SUSE LINUX Enterprise Server










