I've been using HTML::Mason under mod_perl on my site for awhile, using
0.89, and I like it lots. :-) So when the new 1.0 came out, I went to go
upgrade, and broke EVERYTHING.
Not only that, but, I haven't been able to make sense out of what Mason
wants for its dir heirarchy, anyway:
First, comp_root (apparently) needs to be the same as DocumentRoot, which
seems horribly insecure... if I could find another way to do it, I would,
but for now, knowing the path my components run under makes them viewable
_AS SOURCE_ by anyone who knows the url.
and in the same vein, the *ONLY* way I could get it to run was to put it's
data_dir under DocumentRoot as well. ????????
Why can't I have
/home/httpd/html
/home/httpd/components (instead of /home/httpd/html/components)
/home/httpd/mason (instead of /home/httpd/html/mason)
? Or more correctly, how do I tell Mason to use that kind of strucure?
And what (the docs don't say, the changelog isn't indicative) changed in the
required setup procedure at 1.0? My friend called me wanting to do
HTML::Mason, which I told him was absolutely awesome for development, but he
couldn't get it running at all (he only had access to the 1.0 from CPAN)
(and we only had my working config to start with).
This is the relevant section of my startup.pl:
=============================================
package HTML::Mason;
use strict;
use Apache::Constants qw(:common);
use Date::Format;
local $| = 1;
my $parser = new HTML::Mason::Parser;
my $interp = new HTML::Mason::Interp ( parser => $parser,
comp_root => '/home/httpd/html',
data_dir =>
'/home/httpd/html/mason', );
my $ah = new HTML::Mason::ApacheHandler ( interp => $interp,
output_mode => 'batch',
# output_mode => 'stream',
error_mode => 'html', # fatal
debug_mode => 'all',
debug_perl_binary =>
'/usr/bin/perl',
debug_handler_script =>
'/etc/httpd/lib/perl/startup.pl',
debug_handler_proc =>
'HTML::Mason::handler', );
# {{{ setuid/taint shut UP!
if (0) {
my @test = ( qw/1 2 3/ );
my @files_written = map {/(.*)/; $1} @test # $interp->files_written
;
warn "Trying to deal w/ tainting: >",
Data::Dumper->Dump([ \@files_written ], [ qw/files_written/ ] ) ,
"<\n";
chown( [getpwnam('nobody')]->[2],[getpwnam('nobody')]->[2],
@files_written );
}
# }}}
sub handler {
my ($r) = @_;
$ah->handle_request($r);
}
# {{{ globals
{
package HTML::Mason::Commands;
use vars qw($dbh %session);
# my ($dsn, $user, $pass) = (My::dbi_connect_string(),
My::dbi_pwd_fetch());
# $dsn = 'dbi:Proxy:hostname=devel;port=3333;dsn=' . $dsn;
{
local $^W = 1;
# ( dsn, username, password )
# $interp->set_global(dbh => DBI->connect(My::dbi_connect_string(),
My::dbi_pwd_fetch()));
#$dbh = DBI->connect(My::dbi_connect_string(),
My::dbi_pwd_fetch()) or die DBI->errstr;
#$dbh->{AutoCommit} = 0;
}
}
# }}} globals
=============================================
TIA!!!!
L8r,
Rob
#!/usr/bin/perl -w
use Disclaimer qw/:standard/;