On a new install of Debian GNU/Linux version 7 (wheezy), after installing apache and mod-perl I am able to use mason, but the SetHandler/PerlHandler directives appear to make the DirectoryIndex directive stop working. Below are the steps needed to recreate with a fresh Wheezy install.

aptitude install apache2 libhtml-mason-perl libmason-perl

at this point traveling to the server via http should give you the 'It Works Page', and you'll be able to test that DirectoryIndex is working and sending the user to index.html. Add these lines to the default sites-enabled virtual host configuration:

PerlModule HTML::Mason::ApacheHandler <VirtualHost *:80> ServerAdmin webmaster@localhost <Location /var/www/> SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler </Location>

restart apache and now it will parse <% $mason %> on your index, but you will have to travel explicitly to the index (i.e. http://192.168.1.2/index.html) because it will no longer direct you to it automatically.

Thanks in advance for any help with this issue, and my apologies if its far simpler than I thought, or I have somehow not met the standards for a post (I read the rules, but you never can be sure). I have the mason book and have read online documentation, but was unable to find documentation related to apache configuration with mason.


In reply to mod-perl (mason) breaks DirectoryIndex apache2 by 3duke

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.