HTML::Mason Installation

Aus Weis nix
Wechseln zu: Navigation, Suche

Mason Installation Notes on FC4

The following RPMs are already installed:

rpm -qa | grep "httpd\|mod_perl"

But one might need a

yum install mod_perl-devel

Then the following RPMs needed to be installed

yum install libapreq2

Update the perl installer CPAN (this requires interactive source configuration):

perl -MCPAN -e shell
 >install Bundle::CPAN

The following procedure updates a pre-requisite module for the Mason installation:

perl -MCPAN -e shell
 >install HTML::Mason

Then Mason and related modules can be updated/installed with:

perl -MCPAN -e shell
 >install HTML::Mason
 >install CGI
 >install Apache2::Cookie
 >install Apache2::Upload

Configuring Apache for HTML::Mason

(Example for FC4 Linux)

Add the following to /etc/httpd/conf/httpd.conf:

PerlModule HTML::Mason::ApacheHandler
# Mason configuration
PerlSetVar  MasonCompRoot    /var/www/html/mason
PerlSetVar  MasonDataDir     /var/www/mason
<Location /mason>
 SetHandler   perl-script
 PerlHandler  HTML::Mason::ApacheHandler

Create a mason object folder and make it writeable by apache:

mkdir /var/www/mason
chown apache.apache /var/www/mason

Create a mason root folder:

mkdir /var/www/html/mason

Create a test file /var/www/html/mason/test.html containing:

4 = <% 2+2 %>

Restart the webserver:

service httpd restart

Navigate to and one should see:

4 = 4

Errors are logged in /var/log/httpd/error_log and can be inspected with:

tail /var/log/httpd/error_log

CPAN Updates for Perl

Several external modules are typically used within mod_perl. These need to be installed/updated. Launch CPAN installer with:

perl -MCPAN -e shell


install DBI
install Data::Dumper
install FreezeThaw
install Time::HiRes
install JSON
install JSON::Syck
install Digest::MD5
install MIME::Base64