[Maypole] /beerdb only shows directory listing

Daniel R. Allen daniel@coder.com
Thu, 5 Aug 2004 05:52:42 -0400 (EDT)


Hi all,

I don't have sufficient mod_perl-fu to figure this out on my own.

I followed the cookbook examples from
http://maypole.simon-cozens.org/doc/beerdb.html and
http://wiki.simon-cozens.org/index.cgi?InstallationIssues

however, /beerdb on my server shows a directory listing.

I'm using: maypole 1.7; debian stable apache/mod_perl; and fresh
module installs from CPAN of other required modules.

My apache.conf has:

### maypole test ###

<Perl>
   use lib '/home/user/beerdb/lib';
</Perl>

<Location /beerdb>
    SetHandler perl-script
    PerlHandler BeerDB
</Location>


/home/user/beerdb/lib/BeerDB has:

package BeerDB;
use base 'Apache::MVC';

BeerDB->setup("dbi:SQLite:/usr/local/src/cpan/build/Maypole-1.7/t/beerdb.db");
BeerDB->config->{uri_base} = "http://domain.com:1081/beerdb/";
BeerDB->config->{rows_per_page} = 10;
BeerDB->config->{display_tables} = [qw[beer brewery pub style]];
BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
BeerDB::Beer->untaint_columns(
    printable => [qw/abv name price notes/],
    integer => [qw/style brewery score/],
    date => [ qw/date/],
);

use Class::DBI::Loader::Relationship;
BeerDB->config->{loader}->relationship($_) for (
    "a brewery produces beers",
    "a style defines beers",
    "a pub has beers on handpumps");
1;


mod_perl is running; a simple http://domain.com:1081/perl/test.pl
gives me a proper output (tested with httpd -X).

perl Maypole-1.7/t/1.t runs with no errors.

http://domain.com:1081/beerdb/ gives me a directory listing.  I can go
down into the beer and custom subdirectories, and selecting any of the
scripts displays the source in the browser.

% HEAD http://domain.com:1081
200 OK
Connection: close
Date: Thu, 05 Aug 2004 09:30:43 GMT
Accept-Ranges: bytes
ETag: "411c8-10a7-3f74a6a8"
Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_perl/1.26
Content-Length: 4263
Content-Type: text/html; charset=iso-8859-1
Last-Modified: Fri, 26 Sep 2003 20:50:48 GMT
Client-Date: Thu, 05 Aug 2004 09:30:43 GMT
Client-Peer: 127.0.0.1:1081
Client-Response-Num: 1

The httpd error logs don't show any errors when I visit /beer in the
browser, either via regular apache or single-child httpd -X.

When I try to visit of the scripts such as /beerdb/beer/addnew
I see the text of the script in the browser, and the error log gets:
file error - beeraddnew: not found at /usr/local/share/perl/5.6.1/Maypole/View/Base.pm line 68.


SQLite is running; I was able to use:
dbish dbi:SQLite:/usr/local/src/cpan/build/Maypole-1.7/t/beerdb.db

to browse the beer database.  I'm using SQLite 0.36.

Any ideas what I should check next?

Thanks,

-Daniel

--
http://kw.pm.org/ - Kitchener-Waterloo Perl Mongers -         da@kw.pm.org
http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da@coder.com