From: Boris Z. <bz...@2b...> - 2004-05-06 20:45:41
|
Hi Pieter, Am Donnerstag, 6. Mai 2004 21:53 schrieb pdu...@so...: > Hi, > > I'm happy to say that I installed PageKit and that I got the demo > > working in DocumentRoot. I then read the FAQ: > > Can I run more as one site with one Apache Server? > > > > Sure, as long as ... > > I wasn't so interested in getting more than one site running, and did > not try it. What I wanted to try was to move the Location from / to > /pagekit: > We have already a solution to move pagekit to a different location. Just do <Perl> use Apache::PageKit(); Apache::PageKit->startup('/var/www/pagekit','staging'); </Perl> <Location /pagekit> SetHandler perl-script PerlSetVar PKIT_ROOT /var/www/pagekit PerlSetVar PKIT_SERVER staging PerlHandler +Apache::PageKit </Location> It looks a bit mad, but this config works on Apache 1.3 and Apache 2. sure you must add uri_prefix="/pagekit" in the global section of your Config.xml. See: http://www.pagekit.org/guide/reference.html#d0e694 > Working httpd.conf (Location = DocumentRoot): > > #<Perl> > # use Apache::DB (); > # Apache::DB->init; > #</Perl> > #PerlFixupHandler +Apache::DB > > SetHandler perl-script > PerlModule Apache::ErrorReport > PerlSetVar ErrorReportHandler display > > PerlSetVar PKIT_ROOT /var/www/pagekit > PerlSetVar PKIT_SERVER staging > PerlSetVar PKIT_DOCROOT /pagekit > PerlHandler +Apache::PageKit > <Perl> > Apache::PageKit->startup; > </Perl> > ###################### > > Non-working httpd.conf (Location != DocumentRoot): > > <Location /pagekit> > #<Perl> > # use Apache::DB (); > # Apache::DB->init; > #</Perl> > #PerlFixupHandler +Apache::DB > > SetHandler perl-script > PerlModule Apache::ErrorReport > PerlSetVar ErrorReportHandler display > > PerlSetVar PKIT_ROOT /var/www/pagekit > PerlSetVar PKIT_SERVER staging > PerlSetVar PKIT_DOCROOT /pagekit > PerlHandler +Apache::PageKit > <Perl> > Apache::PageKit->startup; > </Perl> > </Location> > ###################### > > The first problem was obvious: PKIT_ROOT and PKIT_SERVER is not set > up, or are not read properly, when declared inside <Location>. > The quick fix was: > > PerlSetVar PKIT_ROOT /var/www/pagekit > PerlSetVar PKIT_SERVER staging > > <Location /pagekit> > #<Perl> > # use Apache::DB (); > # Apache::DB->init; > #</Perl> > #PerlFixupHandler +Apache::DB > > SetHandler perl-script > PerlModule Apache::ErrorReport > PerlSetVar ErrorReportHandler display > > #PerlSetVar PKIT_ROOT /var/www/pagekit > #PerlSetVar PKIT_SERVER staging > PerlSetVar PKIT_DOCROOT /pagekit > PerlHandler +Apache::PageKit > <Perl> > Apache::PageKit->startup; > </Perl> > </Location> > > I now got apache to accept the httpd.conf file again. The next problem > (the one that I made the patch for), was that the index page was being > served the whole time. PageKit.pm seems to assume that the <Location> > is alway = <DocumentRoot>. > > The fix I made, incorporates another PKIT_ variable, that I called > PKIT_DOCROOT (PKIT_LOCATION might be better???). This variable is then > used in PageKit.pm and Edit.pm, in order to fix the hrefs. With my > attached patch, I managed to get the demo working, regardless of the > <Location>, if and only if the PKIT_DOCROOT variable is set to the > <Location>. A small note: PerlSetVar works within <Location> for > PKIT_DOCROOT, as it is read at request-time. And a last note: > View/Default/pkit_edit/open_file.tmpl has a hard-coded part: > <form action="/pkit_edit/commit_file?... > ^^^ > This still needs to be solved. Who has a good idea? This was a bug and is already resolved in pagekit 1.14_01 http://eg.2bz.de/Apache-PageKit-1.14_01.tar.gz > > I think it is essential that PKIT_ROOT needs to be able to be > specified within <Location>. Do you want me to have a look at how this > could be done? This is a mod_perl issue. What version do you use? > > Finally, after giving up on php, mason and a few others, I learnt > HTML::Template and started writing all mu stuff with that. Fortunately > I discovered Apache::PageKit, as I would probably only have arrived at > such an elegant solution only in a few years... Well done! You saw the > light before the rest. I'll be keen to assist, permitting I find the > time to do so. > > cu > -- > Pieter du Preez -- Boris |