A question about RT use with Apache2+mod_perl2

First, I acknowledge the warning in the rt-test-dependencies script about
mod_perl2. I get it, I really do. But I’m also persistent…

I’ve got RT installed and basically working fine. Warning or no, mod_perl2
does seem to be doing the trick most of the time, just not quite all of
it…

Specifically, I can’t get a directory index page. Going to
http://help.studentuniverse.com/ gives me a “The requested URL / was not
found on this server.” error. Going to
http://help.studentuniverse.com/index.html works fine, and gives me the RT
login page.

The same problem exists with sub-pages: clicking on the “Configuration” tab
takes me to http://help.studentuniverse.com/Admin/ – and I get a “The
requested URL /Admin/ was not found on this server.” error. Going to
http://help.studentuniverse.com/Admin/index.html works fine.

I’m guessing that this has something to do with the HTML::Mason parameter
“decline_dirs”, but I don’t know enough about Mason to know how to change
it, or where in the RT configuration it may be changed away from the
default.

Any help would be greatly appreciated.

The machine is a SuSE 9.1 Linux box, with a 2.6 kernel, Perl 5.8.3, and the
latest Perl modules from CPAN.

Pasted below is the part of my apache config dealing with the RT site:

ServerRoot “/opt/rt3/share/html”

LoadModule perl_module /usr/lib/apache2/mod_perl.so

DocumentRoot “/opt/rt3/share/html”

Options FollowSymLinks Indexes AllowOverride None

<Directory “/opt/rt3/share/html”>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

DirectoryIndex index.html index.html.var index.php index.php3 index.cgi
index.pl

<Directory “/srv/www/perl-lib”>
AllowOverride None
Options None
Order allow,deny
Deny from all

PerlRequire "/etc/apache2/mod_perl-startup.pl" PerlRequire "/opt/rt3/bin/webmux.pl"
ScriptAlias /perl/ "/srv/www/cgi-bin/"
<Location /perl/>
    # mod_perl mode
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Location>

ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
<Location /cgi-perl>
    # perl cgi mode
    SetHandler  perl-script
    PerlResponseHandler ModPerl::PerlRun
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Location>
SetHandler perl-script PerlHandler RT::Mason SetHandler default-handler

I had the same problem, I can’t recall the exact cause, but it was certainly something to do with Mason. I had found a fix, but it was not entirely satisfactory, since some things like RSS feedsa and CSV exports stopped working.

Working off the fix I found, I corrected those 2 issues, as well as made graph from the statistics addon work. Below is the relevant portion of my apache config

PerlModule Apache2 Apache::compat
PerlModule Apache::DBI
PerlRequire /opt/rt3/bin/webmux.pl

Catch the html files

<FilesMatch “.html$”>
SetHandler perl-script
PerlHandler RT::Mason

The csv exports…

<FilesMatch “.tsv.*$”>
SetHandler perl-script
PerlHandler RT::Mason

The RSS feeds…

<FilesMatch “.rdf.*$”>
SetHandler perl-script
PerlHandler RT::Mason

not sure, this came with the solution I found

<LocationMatch “/REST/”>
SetHandler perl-script
PerlHandler RT::Mason

Again, foudn with solution

<LocationMatch “/Attachment/”>
SetHandler perl-script
PerlHandler RT::Mason

This one is for the graph produced by the statistics addon

<LocationMatch “Elements/Chart.*”>
SetHandler perl-script
PerlHandler RT::Mason

The same problem exists with sub-pages: clicking on the “Configuration” tab
takes me to http://help.studentuniverse.com/Admin/ – and I get a “The
requested URL /Admin/ was not found on this server.” error. Going to
http://help.studentuniverse.com/Admin/index.html works fine.

It is a known problem. As the README says:

RewriteEngine On
RewriteRule ^(.*)/$ $1/index.html

Alternatively, if you don’t need to preserve the /Admin/ URL and do not plan
to POST into it, this will also do:

RedirectMatch permanent (.*)/$ $1/index.html

Thanks,
/Autrijus/