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"
 httpd-2.0.54-10
 httpd-manual-2.0.54-10
 httpd-manual-2.0.54-10.2
 system-config-httpd-1.3.2-2
 httpd-2.0.54-10.2
 httpd-devel-2.0.54-10.2
 mod_perl-2.0.1-1.fc4
 mod_perl-devel-2.0.1-1.fc4

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
 >exit

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

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

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
 >exit

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
</Location>

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 http://www.sample.com/mason/test.html 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

General

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