These instructions outline how to set up the HTML::Mason templating system to generate dynamic web pages for your site on our shared webservers. Substitute your user name for yourusername, and, where appropriate, your domain name for yourdomainname, throughout.
cd public_html
cd corp-web/yourdomainname
mkdir pcgi-bin chmod 701 pcgi-bin/
#!/usr/local/bin/perl5.6.1 $ENV{ PATH_INFO } =~ s{/~\w+}{}; use HTML::Mason::CGIHandler;
- • Single-user & Cheap-web customers:
my $h = new HTML::Mason::CGIHandler(comp_root=>'/htdocs/userdirs/yourusername');- • Corporate customers:
my $h = new HTML::Mason::CGIHandler(comp_root=>'/htdocs/corp-dirs/yourusername/yourdomainname');$h->handle_request;
chmod 500 pcgi-bin/mason-handler.cgi
AddHandler html-mason mhtml
- • Single-user & Cheap-web customers:
Action html-mason http://www.panix.com/~yourusername/pcgi-bin/mason-handler.cgi- • Corporate customers:
Action html-mason http://yourdomainname/pcgi-bin/mason-handler.cgi
> cat mason-test.mhtml
<dl>
<%perl>
foreach my $key (sort keys %ENV) {
</%perl>
<dt><% $key %></dt><dd><% $ENV{$key} %></dd>
<%perl>
}
</%perl>
</dl>
> cat autohandler
<!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>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<title><% $m->request_comp->attr('title') %></title>
</head>
<body>
<% $m->call_next() %>
</body>
</html>
If you need additional help with this software, you can find it online on its primary web site, http://www.masonhq.com/
© Copyright 2010-2011, Public Access Networks Corporation
[ Panix Home ] [ Help System Index ] [ Top of This Page ]