Hi Rob,
> 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,
Me too 8^) I'm a Mason junkie for going on 4 years now I think - since 0.4
8^)
> I went to go
> upgrade, and broke EVERYTHING.
There are some very specific differences. Make sure that you are setting up
the ApacheHandler correctly - you may need to compare the handler included
in the distribution. Most importantly make sure you have
use HTML::Mason::ApacheHandler;
I did not see this in your sample attachment.
> 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,
This is not correct - I use a drastically different component root than my
document root on all of my installations, specifically for security reasons.
Make sure you un-comment the lines in the handler.pl for:
chown ( scalar(getpwnam "nobody"), scalar(getgrnam "nobody"),
$interp->files_written );
Substitute the "nobody" for the user & group your web server runs under. The
transient files created by Mason will need to be writable by that user, and
the Mason handler will take care of the permissions issues for you.
> 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)
I would generally use a directory structure like:
AppName/web/pub/ (document root, public HTML documents and top-level Mason
components)
AppName/web/elements/ (non top-level Mason components)
And then set the component root to AppName/web, allowing you to use absolute
references in your <& &> and $m->comp calls such as
$m->comp("/elements/banner.html"), or <& /elements/footer.html &>
This ensures that banner.html and footer.html are NOT accessible directly
via the web server.
My Mason Interpreter object is usually set up like:
my $interp = new HTML::Mason::Interp (parser=>$parser,
allow_recursive_autohandlers=>undef,
comp_root=>'/home/www/AppName/web',
data_dir=>'/var/masondata');
Then my VirtualHost directive sets:
DocumentRoot /home/www/AppName/pub
Check out that use directive I noted at the top - it might be your sticking
point.
Good Luck!
Steve