Apache::PageKit::FAQ -- The Frequently Asked Questions for Apache::PageKit
perldoc Apache::PageKit::FAQ
This document serves to answer the most frequently asked questions for Apache::PageKit.
PageKit is an mod_perl based application framework that uses HTML::Template and XML to separate code, design, and content. Includes session management, authentication, form validation, co-branding, and a content management system.
Its goal is to solve all the common problems of web programming, and to make the creation and maintenance of dynamic web sites fast, easy and enjoyable.
The Comprehensive Perl Archive Network.
Apache::PageKit may be downloaded from CPAN via:
http://www.perl.com/cgi-bin/cpan_mod?module=Apache-PageKit
http://search.cpan.org/search?dist=Apache-PageKit
XML (eXtensible Markup Language) is a way to store data and meta-data. The meta-data gives applications the ability to 'understand' the data and work with it in an intelligent fashion. For more information check the sites below:
http://www.w3.org/TR/1998/REC-xml-19980210 http://www.xml.com/
XSLT (eXtensible Stylesheet Language: Transformations)
http://www.w3.org/TR/xslt http://www.w3.org/Style/XSL/ http://www.xslinfo.com/ http://www.oasis-open.org/cover/xsl.html http://www.xml.com/
XSLT is a language used to apply transformations to XML. This powerful tool helps seperate Content from the Presentation by changing the way the XML is presented to the end user. It can be used to reformat the XML into HTML, WML, XML, PDF, POD or any other template you come up with.
Yes, http://www.pagekit.org and http://sourceforge.net/projects/pagekit/
Yes, one for users and one for developers.
To subscribe look here:
http://lists.sourceforge.net/mailman/listinfo/pagekit-users http://lists.sourceforge.net/mailman/listinfo/pagekit-devel
Yes,
http://www.geocrawler.com/redir-sf.php3?list=pagekit-users http://www.geocrawler.com/redir-sf.php3?list=pagekit-devel
Apache is often compiled with the expat-lite library which is incompatible with the XML::Parser module. PageKit prior to 1.08 requires XML::Parser. You'll have to compile Apache with --disable-rule=expat for these early versions of PageKit.
It is recommended that you upgrade to PageKit 1.08 or higher, which doesn't require XML::Parser or expat. However, if your code uses XML::Parser Apache will still segfault. In this case you must recompile Apache with --disable-rule=expat or remove dependencies on XML::Parser in your code.
The mod_perl guide has an excellect section on compiling mod_perl and Apache from source. http://perl.apache.org/guide/
No, if you use Apache::PageKit >= 1.08 and promise to never use XML::Parser
. Else yes, you must recompile Apache.
You use mod_perl-1.28 or higher. Apache::test is obsolete and renamed to Apache::testold. The future is Apache::Test. To get around the error type
perl -i -pe 's/Apache::test\b/Apache::testold/g' Makefile.PL
Or even better upgrade Apache::Pagekit to a version > 1.11. There we use Apache::Test.
You use perl >= 5.8.1 which includes a new version of ExtUtils::MakeMaker. Read more here: http://marc.theaimsgroup.com/?l=perl5-porters&m=105981649201380&w=2 http://marc.theaimsgroup.com/?l=apreq-dev&m=106146287323705&w=2
To fix the problem apply this patch from Steve Hay or use libapreq-1.3
--- c/Makefile.PL.orig 2001-04-03 20:24:12.000000000 +0100 +++ c/Makefile.PL 2003-08-21 11:31:42.000000000 +0100 @@ -34,7 +34,8 @@ sub MY::dynamic { my $self = shift; my $string = $self->MM::dynamic; - $string =~ s/(Makefile\s+).*/$1/g; + $string =~ s{ \$\(INST_DYNAMIC\)}{}g; + $string =~ s{ \$\(INST_BOOT\)}{}g; $string; }
You have several options, some follows.
cp -R .../Apache-PageKit-x.yz/eg .../htdocs/.../pagekit
edit MyModel/Model.pm, MyModel/Common.pm and Config/Config.xml and add Apache::PageKit as the
handler for this dir in yout httpd.conf
.
Sure, as long as the Perl Classes don't conflict. (You can't run both production and development PageKits on the same server, unless you make sure that the Classes have different names.) You will also have to make sure that the PKIT_ROOT and cache_dir configuration option are distinct for each server. If cache_dir is not set for either of them, that should be fine, since it defaults to PKIT_ROOT/View/pkit_cache.
To set up, use the Apache <Location> or <Files> configuration directives.
Sure, you have to provide uniq sets of PageKit-modules and a uniq pkit_cache dir thats all.
Yes, you have to use Apache::PageKit 1.08 or higher. In your Config/Config.xml change or add this line in the global section:
template_class = "HTML::Template::Expr"
For more information type perldoc HTML::Template::Expr.
As an undocumented feature of HTML::Template, loop_context_vars must be written in lowercase if your template is case_sensitive. <CONTENT_...> is case sensitive. So change __FIRST__, __LAST__, __INNER__, __ODD__ to __first__, __last__, __inner__, __odd__.
If you call $model->apr->upload;
Then this will return a single
Apache::Upload object in a scalar context or all Apache::Upload
objects in an array context. This is because $model->apr
returns a Apache::Request object.
You did not use Apache::DBI. Load (use) Apache::DBI in your startup.pl file. If for some reason the use of Apache::DBI is not possible, close the connection in the pkit_cleanup methode.
something like this will do:
sub pkit_cleanup { my $dbh = shift->dbh; $dbh && $dbh->disconnect; }
Pagekit is known to run at least on the following systems:
Darwin 6.4 powerpc FreeBSD 4.3 FreeBSD 4.4 FreeBSD 4.5 FreeBSD 4.6 HP UX 10 HP UX 11 Linux 2.2 Linux 2.4 Solaris 7 x86 Solaris 8 sparc Solaris 8 x86 Solaris 9 sparc Win 2000 Win ME Win NT
Add *CORE::GLOBAL::flock = sub {1};
to your startup.pl or in your httpd.conf file inside a <Perl> block:
<Perl> *CORE::GLOBAL::flock = sub {1}; </Perl>
This appears to be a DBD::mysql issue - see http://rt.cpan.org/NoAuth/Bug.html?id=1717 A workaround is to stringify the session_id if it is a number.
Install MD5. It is not part of perl core anymore. Or install this patch:
--- SessionX/Generate/MD5.pm.orig 2002-11-11 08:35:54.000000000 +0100 +++ SessionX/Generate/MD5.pm 2002-11-11 08:37:44.000000000 +0100 @@ -12,12 +12,12 @@
use strict; use vars qw($VERSION); -use MD5; +use Digest::MD5;
$VERSION = '2.1';
sub generate { - my $session = shift; + my $session = shift; my $arg = shift; my $length = 32;
@@ -26,7 +26,7 @@ }
$session->{data}->{_session_id} = - substr(MD5->hexhash(MD5->hexhash($arg || (time(). {}. rand(). $$))), 0, $length); + substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex($arg || (time(). {}. rand(). $$))), 0, $length);
}
This document is currently at version 0.03, as of Feb 10th, 2003.
Boris Zentner (boris@id9.de)
TJ Mather (tjmather@tjmater.com)
Fixes, Bug Reports, Docs have been generously provided by:
Tomasz Konefal Anton Permyakov Vladimir Bogdanov Rob Starkey Eugene Rachinsky
Parts of this FAQ are taken from the Apache::PageKit distribution and the website at http://www.pagekit.org/.
Copyright (c) 2001 TJ Mather Copyright (c) 2002, 2003 Boris Zentner
This FAQ is free software; you can redistribute it and/or modify it under the same terms as Perl itself.