I am quite new to Perl and Mason. Please excuse me if you think my question here is trivial.
There is a website that has been developed using the Mason framework. As per my knowledge, it only uses Apache, Perl (ModPerl), Mason and MySQL. I have the website's code with me and I am trying to make the website work on my Ubuntu localhost.
These are the steps that I followed from scratch:
- Installed Apache, MySQL, Perl and ModPerl
- Installed HTML-Mason with cpanm: cpanm HTML::Mason
- Added the following lines to
apache.conf
AddType text/html .mhtml
PerlSetVar MasonCompRoot /var/www/comps
PerlSetVar MasonDataDir /var/mason-data-dir
PerlModule HTML::Mason::ApacheHandler
<LocationMatch "\.mthml$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>
<LocationMatch "(.mas|handler)$">
SetHandler perl-script
PerlHandler "sub { return Apache::Constants::NOT_FOUND }"
</LocationMatch>
I am testing like this
I created a simple "Hello World" file named test.mhtml
and placed it in the directory /var/www/
.
When I try to open this file in the browser it displays the following:
% my $var = "World"; Hello <%$var%>
instead of displaying just Hello World
Do I have to make any other configuration changes?