Apache-PageKit

 view release on metacpan or  search on metacpan

lib/Apache/PageKit/FAQ.pod  view on Meta::CPAN

  +    $string =~ s{ \$\(INST_BOOT\)}{}g;
       $string;
   }

=head1 Migrating to I<Apache::PageKit> from...

=head2 3.1 I already have a website and I want to extend it with Apache::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<Apache::PageKit>.

=item *

Copy the eg site of I<Apache::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<Apache::PageKit> as the
handler for this dir in yout C<httpd.conf>.

=back

=head1 I<Apache::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<Apache::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<Apache::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?

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

=head2 6.3 My OS did not support flock, what can i do?

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>

=head1 Troubleshooting

=head2 I'm using MySQL Apache::Session store class and I'm getting DBD::mysql::st execute failed: Duplicate entry errors

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.

=head2 My sessions do not work. I'm using perl 5.8 and Apache::SessionX 2.00b3.



( run in 0.843 second using v1.01-cache-2.11-cpan-b16cb0d3907 )