/usr/share/doc/libhtml-mason-perl-doc/html/Mason.html is in libhtml-mason-perl-doc 1:1.48-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | <?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mason - High-performance, dynamic web site authoring system</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:autarch@houseabsolute.urth.org" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><A NAME="__index__"></a></p>
<ul>
<li><A HREF="#name">NAME</a></li>
<li><A HREF="#synopsis">SYNOPSIS</a></li>
<li><A HREF="#description">DESCRIPTION</a></li>
<li><A HREF="#mason_1__html__mason__versus_mas">MASON 1 (HTML::MASON) VERSUS MASON 2 (MASON)</a></li>
<li><A HREF="#installation">INSTALLATION</a></li>
<li><A HREF="#configuring_mason">CONFIGURING MASON</a></li>
<li><A HREF="#documentation_roadmap">DOCUMENTATION ROADMAP</a></li>
<li><A HREF="#authors">AUTHORS</a></li>
<li><A HREF="#copyright">COPYRIGHT</a></li>
<li><A HREF="#see_also">SEE ALSO</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<h1><A NAME="name">NAME</a></h1>
<p>Mason - High-performance, dynamic web site authoring system</p>
<p>
</p>
<hr />
<h1><A NAME="synopsis">SYNOPSIS</a></h1>
<pre>
PerlModule HTML::Mason::ApacheHandler</pre>
<pre>
<Location />
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Location></pre>
<p>
</p>
<hr />
<h1><A NAME="description">DESCRIPTION</a></h1>
<p>Mason is a tool for building, serving and managing large web
sites. Its features make it an ideal backend for high load sites
serving dynamic content, such as online newspapers or database driven
e-commerce sites.</p>
<p>Actually, Mason can be used to generate any sort of text, whether for
a web site or not. But it was originally built for web sites and
since that's why most people are interested in it, that is the focus
of this documentation.</p>
<p>Mason's various pieces revolve around the notion of "components''. A
component is a mix of HTML, Perl, and special Mason commands, one
component per file. So-called "top-level" components represent entire
web-pages, while smaller components typically return HTML snippets for
embedding in top-level components. This object-like architecture
greatly simplifies site maintenance: change a shared component, and
you instantly changed all dependent pages that refer to it across a
site (or across many virtual sites).</p>
<p>Mason's component syntax lets designers separate a web page into
programmatic and design elements. This means the esoteric Perl bits
can be hidden near the bottom of a component, preloading simple
variables for use above in the HTML. In our own experience, this frees
content managers (i.e., non-programmers) to work on the layout without
getting mired in programming details. Techies, however, still enjoy
the full power of Perl.</p>
<p>Mason works by intercepting innocent-looking requests (say,
<a href="http://www.yoursite.com/index.html)">http://www.yoursite.com/index.html)</a> and mapping them to requests for
Mason components. Mason then compiles the component, runs it, and
feeds the output back to the client.</p>
<p>Consider this simple Mason component:</p>
<pre>
% my $noun = 'World';
Hello <% $noun %>!
How are ya?</pre>
<p>The output of this component is:</p>
<pre>
Hello World!
How are ya?</pre>
<p>In this component you see a mix of standard HTML and Mason
elements. The bare '%' prefixing the first line tells Mason that this
is a line of Perl code. One line below, the embedded <%
... %> tag gets replaced with the return value of its contents,
evaluated as a Perl expression.</p>
<p>Beyond this trivial example, components can also embed serious chunks
of Perl code (say, to pull records from a database). They can also
call other components, cache results for later reuse, and perform all
the tricks you expect from a regular Perl program.</p>
<p>
</p>
<hr />
<h1><A NAME="mason_1__html__mason__versus_mas">MASON 1 (HTML::MASON) VERSUS MASON 2 (MASON)</a></h1>
<p>Version 1 of Mason -- <a HREF="Mason.html">HTML::Mason</a> -- has been around since
1998, is in wide use, and is very stable. However it has not changed much in
years and is no longer actively developed.</p>
<p>Version 2 of Mason -- <em>Mason</em> -- was released in February of 2011.
It is being very actively developed and has a much more modern
architecture. If you are just starting out, we recommend you give Mason 2 a
try.</p>
<p>For a summary of differences between Mason 1 and 2 see</p>
<pre>
<a href="http://www.openswartz.com/2011/02/21/announcing-mason-2/">http://www.openswartz.com/2011/02/21/announcing-mason-2/</a></pre>
<p>
</p>
<hr />
<h1><A NAME="installation">INSTALLATION</a></h1>
<p>Mason has been tested under Linux, FreeBSD, Solaris, HPUX, and
Win32. As an all-Perl solution, it should work on any machine that has
working versions of Perl 5.00503+, mod_perl, and the required CPAN
modules.</p>
<p>Mason has a standard MakeMaker-driven installation. See the README
file for details.</p>
<p>
</p>
<hr />
<h1><A NAME="configuring_mason">CONFIGURING MASON</a></h1>
<p>This section assumes that you are able to install and configure a
mod_perl server. Relevant documentation is available at
<a href="http://www.apache.org">http://www.apache.org</a> (Apache) and <a href="http://perl.apache.org">http://perl.apache.org</a>
(mod_perl). The mod_perl mailing list, archive, and guide are also
great resources.</p>
<p>The simplest configuration of Mason requires a few lines in your
httpd.conf:</p>
<pre>
PerlModule HTML::Mason::ApacheHandler</pre>
<pre>
<Location />
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Location></pre>
<p>The PerlModule directive simply ensures that the Mason code is loaded
in the parent process before forking, which can save some memory when
running mod_perl.</p>
<p>The <Location> section routes all requests to the Mason handler, which
is a simple way to try out Mason. A more refined setup is discussed
in the <A HREF="Admin.html#controlling_access_via_filename_">Controlling Access via Filename Extension</a> section of the administrator's manual.</p>
<p>Once you have added the configuration directives, restart the
server. First, go to a standard URL on your site to make sure you
haven't broken anything. If all goes well you should see the same page
as before. If not, recheck your Apache config files and also tail your
server's error log.</p>
<p>If you are getting "404 Not Found" errors even when the files clearly
exist, Mason may be having trouble with your document root. One
situation that will unfortunately confuse Mason is if your document
root goes through a symbolic link. Try expressing your document root
in terms of the true filesystem path.</p>
<p>Next, try adding the tag <% 2+2 %> at the top of some HTML file. If you
reload this page and see a "4", Mason is working!</p>
<p>
</p>
<hr />
<h1><A NAME="documentation_roadmap">DOCUMENTATION ROADMAP</a></h1>
<p>Once Mason is on its feet, the next step is to write a component or
two. The <a HREF="Devel.html">Mason Developer's Manual</a> is a
complete tutorial for writing, using, and debugging components. A
reference companion to the Developer's Manual is the Request API
documentation, <a HREF="Request.html">HTML::Mason::Request</a>.</p>
<p>Whoever is responsible for setting up and tuning Mason should read the
<a HREF="Admin.html">Administrator's Manual</a>, though developers
will also benefit from reading it as well. This document covers more
advanced configuration scenarios and performance optimization. The
reference companion to the Administrator's manual is the
<a HREF="Params.html">Parameters Reference</a>, which describes all the
parameters you can use to configure Mason.</p>
<p>Most of this documentation assumes that you're running Mason on top of
mod_perl, since that is the most common configuration. If you would
like to run Mason via a CGI script, refer to the
<a HREF="CGIHandler.html">HTML::Mason::CGIHandler</a> documentation.
If you are using Mason from a standalone program, refer to
the <A HREF="Admin.html#using_mason_from_a_standalone_sc">Using Mason from a Standalone Script</a> section of the administrator's manual.</p>
<p>There is also a book about Mason, <em>Embedding Perl in HTML with
Mason</em>, by Dave Rolsky and Ken Williams, published by O'Reilly and
Associates. The book's website is at <a href="http://www.masonbook.com/.">http://www.masonbook.com/.</a> This
book goes into detail on a number of topics, and includes a chapter of
recipes as well as a sample Mason-based website.</p>
<p>
</p>
<hr />
<h1><A NAME="authors">AUTHORS</a></h1>
<p>Jonathan Swartz <<a href="mailto:swartz@pobox.com">swartz@pobox.com</a>>, Dave Rolsky <<a href="mailto:autarch@urth.org">autarch@urth.org</a>>, Ken Williams <<a href="mailto:ken@mathforum.org">ken@mathforum.org</a>>, John Williams <<a href="mailto:williams@tni.com">williams@tni.com</a>></p>
<p>
</p>
<hr />
<h1><A NAME="copyright">COPYRIGHT</a></h1>
<p>Copyright (c) 1998-2005 Jonathan Swartz. All rights reserved. This
program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.</p>
<p>The full text of the license can be found in the LICENSE file included
with this module.</p>
<p>
</p>
<hr />
<h1><A NAME="see_also">SEE ALSO</a></h1>
<p><a HREF="Devel.html">HTML::Mason::Devel</a>,
<a HREF="Admin.html">HTML::Mason::Admin</a></p>
</body>
</html>
|