Apache::RequestNotes and sharing information
I am using RequestNotes with PerlAccessHandler and a PerlHandler. When the browser connects for the first time, The PerlAccessHandler sets a session_based cookie, using TIEHASH $r->pnotes("COOKIES")->{'SESSION_ID'} = $session{_session_id}; And the PerlHandler retrieves the session_id using $session_id = $r->pnotes("COOKIES")->{'SESSION_ID'} To my surprise, in the PerlHandler $r->pnotes("COOKIES")->{'SESSION_ID'} has not been set. Is there any way to share data between different handlers? Chui Tey Software Engineer Advanced Data Integration PO Box 660 Spring Hill QLD 4004 AUSTRALIA Ph:07 3250 5300 Fax: 07 3250 5399 [mailto: [EMAIL PROTECTED]]
Re: search engine module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At 11:36 AM +0800 10/19/01, Stas Bekman wrote: >Right, my point is that WWW::Search namespace is taken :) Ah. Sorry, my miscommunication. When I said that I "ended up making a WWW::Search" I should have put an "an instance of" in there instead of "a". Basically WWW::Search provided a good interface, but everything was remote, so I wrote this. If you stick to the conventions provided here, it should be easy to make other variations using other local search engines. I was just surprised that nobody seemed to have done it before. Grep(3)User Contributed Perl DocumentationGrep(3) NAME WWW::Search::Grep - class for searching a local web site using grep SYNOPSIS require WWW::Search; $search = new WWW::Search('Grep'); DESCRIPTION This is a grep specialization of WWW::Search. THis class exports no public interface; all interaction should be done through WWW::Search objects. OPTIONS The default query syntax is: word word OR word "quoted phrase" Blank separated words are implicitly separated by AND. OR refers only to the word or phrases directly to either side. The model is the same as that used by Google (http://www.google.com/). search_url Specifies the directory to search. All .html and .htm files in the specified directory and any subdirectories will be searched. This is an absolute pathname and is required. E.g. /home/httpd/html/foo/searchdir/ base_path This is this is the part of that pathname that should be stripped off before prefixing the base_url. This is required. E.g. /home/httpd/html/ base_url This is prepended to the pathname after stripping the base_path. This is optional, the default is none. E.g. http://www.somewhere.com/ or / search_debug,search_parse_debug See WWW::Search grep Pathname to grep, default is /bin/egrep. AUTHOR Kee Hinckley, [EMAIL PROTECTED] - -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ [EMAIL PROTECTED] (or ...!alice!nazgul for time travelers :-) I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's. -BEGIN PGP SIGNATURE- Version: PGP Personal Security 7.0.3 iQA/AwUBO8+mtSZsPfdw+r2CEQI1+wCeI3s9JcPuXvaexrriahCWnjtTS/kAnjl3 v7uvLYWz4xxxc2weT/qU0f2n =MXIA -END PGP SIGNATURE-
Re: search engine module?
Kee Hinckley wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > At 12:56 AM +0800 10/19/01, Stas Bekman wrote: > >>Kee Hinckley wrote: >> >> >>>-BEGIN PGP SIGNED MESSAGE- >>>Hash: SHA1 >>> >>>People have been talking about backend search engines, but when I >>>saw the subject I was thinking more about front end classes. In >>>particular, last time I looked there wasn't a standard class for >>>integrating local search engines into your code. I ended up making >>>a WWW::Search, but you kind of have to tweak the meaning of some >>>values. If anyone is interested I ought to release it. It's a >>>trivial example for very small web sites (it provides google-like >>>search syntax, and backends it with grep). >>> >> >>You should have checked CPAN first: There is a load of WWW::Search:: >>modules there. >> > > Yes. But my point is that they are all *offsite* searches as far as > I can tell. What I wanted was a standard interface to a local search > engine. Right, my point is that WWW::Search namespace is taken :) -- _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Excellent article on Apache/mod_perl at eToys
Hello, I checked the list archives and it didn't look like this had been posted yet. For those of you who haven't seen it yet... a great read on perl.com about the Apache/mod_perl setup at eToys, co-authored by our own mod_perl regular contributer Perrin Harkins. http://www.perl.com/pub/a/2001/10/17/etoys.html Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
Problem using mod_perl-1.26 with perl 5.6.1 and XML::Parser
Hi gang, I am fairly new to mod_perl, but I would like to share my recent experience and hope someone might offer some insight into my troubles. Last week I whipped together a simple perl module that used XML::Simple ( a wrapper for XML::Parser) to parse some POST'd content. Once parsed the resulting data was munched a bit and then POST'd to another web server. Like everything perl it was quick to implement and ran quick as well. My problems came along when I moved my module to another server. All of sudden Apache would segfault in the Expat library code when my module parsed the content. I noticed that I had different versions of XML::Parser on the different machines (2.29 vs. 2.30). XML::Parser-2.29 was the one on the working instance so I downgraded the box that was segfaulting. When I down graded the segfaults went away but a nasty little problem showed up latter in the module where the data being sent in my module's post was getting corrupted. I narrowed down the problem to the call to running the XML parser being related to the data corruption. At this point I found this mail list and searched the archive. There were lots of references to the "Expat" problem where Apache itself uses a copy of Expat and a XML::Parser would use a different version of the Expat. There was discussion about required configuration parameters to mod perl, but more importantly there was a post mentioning that Apache 1.3.22 made the whole problem go away. Feeling inspired by my new found knowledge of the problem, I decided a clean install of the new apache was in order. To be safe, I reinstalled RedHat 7.1 without RedHat's apache. I uninstalled perl 5.6.0 that came with RH7.1 and installed perl 5.6.1. I followed the "simple" mod_perl install instructions that builds apache with perl statically linked. My resulting install didn't segfault, but my nasty bug was still there. At this point I went back and fully duplicated the working implementation: Apache 1.3.19, mod_perl 1.26 perl-5.005_3 and XML::Parser-2.29. The originally working system was on RH 6.2, and this configuration worked on my new machine using RH 7.1. This configuration was built with the following commands: tar zxf apache_1.3.19.tar.gz cd apache_1.3.19 ./configure --prefix=/lsurf/apache --enable-shared=max --enable-module=all make make install cd .. tar zxf mod_perl-1.26.tar.gz cd mod_perl-1.26 perl Makefile.PL USE_APXS=1 APACHE_PREFIX=/lsurf/apache EVERYTHING=1 make make install Now that I had something reproducible, I continued. I rebuilt using Apache 1.3.22 just like above, and everything continued to work. I upgraded to XML::Parser-2.30, and things continued to work. It was only when I went from perl 5.005_3 to 5.6.1 did my module break. As I said above I tried a statically linked apache. I also tried building Apache 1.3.22 as above with perl 5.6.1 and my code failed with both XML::Parser-2.29 and XML::Parser-2.30. Whatever way I tried using perl 5.6.1 I had my nasty problem. When configuring Apache 1.3.22 I noticed it said it was using the system's libexpat which was installed with RH. XML::Parser-2.29 uses its own copy of expat, but XML::Parser-2.30 uses the system libexpat. As I said with perl 5.005_3 I was able to use either version of XML::Parser. In the end I have a working implementation using perl-5.005_3, but I'd sure feel better using the "latest stable perl", and it should work as far as I can tell. If anyone has some suggestions I'd be willing to give them a try. Thanks for your patience if you read this long winded post. Matthew
Re: PerlModule not updating %INC
At 1.13 +0800 10/17/2001, Stas Bekman wrote: >David Pisoni wrote: > >>>At 18.23 -0400 10/11/2001, Perrin Harkins wrote: >>> >At 18.07 -0400 10/11/2001, Perrin Harkins wrote: > >>>We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26. >>> >>Are you sure? There was a problem with %INC and PerlModule, but I >> thought >>it was fixed in 1.26. >> >>- Perrin >> >Indeed, like I said, I tested it by dumping %INC myself -- the modules are > indeed missing when loaded with PerlModule. No, I meant are you sure you're running 1.26? Please doublecheck it, since this sounds so much like the bug from the previous release. - Perrin >>>Indeed, here's the signature from Apache::Status : >>> >>> Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) >mod_perl/1.26 >>> >>>Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.) >>> >>>Thanks, >>>David >>> >> >>So... any ideas on this one? > > >have you tried 5.6.1? 5.6.0 is very buggy. > Just tried it. Fresh build of 5.6.1, and mod_perl 1.26 against it. The problem persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded with PerlModule directives. What should I try next. :-) David
Re: search engine module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At 12:56 AM +0800 10/19/01, Stas Bekman wrote: >Kee Hinckley wrote: > >>-BEGIN PGP SIGNED MESSAGE- >>Hash: SHA1 >> >>People have been talking about backend search engines, but when I >>saw the subject I was thinking more about front end classes. In >>particular, last time I looked there wasn't a standard class for >>integrating local search engines into your code. I ended up making >>a WWW::Search, but you kind of have to tweak the meaning of some >>values. If anyone is interested I ought to release it. It's a >>trivial example for very small web sites (it provides google-like >>search syntax, and backends it with grep). > > >You should have checked CPAN first: There is a load of WWW::Search:: >modules there. Yes. But my point is that they are all *offsite* searches as far as I can tell. What I wanted was a standard interface to a local search engine. - -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ [EMAIL PROTECTED] (or ...!alice!nazgul for time travelers :-) I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's. -BEGIN PGP SIGNATURE- Version: PGP Personal Security 7.0.3 iQA/AwUBO88W3yZsPfdw+r2CEQLQ8wCgrokvPCmktlUCSLPulsZsVwrBMdwAoMMQ V1vsViU2nutZioKmgwVnqV22 =03cp -END PGP SIGNATURE-
Re: search engine module?
Kee Hinckley wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > People have been talking about backend search engines, but when I saw > the subject I was thinking more about front end classes. In > particular, last time I looked there wasn't a standard class for > integrating local search engines into your code. I ended up making a > WWW::Search, but you kind of have to tweak the meaning of some > values. If anyone is interested I ought to release it. It's a > trivial example for very small web sites (it provides google-like > search syntax, and backends it with grep). You should have checked CPAN first: There is a load of WWW::Search:: modules there. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: search engine module?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 People have been talking about backend search engines, but when I saw the subject I was thinking more about front end classes. In particular, last time I looked there wasn't a standard class for integrating local search engines into your code. I ended up making a WWW::Search, but you kind of have to tweak the meaning of some values. If anyone is interested I ought to release it. It's a trivial example for very small web sites (it provides google-like search syntax, and backends it with grep). - -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ [EMAIL PROTECTED] (or ...!alice!nazgul for time travelers :-) I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's. -BEGIN PGP SIGNATURE- Version: PGP Personal Security 7.0.3 iQA/AwUBO88CGCZsPfdw+r2CEQLj9ACfSqjkFgwvFR0iXWRRS9B2oM6EcZ8AoNSd 6jkha/LM8cS1ia4mYti8tiGW =yXL9 -END PGP SIGNATURE-