11.3. Apache Configuration

Apache must be configured to handle Mason much as with Embperl. We will choose a directory and for all .html files under that directory, have Mason process them (for the same reasons, too).

First, create a directory for the Mason work:

$ mkdir /var/www/html/mason 
$ chmod a+rx /var/www/html/mason
					

As root, add the following to /etc/httpd/conf/httpd.conf:

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

The first line sets the Mason component root directory to /var/www/html/mason. This tells Mason where to find the components (more ...

Get Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.