Apache2-PageKit
view release on metacpan or search on metacpan
lib/Apache2/PageKit/FAQ.pod view on Meta::CPAN
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/
=head2 2.2 Do I really need to recompile Apache? It works without I<Apache2::PageKit>.
No, if you use I<Apache2::PageKit E<gt>= 1.08> and promise to never use C<XML::Parser>. Else yes, you must recompile Apache.
=head2 2.3 perl Makefile.PL result in Can't locate Apache/test.pm in @INC ...
You use I<mod_perl-1.28> or higher. I<Apache::test> is obsolete and renamed to
Apache::testold. The future is I<Apache::Test>. To get around the error type
perl -i -pe 's/Apache::test\b/Apache::testold/g' Makefile.PL
Or even better upgrade I<Apache::Pagekit> to a version > 1.11. There we use
I<Apache::Test>.
=head2 2.4 I can not build libapreq or it stops working after a reboot.
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 I<libapreq-1.3>
--- c/Makefile.PL.orig 2001-04-03 20:24:12.000000000 +0100
+++ c/Makefile.PL 2004-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;
}
=head1 Migrating to I<Apache2::PageKit> from...
=head2 3.1 I already have a website and I want to extend it with Apache2::PageKit. Where can I put my data?
You have several options, some follows.
=over 2
=item *
Copy your whole site into the directory View/Default/. Of the edited eg site of I<Apache2::PageKit>.
=item *
Copy the eg site of I<Apache2::PageKit> to a directory in the rootdir of your site ie:
cp -R .../Apache-PageKit-x.yz/eg .../htdocs/.../pagekit
edit MyModel/Model.pm, MyModel/Common.pm and Config/Config.xml and add I<Apache2::PageKit> as the
handler for this dir in yout C<httpd.conf>.
=back
=head1 I<Apache2::PageKit> beginner's FAQ's
=head2 4.1 Can I run more as one site with one Apache Server?
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.
=head2 4.2 Can I use I<Apache2::PageKit> inside Apache <VirtualHost> configuration directives?
Sure, you have to provide uniq sets of PageKit-modules and a uniq pkit_cache dir thats all.
=head1 xxxx
=head2 5.1 Is it possible to use expressions in <(MODEL|CONTENT)_(IF|UNLESS|VAR)> tags?
Yes, you have to use I<Apache2::PageKit 1.08> or higher. In your B<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.
=head2 5.2 I'm using loop_context_vars as descriped in the HTML::Template manual within my <CONTENT_(IF|UNLESS)> tags, but it did not work.
As an undocumented feature of HTML::Template, loop_context_vars B<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__.
=head2 5.3 How do I deal with uploads?
If you call C<< $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 C<< $model->apr >>
returns a Apache::Request object.
=head2 5.4 My Database busted after some time - What is wrong?
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;
}
=head1 PageKit on Operatingsystem X
=head2 6.1 Did PageKit run on my systems?
( run in 0.520 second using v1.01-cache-2.11-cpan-39bf76dae61 )