From: <pdu...@so...> - 2004-05-06 19:53:32
|
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: 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? 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? 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 |