[oclug] OT: HTML::Mason contrib for SME server
Michael P. Soulier
msoulier at digitaltorque.ca
Sun Jun 22 11:31:37 EDT 2003
Greetings. If you don't use the SME server (formerly e-smith server
and gateway), or HTML::Mason, feel free to delete this now.
Being a fan of HTML::Mason (http://www.masonhq.com) for web
development, I've put together a contrib based on my own modifications
to get HTML::Mason working on 5.6. It should work on 6.0 as well, but I
haven't had time to test it there yet.
HTML::Mason is a solution for embedding Perl in HTML pages that goes
far beyond traditional approaches like Embperl, HTML::Template and
Text::Template (which we know and love). While many use PHP for such
solutions, I personally find PHP to be poorly designed, am more
comfortable in Perl, and find the CPAN to be indispensible.
I have not yet written a panel for it, so the interface is all
command-line. Once installed, individual ibays can be Mason-enabled, if
they correspond to virtual hosts. The exception is the primary ibay. In
the future I plan to fix this limitation to permit any ibay to be
Mason-enabled, with or without a virtual host.
The property to enable mason is called 'Mason', with global
variables made available via 'MasonGlobals'.
Example: Mason-enable the primary ibay.
/sbin/e-smith/db accounts setprop primary Mason enabled
Example: Mason-enable a virtually-hosted ibay, with $dbh and $schema
/sbin/e-smith/db accounts setprop <ibay> Mason enabled
/sbin/e-smith/db accounts setprop <ibay> MasonGlobals '$dbh,$schema'
The default setup is to tell apache to pass any .html files to
Mason, and to hide .mas and /handler/ files. At some point I will also
make this configurable, as some prefer .mhtml, and even .css for dynamic
This contrib currently uses two custom templates. There's probably a
better way, stay tuned. In the meantime, if you have 20LoadModule80
and/or 30AddModule60 custom templates for apache, move them before
installing this contrib, and then you can merge them. mod_perl must be
enabled for this contrib.
The rpms you'll need are:
These are all available in my contrib area on any e-smith.org
download mirror. For example...
Warning: I have not heavily tested this, but it is currently running
two Mason-enabled virtual hosts on my 5.6 server. I'll test it on 6.0
Please report any problems directly to me, as this is _not_ a
supported work of Mitel Networks.
More information on HTML::Mason:
Michael P. Soulier <msoulier at digitaltorque.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort." -Harley Hahn, A Student's Guide to Unix
IM: msoulier at jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20030622/f7079c28/attachment.bin
More information about the OCLUG