Re: Attribute::Handlers - cant use under mod_perl?
On Fri, Mar 29, 2002 at 11:34:26AM -0600, Michael Schout wrote: Has anyone else tried to use Attribute::Handlers under mod_perl? Any success stories? Take a look at Apache::Handlers :) I've been able to get both forms working (attribute and block). Attribute::Handlers does require perl 5.6.0 at least, iirc. -- James Smith [EMAIL PROTECTED], 979-862-3725 Texas AM CIS Operating Systems Group, Unix
Re: Berkeley DB 4.0.14 not releasing lockers under mod_perl
On Thu, Mar 21, 2002 at 02:01:49PM -0500, Michael Alan Dorman wrote: Perrin Harkins [EMAIL PROTECTED] writes: This sort of begs the question: why not use DB 3.x? Is there some new feature you need in DB 4? Anecdotaly, I believe the OpenLDAP and Cyrus projects have both found DB4 to be more reliable under load than DB3. To add to the anecdotes... We have been using the predecessor of Sendmail, Inc's SAMS product (ultimately derived from Cyrus, I believe) and have seen some problems with locking and sleepycat db's resulting in hanging IMAP servers or database corruption. I would not blame mod_perl first -- it's not responsible for the database. I'm not certain that the problem is in the IMAP server either -- but the environment consists of the IMAP server, POP server, tcl scripts, and web interface all trying to access a sleepycat database. Sendmail, Inc. has mentioned (I believe privately) that they feel the problems have been resolved in the newer versions of the sleepycat db. I'm not trying to put words in their mouth, so I could be mistaken, but this is afaik. Before blaming mod_perl, I would run the server with the -X option to make sure the script is only being called once within the mod_perl environment (just being paranoid). Multiple (almost) simultaneous invocations might be causing some of the locking problems. They wouldn't show up then when being run from the command line. my $0.02 --jim
Re: Permission conflict between mod_cgi and mod_perl
On Mon, Mar 25, 2002 at 10:44:10AM -0800, Randal L. Schwartz wrote: Jim == Jim Smith [EMAIL PROTECTED] writes: Jim On Mon, Mar 18, 2002 at 02:02:38PM -0800, James Lum wrote: 1. use suid perl and set the owner as root ... but i do not know if you can run a suid perl program under modperl. (anyone? will this work?) Jim Should be able to -- mod_perl can run other scripts. mod_perl doesn't run scripts. mod_perl hooks handlers to various stages of Apache processing using an embedded Perl interpreter. Basically, mod_perl can run scripts in the same manner as any other unix program. mod_perl is just an extension to Apache. I was not in any way implying that mod_perl forked to run Perl code. I was saying that mod_perl can fork if it is asked to. --jim
Re: here is a good modperl question on perlmonk
On Tue, Mar 05, 2002 at 02:54:47PM -0800, Paul Lindner wrote: On Tue, Mar 05, 2002 at 04:53:56PM -0600, Dave Rolsky wrote: On Tue, 5 Mar 2002, Medi Montaseri wrote: My suggestion would be to install a Linux on your developer's PC and keep with the distributed model. Now everyone can use a common web tree and at integeration, bring all of them to a staging box, QC it and ship it to production. Giving everyone their own Apache daemon, which uses their checked out tree of code, on a central dev server is really not a problem either. One other tip... write a small script (or modify apachectl) to start apache with a port number matched to your unix UID. This keeps developers from using clashing port numbers. httpd -c Port $UID -c Listen $UID etc.. (returning from spring break...) Just keep in mind that this won't work (afaik) on systems that need more than 16 bits for the uids. (Here at TAMU we are going that direction -- unified UIDs across all our unix boxes -- 80,000 people 16 bits -- developers are part of those 80,000.) What I did was very similar except I created a `testserver' script that checks out the CVS tree, sets up the configs, and starts the server. After starting it, it lets the person know which port they can use -- I hard code that into the script for now (small group of developers -- 10). The UID thing can also run into problems if the UID is below 1024 (several of ours are). But for small groups of users with all uids between 1024 and 65535, using the uid as the port can work most of the time (6000 won't work if X Windows is being used, for example). --jim
Re: [ANNOUNCE] PHP::Session
On Mon, Mar 18, 2002 at 07:27:40PM +0900, Tatsuhiko Miyagawa wrote: Now PHP::Session 0.05 with save/destory implementation is going on its way to CPAN. 0.05 Mon Mar 18 16:36:27 JST 2002 * added Boolean type (ext/var.h in PHP source code) 0.04 Fri Mar 15 16:14:32 JST 2002 * added destroy() 0.03 Fri Mar 15 16:01:35 JST 2002 * added session ID validation * implemented save() Will there be a way to specify each of the actions as PHP allows? For example, in a project I have, we use PHP4 sessions, but they are stored in a MySQL table so they can be shared across web machines without worrying about NFS problems. Basically, it would be nice to have PHP::Sessions provide the serialization mechanism for use by Apache::Session without it worrying about how to store the information. --jim
Re: [ANNOUNCE] PHP::Session
On Tue, Mar 19, 2002 at 06:03:56AM +0900, Tatsuhiko Miyagawa wrote: At Mon, 18 Mar 2002 14:06:56 -0600, Jim Smith wrote: Will there be a way to specify each of the actions as PHP allows? For example, in a project I have, we use PHP4 sessions, but they are stored in a MySQL table so they can be shared across web machines without worrying about NFS problems. You're very happy :) Then you don't have to play with this module of nightmare. I tried to write such a module last year. PHP sessions are a bit of a nightmare to parse efficiently, afaik. I'm glad someone's gone to the trouble to try and make a usable and distributable module. --jim
Re: Apache::Symbol-calling none-can('undef_functions')
On Thu, Feb 07, 2002 at 08:09:57AM -0500, Geoffrey Young wrote: Sreeji K Das wrote: Hi The following perl -MDevel::Symdump -e '$t = Devel::Symdump-new(main); print $t-packages, \n;' in perl 5.6.1 returns none as one the packages ! Apache::Symbol (mod_perl-1.26) seems to call a 'can('undef_function..' on this values as a result, a fatal error is thrown ! I have done a 'next if /\none\/' in Apache::Symbol to work around this. There is no problem in perl-5.005. No one else faced similar problem ? BTW, all this is in Solaris 2.6 I guess you're using Apache::StatINC? from the recesses of my memory, I think that only Apache::StatINC uses Apache::Symbol, and in perl 5.6.0 the need for Apache::Symbol was removed, since subroutine redefined warnings were made not-mandatory. at any rate, if you're using Apache::StatINC you can probably just move to Apache::Reload to avoid the problem. other than that, I'm not sure what to tell you - I can't recall anyone else reporting this problem... I did find yesterday that Apache::Status + Devel::Symdump can cause Apache to segfault on Solaris 2.7 with Perl 5.6.1, mod_perl 1.26, apache 1.3.22. Not sure why yet. I'm just avoiding the combination for now :/ (Basically, let this serve as a warning so people aren't surprised if they see it.) I also get the following at times: Bizarre copy of ARRAY in aassign at /usr/local/lib/perl5/site_perl/5.6.1/Devel/Symdump.pm line 53. Probably should post to p5p or something if I can gather more information. --jim
Re: Storing data for conf directives
On Thu, Jan 24, 2002 at 04:03:30AM -0600, James G Smith wrote: [snip] The most likely suspect that I can think of is the configuration being done twice or incompletely the second time, but I don't know where else to look. Anyone have any suggestions? I'll post the code if anyone thinks they would like to take a look at it. [snip] Looks like it was a matter of closure with a lexical variable. Second time configs were read, new lexical. I think. Changing it from `my %var' to `our %var' fixed it. For want of a nail --jim
Re: Installing mod_perl 1.26 on solaris 2.7
On Thu, Nov 29, 2001 at 02:30:26PM -0500, Chris Winters wrote: * James G Smith ([EMAIL PROTECTED]) [011129 14:11]: I have the 1.26 tarball untar'd and run the following command: % find . -name Request.pm -print It prints nothing. Is there supposed to be an Apache/Request.pm file somewhere? Apache complains that it can't find it on startup (I'm trying to use HTML::Mason). Apache::Request is a separate package -- IIRC you can install it from CPAN no problem. I should have known that. Missed it somewhere or forgot about it :/ Thanks. --jim
Re: Cookie authentication
On Fri, Nov 16, 2001 at 02:09:25AM +0100, Tom Bille wrote: The aim of the cookie example in the eagle book is a bit more than just authentication. Most of the answers here to use a session ID here are quite right for most purposes, but the code in the eagle book offers to store information on the client side with the security of a signature. Its NOT just authentication. This has some advantages for applications which are on more than one server, which have to use an expensive central DB lookup and/or are not connected at all, since the only thing to share is the secret. [snip] And for the academically inclined, Authen::Ticket (which I need to go back and update) is based on the Eagle book's example but different :/ It uses a PKI-like solution for ensuring authenticity of the cookies (at least someone can't just make up a cookie out of thin air). If you're using FreeBSD, I believe there's even a port for it (much to my surprise). --jim
Re: Mod_perl component based architecture
On Tue, Oct 16, 2001 at 07:41:46PM +0530, Gargi Bodke wrote: hi i have been asked to suggest an architecture to seperate the business logic from the html. how is this done in modperl? i guess by using functions for the business logic. is there any other way? There are a large number of solutions to this. A few are: Apache::ASP HTML::Embperl HTML::Mason Template::Toolkit and Apache::Template For a list of modules involving templates: http://search.cpan.org/search?mode=modulequery=template 139 modules found in 52 distributions matching 'template' also does modperl support object oriented programming? mod_perl is but Perl embedded in Apache. mod_perl supports the full expressiveness of Perl.
Re: [Knowledge Base] First coherent release
On Thu, Oct 11, 2001 at 02:53:09AM -0400, Drew Taylor wrote: I've run into a WEIRD problem that I think is ActivePerl related. I've installed the PerlKB modules and added some debugging code to PerlKB::Store.pm. The short story is that I have to shift TWICE to get rid of the PerlKB::Store! This is with the latest ActivePerl which I just installed tonight. And to top it off, once the config href is populated I get an illegal operation error and no result. :-( My system is Win98 SE. Any ideas? This is just weird... *doh* yes. I should have caught it. The following change has been made to cvs ( == old, == new). Change the URL from -0.02.tar.gz to -0.03.tar.gz. % cvs diff Store.pm Index: Store.pm === RCS file: /cvsroot/perlkb/perlkb/lib/PerlKB/Store.pm,v retrieving revision 1.4 diff -r1.4 Store.pm 18c18 croak No configuration unless $self - {config} - {configuration} - isa(PerlKB::Configuration); --- croak No configuration unless $self - {config} - {configuration} $self - {config} - {configuration} - isa(PerlKB::Configuration); 33c33 sub TIEHASH { return $_[0] - new(@_); } --- sub TIEHASH { return shift - new(@_); }
Re: [Knowledge Base] First coherent release
On Thu, Oct 11, 2001 at 11:25:43AM -0400, Drew Taylor wrote: I feel a little stupid now that I actually read up on tying hashes. Had I read Ch 14 of the Camel #3, I might have phrased my question in a better way so as to not illuminate my inexperience with tying variables. :-) n/p :) I assume that the reason I get the Can't locate the render_format method is because you're not actually storing any objects yet? Not sure. It should be able to see it. Can you give me the line number or any other context for it? Is it version 0.03 (the changes I mentioned in the previous e-mail)? Do you have Config::Pod located somewhere? It's needed for the PerlKB::Configuration::Pod module to work (and no, I don't have that documented that I know of, yet - sorry). Btw, thanks for trying it out -- especially since I don't have access to Microsoft sysems :) One final question, by using our you're restricting these modules to perl 5.6.x. Is there any particular reason for this? From the looks of it, the usage of our could easily be changed. Do you have plans to take advantage of other 5.6 specific features? Either way it would be nice if you included a require 5.6.0; in PerlKB.pm so that it would be immediately obvious to the new user. I will include a `require 5.006;' I do make use of `use base', the three argument form of `open' and auto-vivification of file handles in addition to `our'. Can't think of any others right now. --jim
Re: [Knowledge Base] First coherent release
On Thu, Oct 11, 2001 at 01:05:17PM -0400, Drew Taylor wrote: At 11:45 AM 10/11/01 -0500, Jim Smith wrote: On Thu, Oct 11, 2001 at 11:25:43AM -0400, Drew Taylor wrote: I assume that the reason I get the Can't locate the render_format method is because you're not actually storing any objects yet? Not sure. It should be able to see it. Can you give me the line number or any other context for it? Is it version 0.03 (the changes I mentioned in the previous e-mail)? Yes, I did add the changes you mentioned in the previous email althought I did not DL the new tarball. Let me try that... Interesting... I DL the newest taball. Now I get a bunch of code scrolling by (stupid DOS prompt...) which I guess is the sample.doc. But I still get the error: Can't locate object method render_format via package PerlKB::Document::pod ( perhaps you forgot to load PerlKB::Document::pod?) at test.pl line 40. ok - I think I know what the problem is. The PerlKB::Document object accepts a `type' argument on creation and tries to load the corresponding module. If it is successful, then it bless's the current document object (being created) into that class/module. I think DOS/Windows is presenting a case-insensitive filesystem and thus PerlKB::Document::pod loads, but is really PerlKB::Document::Pod. The PerlKB::Document code tries qw(pod POD Pod) in that order and stops with the first successful load. This is regardless of the capitalization of `type'. This was made this way to allow differences in actual and expected capitalization (e.g., qw(html HTML Html)). This side effect on case-insensitive filesystems should be viewed as a bug. I'll try and figure out a fix that can still be flexable enough to not require prior knowledge of modules (within PerlKB::Document) and allow for capitalization varients. If I can't think of a good way around this, I'll ditch it and require proper capitalization of the `type' parameter. --jim
Re: predefined arrays @- and @+ with mod_perl?
On Wed, Oct 10, 2001 at 08:17:19PM +0200, Christoph Bergmann wrote: Hi... I wonder if there exists the predefined arrays @- and @+ in mod_perl. The following lines: print $_ foreach (@-); print br; print $_ foreach (@+); print out: 10 10 11 11 11 11 This works _only_ when called via browser under mod_perl. Started from the shell it prints out nothing (except br) - as expected. I use apache 1.3.20, perl 5.6.1 and mod_perl 1.26. I've never read about such predefined Arrays - what do they contain and why are they global? Do see the perl documentation for details. They are related to regexes and there could be a regex hidden somewhere in mod_perl before your code is executed. That would explain the different behaviors. --jim
Re: predefined arrays @- and @+ with mod_perl?
On Wed, Oct 10, 2001 at 01:05:18PM -0700, Medi Montaseri wrote: The identifier production in Perl is [a-zA-Z_]\w+ So '-' and '+' are not valid symbols... pp. 667-668, 3rd. Ed. Camel book --jim
Re: [ANNOUNCE] Config::LDAP
On Thu, Sep 27, 2001 at 03:07:35AM -0500, James G Smith wrote: The uploaded file Config-LDAP-0.01.tar.gz has entered CPAN as file: $CPAN/authors/id/J/JS/JSMITH/Config-LDAP-0.01.tar.gz size: 6725 bytes md5: aa8ba7d25e8e059fe9b71ddbdb668550 Looks like I jumped the gun on this one :/ If anyone hasn't seen it already (I hadn't), take a look at Net::LDAP::Schema :) --jim
Re: Knowledge Base for 2.0
On Sun, Sep 16, 2001 at 02:37:50PM -0500, Jim wrote: Last month, there was some mention of putting together a knowledge base for the mod_perl 2.0 documentation. I'm getting to the point at work that I can start throwing some time to it. Here are some thoughts I'm having regarding the design (programming target). If this needs to go on the docs-dev list, I'll take it there. --jim
Re: Apache::DBI
On Wed, Aug 22, 2001 at 12:34:11PM -0700, Rasoul Hajikhani wrote: I am a bit confused! Can Apache::DBI handle db calls through proxies? -r It should be able to handle anything DBI handles. Just `use' it before `use'ing any other DBI modules and you shouldn't have to change any of your code, afaik. --jim
Re: Children dying
On Tue, Aug 14, 2001 at 10:48:48AM -0400, Aleksandr Vladimirskiy wrote: Hi all, I am running a perl 5.6.0, mod_perl 1.26, apache 1.3.19 on Solaris 2.6. I get the following error in my logs: [Tue Aug 14 10:45:10 2001] [notice] child pid 2630 exit signal Segmentation Fault (11) It looks like the child serves a request and immidiately dies. Does anyone have any ideas on how to figure out why this keeps happenning? What are you trying to do on the page that makes it segfault? If you are using XML::Parser in some way (with AxKit, for example) you need to make sure it and Apache are using the same expat library. Otherwise, it depends on what you are doing. --jim
Re: knowledge base
On Sun, Aug 12, 2001 at 02:44:27PM +0800, Stas Bekman wrote: On Sat, 11 Aug 2001, Jim Smith wrote: I am thinking about splitting this into two projects: backend repository modules and frontend web interface. My strength is on the backend stuff. This allows for multiple frontends to be designed without affecting the backend. For example, if someone's favorite environment was Mason, then that could be the frontend. Otherwise, someone else might want a command line interface. This also allows for other things to be put between the two, such as an XML-RPC layer, if that was appropriate. it'd be nice if you could put together some really simple frontend, so others can build on top of it some more advanced once. You need some frontend anyway in order to test it. I'll probably start with some simple CLI scripts for testing the backend stuff. Basicly, whatever I am using for development. cool. When did you say we get to play with this system? :) I'll probably aim for November/December for the backend and May for a frontend (for TAMU). I have a couple other projects going at the same time at work and I'm basically a one-man shop for this kind of stuff. I should be able to put in a fair amount of time after this month. Alpha/beta code will be available before the dates I mentioned. --jim
Re: knowledge base - was Re: RFC: mod_perl 2.0 documentation project
On Thu, Aug 09, 2001 at 07:31:11PM +0800, Stas Bekman wrote: This all sounds cool. I have a few concerns with this proposal: - source documents living under modperl cvs are to be written in POD. The project that you suggest should be able to accept this and other formats as a source. Afterwards it can convert it to many other formats. Matt has already done some work on porting PODs into XML. I don't see this as a problem. I was just picking a format out of the air as a starting point. TMTOWTDI and PCDAA (Perl Can Do Almost Anything). - where the actual converted knowledge base will be hosted? I mean who will host the production version? It's possible that we can get a machine at apache.org, but this is one of the things to worry about. If things need to be dynamically generated, we cannot do this from the same machine the modperl-site is hosted on (daedalus). I can't answer that at the moment. - we need someone to commit to lead the project, or things would never take off just like it has happened before. Well, I can lead the code development, but I can't commit to anything more than that at the moment. I won't be able to do even that until after the semester starts (classes start 27 Aug, we have several things to get done before then). Now to see if I can get my boss to support me spending time on such a project :) I hope he does. Really! He was very receptive yesterday evening. Wants to see a proposal (what TAMU would be committing to) before giving the final go ahead. We will probably need to involve our helpdesk people in some of the user-interface design. We will need a design document before coding so we know what we're aiming at. I can lead on that. --James
Re: my OR our that is the question ?!
On Thu, Aug 09, 2001 at 01:36:28PM -0700, Andrew Ho wrote: Hello, rI have the following situation... it is not big issue but ri'm interested why this happen... r rmy $ID = 555; rsub blah { r... r$ID = selectrow query; r... r} This is, in fact, a big issue. You should see a message in your error log shared variable $ID will not stay shared. You should not use a my variable defined at the top level of your Apache::Registry script in a subroutine. See this entry in the mod_perl guide: http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S The workaround is to make $ID a package global (use vars qw($ID)). With Perl 5.6, the following are roughly equivalent: use vars qw($ID); our $ID; However, you will need to put the `our' declaration within the block (which may happen implicitely with Apache::Registry). So (pre-5.6): use vars qw($ID); sub foo { $ID = shift; } But (= 5.6): sub foo { our $ID = shift; } --James
Re: knowledge base - was Re: RFC: mod_perl 2.0 documentation project
On Wed, Aug 08, 2001 at 10:45:43AM +0800, Stas Bekman wrote: On Tue, 7 Aug 2001, Jim Smith wrote: On Tue, Aug 07, 2001 at 10:16:26PM +0800, Stas Bekman wrote: Just some pseudo-random ideation boiling down to let's use mod_perl to buils a knowledge base both to demonstrate it's power and to serve the community. I like the idea!!! If we can come up with a proposal for a generic knowledge base product that would be useful in an IT environment, I can probably devote some of my work to it -- this is something I've been wanting to put together at work for customers and our help desk people but haven't had time yet to get it all together. I'll have more time in September after the students return. go ahead and be the first to propose Jim :) Ok... here are some of my initial thoughts. We need to be able to enter arbitrary documents, so I suggest DocBook as the standard format. This handles articles, books, reference pages, etc., in a well-defined manner. It also allows us to transform to other formats without much of a problem. We can even consider AxKit for at least part of the web interface. We would want to have different sections for documents that are not related. For example, we (here at TAMU) could use a section on Unix, another on Mac, and yet another on Windows systems. Or we could divide it up by services. The different sections would not expect overlap in keyword - content mapping, so we could have an AI::Catagorize object for each section that could provide a default set of keywords. As we entered documents, those objects could learn which keywords were appropriate. We would want to have documents in multiple catagories. This might require the person entering the document enter multiple sets of keywords, one per section. We would need to index on keyword so people could quickly find the documents. Perhaps even a catelogue-style interface for browsing that would be based on keyword categories. This would require some work. (Broad categories are indicated by the presence of certain keywords, or by a weighted average so a document having all but a couple of the appropriate keywords won't be dropped from that category.) Documents shouldn't have to be entered via the web interface, though they could be. We could provide a set of web-page templates for each of the DocBook formats (well, the small ones anyway - don't want to write a book via a web interface). Might want to even integrate with WebDAV and a repository. We probably want to set up a SourceForge project if this is a go. Any ideas on names? Now to see if I can get my boss to support me spending time on such a project :) --jim