Re: installing Apache::Test via CPAN impossible as root
On Tue, 26 Aug 2003 09:07:21 -0700, Stas Bekman wrote: [snip] As you posted in the followup, this is a problem with all Apache:: modules. The problem originates within Apache, not us. FWIW, the cvs version of Apache::Test warns you early whether this is going to work or not, rather than just failing during 'make test'. Ideas how to solve this are *very* welcome. [snip] Stas, One thing we're working on implementing in Apache::PAR to solve this kind of problem is to use File::Spec's tmpdir to get the platform specific temp directory. This function appears to be available in File::Spec at least as of Perl 5.6.0 as part of the distribution. This could be used (maybe overridable via a env variable, etc) to determine a temporary directory to copy the t/ directory to in cases where permissions would deny reading from the working directory or a parent directory. Of course, it would still have to fail in cases where a temp directory isn't available (either File::Spec doesn't support the platform or a new enough version of File::Spec isn't available on an old version of Perl) and the env variable isn't set, but should handle almost all common cases. Once the content is copied, Apache::Test would then use that directory to serve test files, scripts, etc out of. This temporary directory could then also be cleaned up when the Apache server is shutdown. Of course, I haven't looked at the code for Apache::Test enough to know whether this would be easily implemented, but just thought I would throw out the idea. Thanks, Nathan Byrd -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Apache config problem .. please help
I made a simple mod_perl change to the config and when restarting Apache I got this error: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:2250 no listening sockets available, shutting down /usr/local/apache/bin/apachectl: line 87: 16512 Segmentation fault $HTTPD $ARGV I then backed out the change and retried, got the same error. Any clues?
Re: Apache config problem .. please help
Ged Haywood wrote: Hi there, On Thu, 3 Jul 2003, Dennis Stout wrote: I made a simple mod_perl change to the config and when restarting Apache I got this error: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:2250 no listening sockets available, shutting down /usr/local/apache/bin/apachectl: line 87: 16512 Segmentation fault $HTTPD $ARGV I then backed out the change and retried, got the same error. killall httpd then try it again :) httpd was not running and I have been running Apache 2x with mod_perl 1.99x for over two months now. It started with a problem I traced to env. var $ENV{HTTP_ACCEPT}. I figured out that I needed PerlOptions +SetupENV. So I added this, stopped and tried to start Apache. That's when I got this shock. In other words there's an Apache still running when you're trying to start a second one which wants to listen on the same socket that the first Apache is already listening on. That isn't permitted. But you shouldn't be getting segmentation faults in that case so something else is probably wrong too. Did you build from source? Did you follow the instructions in the Guide? Linux? 1.3.27/1.27? DSO? Maybe you can post the information requested in the docs? 73, Ged. The 'top' output is : 3:38am up 8 days, 22:58, 1 user, load average: 0.00, 0.00, 0.00 22 processes: 21 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 0.0% user, 0.3% system, 0.0% nice, 99.6% idle Mem: 970768K av, 212504K used, 758264K free,7852K shrd, 98668K buff Swap: 530104K av,3216K used, 526888K free 88104K cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 16688 kairanga 10 0 996 996 800 R 0.3 0.1 0:00 top 1 root 0 076 6448 S 0.0 0.0 0:10 init 2 root 0 0 00 0 SW0.0 0.0 0:00 kflushd 3 root 8 0 00 0 SW0.0 0.0 34:03 kupdate 4 root 0 0 00 0 SW0.0 0.0 9:07 kswapd 5 root 0 0 00 0 SW0.0 0.0 0:00 keventd 57 root 0 0 232 232 0 S 0.0 0.0 0:00 rc.M 77 root 2 0 272 272 160 S 0.0 0.0 2:20 syslogd 80 root 0 0 640 640 128 S 0.0 0.0 0:00 klogd 82 root 0 0 368 324 220 S 0.0 0.0 0:04 sshd 86 root 6 0 336 336 240 S 0.0 0.0 0:00 crond 93 root 2 0 692 488 292 S 0.0 0.0 0:03 sendmail 100 root 0 0 2352 1708 936 S 0.0 0.1 0:07 poprelayd 102 root 0 0 2668 1248 292 S 0.0 0.1 0:00 miniserv.pl 104 root 0 0 220 168 148 S 0.0 0.0 0:00 inetd 105 root 0 0 184 184 0 S 0.0 0.0 0:00 safe_mysqld 127 mysql 0 0 2384 2384 1364 S 0.0 0.2 0:00 mysqld 129 mysql 0 0 2384 2384 1364 S 0.0 0.2 0:00 mysqld 130 mysql 0 0 2384 2384 1364 S 0.0 0.2 0:00 mysqld 16316 root 0 0 1284 1268 1124 S 0.0 0.1 0:00 sshd 16318 kairanga 0 0 1364 1352 1208 S 0.0 0.1 0:00 sshd 16319 kairanga 3 0 1240 1240 964 S 0.0 0.1 0:00 bash There has been no change to Apache httpd.conf other than the addition of PerlOptions +SetupEnv which I commented out anyway. How can I get a list of ports being used so I can kill the processes? As far as I can tell httpd is not running. The IP is 208.179.25.28 I dont see any apparent signs of hacking either.
Re: Apache config problem .. please help
Gedanken wrote: I know this is not of much help, but I have had situations where a badly terminating process would prevent subsequent processes from using that port. on windows, i never found a solution other than to reboot. on solaris 7, i never found a solution other than to wait 8 minutes. I did some reading and found socket inet options to change how such programs bound thge port so as to allow others to use it in more friendly a fashion but such a change wasnt possible with the process in question. The problem is resolved. Unbenownst to me - I need to investigate this - the Listen IP:port line in Apache had the wrong IP address. I really dont know how this happened. The number is so different yet syntactically correct to be a keystroke error. Thanks everyone for pitching in. For one I can now use ' netstat' utility to check ports being used,. Thanks Ged! I keep talking to my corporate IT people about open source , and they constantly ask me 'who will support it? what do they get out of it?' . I can not even begin to explain to them the 'connectedness' across the 'net. Should people always measure everything in terms of money? Anyway, all this started from an attempt to access env. vars from legacy scripts running under registry. What is the easiest way to get env. var access without the accompanying performance penalty that mod_perl documentation talks about? Regards
Re: [ANNOUNCE] Practical mod_perl is out!
Geoffrey Young wrote: well, the (long) wait is now over - Practical mod_perl is here. weighing in at a whopping 924 pages, Practical mod_perl really needs no introduction for those that are already familiar with the mod_perl Guide. however, from the ORA catalog description: From writing and debugging scripts to keeping your server running without failures, the techniques in this book will help you squeeze every ounce of power out of your server. True to its title, this is the practical guide to mod_perl. O'Reilly has a sample chapter online http://www.oreilly.com/catalog/pmodperl/chapter/ch06.pdf the book's official website is http://www.modperlbook.org/ where you will find links to ways to purchse the book. kudos Stas and Eric! --Geoff I have a mod_perl book but I am looking forward to one that includes mod_perl. I believe, corporate IT should take a serious look at using mod_perl. It is time for the heads to come out of the sand. I am interested in creating a presentation for my employer. I need information that reeks (yes I want it to stink) with credibility. Any pointers in this regard is welcome.
Re: Large Data Set In Mod_Perl
Perrin Harkins wrote: simran wrote: I need to be able to say: * Lookup the _distance_ for the planet _mercury_ on the date _1900-01-01_ On the face of it, a relational database is best for that kind of query. However, if you won't get any fancier than that, you can get by with MLDBM or something similar. Currently i do this using a postgres database, however, my question is, is there a quicker way to do this in mod_perl - would a DB_File or some other structure be better? Query speed comes into question only when there is a heavy use. Postgress has an 'Explain' facility via pgsql. Just add Explain before the query and you will get the cost of the query. By creating proper indexes you can get good optimization. What if you add a table later and you need to join that with the planet table? If you keep your planet data somewhere else, then the access becomes cumbersome as well as slower. There are many ways to speed up Postgresql. I recommend the Posgresql book by Korryand Susan Douglas. I got it from Barnes and Nobles. IMHO stay with the relational database you are on and find ways to optimize. A DBM file will be faster. What you can do is build a key out of planet + date, so that you grab the right record with a single access. Either use MLDBM for storing hashes inside each record, or just a simple join/split approach. This would be a good idea if you are implementing your tool and you know what limitations you will be subjected to. MySQL would probably also be faster than PostgreSQL for this kind of simple read-only querying, but not as fast as a DBM file. SDBM_File is the fastest DBM around, if you can live with the space limitations it has. perhaps something such as copying the whole 800,000 rows to memory (as a hash?) on apache startup? Postgresql may have a way to 'stick' a table in memory like MySQL. That would be the fastest by far, but it will use a boatload of RAM. It's pretty easy to try, so test it and see if you can spare the RAM it requires. - Perrin
Re: [OT] Perfomance tests, How?
On Wed, 2003-04-02 at 06:54, Ruslan U. Zakirov wrote: Hello All! I need to test my project perfomance. Is there any OpenSource projects like WebBench and other in the Internet? Best regards. Ruslan. You might also want to try HTTPD::Bench::ApacheBench. I just finished using it for doing some performance testing for a module I'm developing and it worked great, seems to have good reporting methods and options for repetitions, concurrency, etc. Thanks, -- Nathan Byrd [EMAIL PROTECTED]
[ANNOUNCE] Apache::PAR 0.12
Hi all, I am happy to announce the release of Apache::PAR version 0.12. This module is available for download from either a CPAN mirror or sourceforge: http://www.cpan.org/modules/by-authors/id/N/NB/NBYRD/Apache-PAR-0.12.tar.gz http://sourceforge.net/projects/apache-par/. Highlights from this release: 0.12 Thu Mar 27 2003 * Some testing performed on Win32 platforms Win 98 and Win 2k (thanks to Raymond Field. Documentation changed to reflect necessary changes to get Apache::PAR up and running on Win32. * Improved mod_perl 2.x detection. No longer requires Apache::ServerUtil * Support for Apache::Static pulling from root directory of PAR file * New configuration mechanism, through PARInclude directive and use/include lines in startup.pl or PERL sections Also, highlights from 0.11 (no announcement previously sent): 0.11 Mon Mar 10 2003 * Changes to stay compatible with latest mod_perl CVS. This change is not backwards compatible, however. For mod_perl 2.x the CVS version is currently required * Some code cleanup * Added more tests (not yet complete) * Made errors from Archive::Zip silent (less noise to logs) * Added additional tests * Apache::PAR::Registry was using PARPerlRunPath instead of PARRegistryPath, identified by Raymond Field * PARPerlRunPath and PARRegistryPath failed to find contents if set to /, identified by Raymond Field * WIN32 fix for setting ##PARFILE## to reasonable value on that platform for Apache, identified by Raymond Field Summary of Apache::PAR: Apache::PAR is a framework for including Perl ARchive files in a mod_perl (1.x or 2.x) environment. It allows an author to package up a web application, including configuration, static files, Perl modules, and Registry and PerlRun scripts to include in a single file. This archive can then be moved to other locations on the same system or distributed, and loaded with a single set of configuration options in the Apache configuration. These modules are based on PAR.pm by Autrijus Tang and Archive::Zip by Ned Konz, as well as the mod_perl modules. They extend the concept of PAR files to mod_perl, similar to how WAR archives work for Java. An archive (which is really a zip file), contains one or more elements which can be served to clients making requests to an Apache web server. Scripts, modules, and static content should then be able to be served from within the .par archive without modifications. Contact: If you have questions or problems regarding this module, or suggestions for further enhancements, please let me know at one of the following locations: E-mail: [EMAIL PROTECTED] Mailing list: [EMAIL PROTECTED] (to subscribe, send an empty email to [EMAIL PROTECTED]) Sourceforge forums: http://sourceforge.net/projects/apache-par/ Thanks, -- Nathan Byrd [EMAIL PROTECTED]
Re: Cross Site Scripting
On Tue, 2003-03-11 at 02:58, Clinton Gormley wrote: On Tue, 2003-03-11 at 06:03, Stas Bekman wrote: Changes since 0.7 * prevent cross-site scripting, now HTML-escaping the request field In Stas' Apache::VMonitor announcement, he mentions changes to prevent cross site scripting. This is a concern for me at the moment, because I'm building a site which will allow people to submit copy (to be displayed to other users) and I would like them to be able to use HTML and include links to other sites (much like slashdot). Do any of you have any ideas about good techniques to prevent CSS (and I don't mean those div elements) in this scenario? I've read the articles on cert.org (http://www.cert.org/tech_tips/malicious_code_mitigation.html) and apache.org (http://httpd.apache.org/info/css-security/encoding_examples.html) There is also a great article by Paul Lindner, titled Preventing Cross-site Scripting Attacks which I found very helpful, available at: http://www.perl.com/pub/a/2002/02/20/css.html Thanks, -- Nathan Byrd [EMAIL PROTECTED]
perl 5.8.0/modperl 1.99/apache2/HPUX 11.00 config problem
OK, I've installed perl apache 2 fine. Then I try to configure mod_perl 1.99_08, using the command: # perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 it seems to work fine except for this warning: Reading Makefile.PL args from @ARGV MP_AP_PREFIX = /usr/local/apache2 * WARNING * mod_perl is unlikely to link with your libperl, suggestions: *) Rebuild Perl with Configure -Accflags=+Z ... * WARNING * Configuring Apache/2.0.43 mod_perl/1.99_08 Perl/v5.8.0 But it doesn't stop, it just keeps going acts all happy. Then when I run make i get: /usr/bin/ld: DP relative code in file /usr/local/lib/perl5/5.8.0/PA-RISC1.1/auto/DynaLoader/DynaLoader.a (DynaLoader.o) - shared library must be position independent. Use +z or +Z to recompile. *** Error exit code 1 Stop. *** Error exit code 1 Stop. # I've tried recompiling perl numerous times, but i'm basically a total newb. I'm a college student with no experience on HPUX very little unix experience to begin with, but somehow I ended up responsible for this, so any help would be greatly appreciated. thanks. Nathan Sweaney
[ANNOUNCE] Apache::PAR 0.10
Version 0.10 of Apache::PAR is now available on CPAN at the following location: http://www.cpan.org/authors/id/N/NB/NBYRD/ This version of Apache::PAR now includes preliminary support for both mod_perl 1.x and 2.x environments natively (without Apache::compat). Note, however, this does not guarantee that any modules, registry scripts, etc packaged with Apache::PAR will work under both 1.x and 2.x - wouldn't that be slick. :-) Also, with this version I have continued to use Apache::test for the module testing framework, so make test does not work out of the box under mod_perl 2.x, although it does run with some changes to the generated httpd.conf file (I am hoping to offer a patch for this to the Apache::test author soon). If anyone has any questions or problems (under 1.x or 2.x), please contact me at one of the following: Email: [EMAIL PROTECTED] PAR mailing list: [EMAIL PROTECTED] mod_perl mailing list: [EMAIL PROTECTED] Thanks, -- Nathan Byrd [EMAIL PROTECTED]
Re: [ANNOUNCE] Apache::PAR 0.10
On Sun, 2003-02-02 at 21:04, Stas Bekman wrote: Nathan Byrd wrote: Version 0.10 of Apache::PAR is now available on CPAN at the following location: http://www.cpan.org/authors/id/N/NB/NBYRD/ This version of Apache::PAR now includes preliminary support for both mod_perl 1.x and 2.x environments natively (without Apache::compat). Note, however, this does not guarantee that any modules, registry scripts, etc packaged with Apache::PAR will work under both 1.x and 2.x - wouldn't that be slick. :-) Also, with this version I have continued to use Apache::test for the module testing framework, so make test does not work out of the box under mod_perl 2.x, although it does run with some changes to the generated httpd.conf file (I am hoping to offer a patch for this to the Apache::test author soon). I doubt that would be useful, because the next release of 1.x (where Apache::test resides) won't happen any time soon, and you can't know what other changes will happen in mp2. Instead, include the whole Apache::Test framework (from mod_perl's cvs!) in the distro, and use it. Once it's released on CPAN, you can simply add it as a prerequisite and remove from the distro. It's also very important for people to start using Apache::Test everywhere, so we can sort out the problems and missing features and release it on CPAN asap. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com That makes since. I was only taking it from the Apache::test direction because it seemed like there might be more involved in separating Apache::Test than Apache::test from mod_perl, and I didn't know there was already plans to release Apache::Test as a standalone module. Thanks for the advice. -- Nathan Byrd [EMAIL PROTECTED]
[patch] Changes to RegistryCooker for subclassing
All, To begin with, should proposed mod_perl patches go to [EMAIL PROTECTED]? The documentation seemed a little unclear in this case (I decided to play it safe since I didn't run across any messages on the dev list from outside developers.) When I was converting Apache::PAR to work with mod_perl 2.x, one problem I had was with the way in which ModPerl::RegistryCooker stores member data. Any subclass of ModPerl::RegistryCooker (in my case, for Apache::PAR::RegistryCooker) that need to store their own module data have a problem - they need to pick an array element to store their data in. Because of the way in which ModPerl::RegistryCooker works currently, that means hardcoding an array index (because not all array members are created in new or init). Thus, in Apache::PAR::RegistryCooker I have a line similar to the following: use constant PARDATA = 8; This is not optimal, especially since this has already changed in the CVS version of RegistryCooker since I started working on it - luckily, to less members, not more :-) I propose a change to RegistryCooker.pm so that member data is always defined in the init sub, so that I could change the above line to something more like: use constant PARDATA = -1; and in my handler, push a new element on after new has been called. This would keep future changes to the RegistryCooker script from potentially breaking other modules which must store their own data as well. Below is a (small) patch to the CVS version of RegistryCooker.pm to do this. Down side is that if new member data is added, it would then also need to be added to the init sub. If you have any questions, please let me know. *** RegistryCooker.pm.bak Sun Feb 2 21:00:59 2003 --- RegistryCooker.pm Sun Feb 2 21:10:51 2003 *** *** 107,124 --- 107,128 # # func: init # dflt: init # desc: initializes the data object's fields: REQ FILENAME URI + # also declares other members not yet used # args: $r - Apache::Request object # rtrn: nothing # sub init { $_[0]-[REQ] = $_[1]; $_[0]-[URI] = $_[1]-uri; $_[0]-[FILENAME] = $_[1]-filename; + $_[0]-[MTIME]= undef; + $_[0]-[PACKAGE] = undef; + $_[0]-[CODE] = undef; } # # func: handler # dflt: handler Thanks, -- Nathan Byrd [EMAIL PROTECTED]
Re: [ANNOUNCE] libapreq-1.1 is out
On Thu, 2003-01-30 at 16:36, Stas Bekman wrote: Joe Schaefer wrote: Matt Sergeant [EMAIL PROTECTED] writes: On 28 Jan 2003, Joe Schaefer wrote: libapreq-1.1 is now available on CPAN, and also through the Apache website at http://www.apache.org/dist/httpd/libapreq/libapreq-1.1.tar.gz Failed badly to install for me. First of all it won't install via the CPAN shell as root because the test harness tries to deliver files from what becomes a root-owned directory, and it won't do that. The test suite was lifted directly from mod_perl. Are you able to able to test/install mod_perl using the same approach? Joe, I thought you've reverted to use the old test suite? Matt, Apache::Test may not work when run under root, because Apache won't let you start the server as 'User root' so it tries to use 'nobody' or something else as the username the server runs under, which of course has no perms to access files created by root and hence the problem. I suppose the solution is to chown all the autogenerated files to that chosen user and then the issue will be resolved. Meanwhile please try to run the test suite as non-root. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com Stas, I've run into the same problem while testing with Apache::PAR. Unfortunately, I don't think chown'ing the files will work (at least in my case), because the directory itself (/root/.cpanplus on my box) isn't accessible from a non-root user. I haven't worked on a solution yet, but I was thinking the best thing to do might be to create a temp directory (maybe with a prompt for the directory to create it under) from the generated Makefile in the start_httpd section and copy any content (and then remove it in kill_httpd) Maybe this would be a good feature to add to the Apache::test and Apache::Test modules? Thanks, -- Nathan Byrd [EMAIL PROTECTED]
RE: OSCON ideas - missing proceedings
Mark Schoonover writes: Are there plans to do the University again?? Every year or two I try again to revive it. Your message started me again this year. No promises, but we're looking into it. Thanks Nat for the work you did down here!! Thanks for your kind words. I love every minute of being at a conference, so it's hard to describe it as work.[*] Nat [*] Just don't ask me about the minutes organizing the conference before it all happens :-)
RE: OSCON ideas - missing proceedings
Mark Schoonover writes: Any chance they will bring it back to San Diego?? :) Not for two years at least (the duration of the contract with the Portland hotel). The San Diego hotel was much more expensive and remote, compared to the Portland hotel. I think people are really going to enjoy being in the middle of a city at this year's OSCON. Nat
Re: OSCON ideas - missing proceedings
Robert Landrum writes: One of the other things I disliked about the last OSCON was the missing Perl Conference Proceedings. They didn't appear because we didn't have time at O'Reilly to do it. They're prepared in Framemaker, to fit with our style guide, and take a huge and painful amount of time to do. Jon Orwant did them in 2000, I did them in 2001, and nobody had time to do them in 2002. I can't see them in 2003, either, as we're not soliciting refereed papers this year. We do make presentation materials available online after the conference ends, for what that's worth. Nat
Re: OSCON ideas - MVC talk
Ask Bjoern Hansen writes: On Wed, 8 Jan 2003, Perrin Harkins wrote: Like Perrin I would like feedback on the idea before putting in my proposal. I've also been asked if anyone has a wishlist of talks they'd like to see at the conference. Ideally they'd be talks I'd pay money to see but I could live with talks I'd like to see even though they're hard to justify to my boss. Feel free to brainstorm here as much as you want :-) Nat (yes, yes, we all want to see the How mod_perl 2.0 was finished but I'm not sure that's on the cards :-)
[mp2] Byterange requests
Hi all, I'm currently attempting to upgrade Apache::PAR to work with mod_perl 2, and one of the issues I am running into is with byterange requests: With mod_perl 1.x, it was possible (using Apache::File) to use byteranges with requests using $r-each_byterange and $r-set_byterange (a good example is in the mod_perl Developer's Cookbook, section 6.7, Byteserving and Range Requests.) It appears that with Apache2/mod_perl2 ap_each_byterange and ap_set_byterange are no longer available, replaced instead by a protocol filter in Apache. The only documentation for Apache I could find regarding this is at http://httpd.apache.org/docs-2.0/developer/filters.html - in that document, it explains that Byterange: We have coded it to be inserted for all requests, and it is removed if not used. Does anyone know if the above statement includes mod_perl requests, or is there another workaround to send byterange responses with mod_perl modules? I suppose it could be implemented in the module itself (or as a patch to mod_perl, maybe in Apache::Response), but I don't want to attempt that if the byterange filter could be run anyway for a request. Thanks, -- Nathan Byrd [EMAIL PROTECTED]
Perl Cookbook modperl chapter
I need some people with brains (instead of the warm gray mush filling my head, the effects of becoming an editor) to look over the first 1/3 or so of a mod_perl chapter for the upcoming Perl Cookbook. I need people to read the work for accuracy. If you're interested, send me mail: [EMAIL PROTECTED]. I also need help on content. I'm not competing with Geoff, Randy, and Paul's excellent book (mod_perl Developer's Cookbook)--they have 630 pages to cover way more topics than I do. Their book will always be the definitive place for a hard-core mod_perl developer to go--in fact, I'll have them in the See Also sections of the Perl Cookbook. But I need to cover 15-20 topics that most people of beginning to intermediate mod_perl use will encounter. Current recipe list: [gnat:~] grep head1 Ora/pcb2/ch21.pod =head1 Introduction =head1 Authenticating in mod_perl =head1 Setting Cookies in mod_perl =head1 Accessing Cookie Values from mod_perl =head1 Redirecting the Browser from mod_perl =head1 Interrogating Headers in mod_perl Handlers =head1 Accessing Form Parameters from mod_perl =head1 Receiving Uploaded Files in mod_perl All suggestions appreciated. Thanks, Nat
Re: Perl Cookbook modperl chapter
Nick Tonkin writes: Obviously you (or ORA) _are_ competing with mod_perl Developer's Cookbook ... If ORA wanted to cover mod_perl they should not have let Geoff co. get away to another publisher. Actually, we do cover mod_perl--we published the Eagle book, Writing Apache Modules ... way back in 1999. We have Stas and Eric's book coming out in 2003 (March? April?). It busts my nut that we didn't publish Geoff's, Randy's, and Paul's book, but that's the way the dice fall. There's no way that 20 recipes in the Perl Cookbook will compete with the what, 250? in the mod_perl Developer's Cookbook. Especially when the introduction and each recipe points the reader to the mpDC. The Perl Cookbook has over a hundred thousand readers. I want to push as many as I can onto the mpDC. If that's competing, then I can only say that you have a strange sense of competition :-) If we were going to compete head-to-head with the mod_perl Developer's Cookbook, O'Reilly would publish the mod_perl Cookbook. We've done it before (PHP Cookbook vs PHP Developer's Cookbook). We don't have plans to do that, and I'd fight them if we did. Geoff et al.'s book is very good, and I want to help their sales not hurt them. Trying now to cover highly complex topics like Authenticating in mod_perl in a recipe in a chapter of the Perl cookbook is futile. It will only serve to oversimplify and lead novices into a false sense of competence. The Perl Cookbook has never pretended to be the definitive guide to anything it covers (have you seen the Perl Cookbook? I recommend it :-). Each recipe includes references to definitive sources of information (manpages, web sites, and other books). Nat
[ANNOUNCE] Apache::PAR 0.01
Hi all, I am happy to announce the initial public release to CPAN of the Apache::PAR module. Apache::PAR is a framework for including Perl ARchive files in a mod_perl environment. It allows an author to package up a web application, including configuration, static files, Perl modules, and Registry and PerlRun scripts to include in a single file. This archive can then be moved to other locations on the same system or distributed, and loaded with a single set of configuration options in the Apache configuration. Scripts, modules, and content should continue to run without modifications. These modules are based on PAR.pm by Autrijus Tang and Archive::Zip by Ned Konz, as well as the mod_perl modules. They extend the concept of PAR files to mod_perl, similar to how WAR archives work for Java. An archive (which is really a zip file), contains one or more elements which can be served to clients making requests to an Apache web server. For more information, see the Perl documentation or README included with the package. The CPAN entry can be found at: http://search.cpan.org/author/NBYRD/Apache-PAR-0.01/ A sourceforge project (including CVS access) has also been created at: http://sourceforge.net/projects/apache-par/ Please let me know if you have any questions/comments/suggestions. This is especially important as I know there are some rough edges to work out, and I would love to get feedback to help me determine priorities. And, of course, patches are always welcome. :-) Thanks, -- Nathan Byrd [EMAIL PROTECTED]
RFC: Apache::PAR
Hi all, Below is a suggestion for a new set of modules, Apache::PAR, Apache::PAR::Static, Apache::PAR::Registry, and Apache::PAR::PerlRun. I have initial coding and testing complete on these (except for some pod documentation and test scripts), but wanted to post before moving forward with CPAN, etc. NAME: Apache::PAR AUTHOR: Nathan Byrd [EMAIL PROTECTED] MODULES: Apache::PAR, Apache::PAR::Static, Apache::PAR::Registry, Apache::PAR::PerlRun DESCRIPTION: Apache::PAR is a framework for including Perl ARchive files in a mod_perl environment. It allows an author to package up a web application, including configuration, static files, Perl modules, and Registry and PerlRun scripts to include in a single file. This archive can then be moved to other locations on the same system or distributed, and loaded with a single set of configuration options in the Apache configuration. Scripts, modules, and content should continue to run without modifications (see TODO below for current exception.) These modules are based on PAR.pm by Autrijus Tang and Archive::Zip by Ned Konz, as well as the mod_perl modules. They extend the concept of PAR files to mod_perl, similar to how WAR archives work for Java. An archive (which is really a zip file), contains one or more elements which can be served to clients making requests to an Apache web server. Below is a more complete description of each module: MODULE: Apache::PAR DESCRIPTION: Performs the work of specifying the location of PAR archives and allowing the loading of modules from these archives. The files and paths can be specified at load time. Once an archive has been located, an optional web.conf (filename configurable) is then loaded and included into the main web configuration. Once Apache::PAR has been loaded, Perl Apache modules within these .par files can then be loaded (all the heavy lifting for this is performed by PAR.pm.) A sample Apache configuration and web.conf is below: httpd.conf (or mod_perl.conf): PARDir /path/to/par/archive/directory PARDir /path/to/another/archive/directory ... PARFile /path/to/a/par/file.par ... PerlModule Apache::PAR web.conf (inside a .par file): Alias /myapp/cgi-perl/ ##PARFILE##/ Location /myapp/cgi-perl Options +ExecCGI SetHandler perl-script PerlHandler Apache::PAR::Registry /Location PerlModule MyApp::TestMod Alias /myapp/mod/ ##PARFILE##/ Location /myapp/mod SetHandler perl-script PerlHandler TestMod /Location ... The web.conf is then included into the main Apache configuration at load time (with appropriate substitutions for ##PARFILE##, etc) MODULE: Apache::PAR::Static DESCRIPTION: The Apache::PAR::Static module allows a .par file creator to place any static content into a .par archive (under a configurable directory in the .par file) to be served directly to clients. Currently, it supports mime lookup with MIME::Types, byte range requests, customizable indexes (with PARStaticDirectoryIndex), default mime types, etc. A sample configuration entry is below: web.conf: Alias /myapp/static/ ##PARFILE##/ Location /myapp/static SetHandler perl-script PerlHandler Apache::PAR::Static PerlSetVar PARStaticDirectoryIndex index.htm PerlAddVar PARStaticDirectoryIndex index.html PerlSetVar PARStaticDefaultMIME text/html /Location A page could then be accessed with a URL similar to the following: http://127.0.0.1/myapp/static/ or http://127.0.0.1/myapp/static/docs/docs.pdf which would pull either an index.htm (or index.html), or docs/docs.pdf file from the /static directory (configurable) within the .par file MODULE: Apache::PAR::Registry DESCRIPTION: Apache::Registry (actually, Apache::RegistryNG) subclass which serves Apache::Registry scripts to clients. Current features include: The configuration can require .par archive to be executable (with Options +ExecCGI), file modification time testing, path_info rewriting (Registry scripts can still use path_info as normal), and Module loading from within the .par archive (via PAR). A sample configuration is below: Alias /myapp/cgi-perl/ ##PARFILE##/ Location /myapp/cgi-perl Options +ExecCGI SetHandler perl-script PerlHandler Apache::PAR::Registry /Location A registry script could then be accessed with a URL similar to the following: http://127.0.0.1/myapp/cgi-perl/startreg.pl or http://127.0.0.1/myapp/cgi-perl/startreg.pl/extra/path/info which would execute the startreg.pl script from the scripts/ directory (configurable), and optionally set path_info to /extra/path/info MODULE: Apache::PAR::PerlRun DESCRIPTION: Apache::PAR::PerlRun functions in the same way as Apache::PAR::Registry, but is a child of Apache::PerlRun, and has the same advantages/disadvantages as Apache::PerlRun, like cleaning up the namespace after execution, etc. A sample configuration is below: Alias /myapp/cgi-run/ ##PARFILE##/ Location /myapp/cgi-run Options +ExecCGI SetHandler perl-script PerlHandler Apache::PAR::PerlRun /Location registry script could then be accessed with a URL similar
RE: [OTish] Version Control?
I've wondered about this too. Mainly, if you have multiple developers working with the same web server, how would you test your scripts without running into each other? it seems like CVS would work well if everyone was developing on his/her own box. Nate -Original Message- From: Hsiao, Chang-Ping [mailto:CHsiao;corp.untd.com] Sent: Wednesday, October 30, 2002 4:29 PM To: 'Richard Clarke'; [EMAIL PROTECTED] Subject: RE: [OTish] Version Control? CVS is easy to use but confusing at first. Once you get used to it, you should not complain. I don't quite get your saying I don't however feel that the organizational logic of a websites code base fits well into the CVS paradigm. Isn't your files hierarchical? If so, why is CVS not fitting your purpose? Chang-Ping Hsiao -Original Message- From: Richard Clarke [mailto:ric;likewhoa.com] Sent: Wednesday, October 30, 2002 1:09 PM To: [EMAIL PROTECTED] Subject: [OTish] Version Control? Does anyone in the list use any kind of version control (e.g. CVS) for the perl/template codebase of their website? Now that my code base is growing I feel the increasing need to provide better version/backup control than my current hourly crontab tar. I don't however feel that the organizational logic of a websites code base fits well into the CVS paradigm. Am I being to short sighted in this assumption? Does anyone have any recommended method? I don't use version numbers at all? Does anyone? Richard. .
Re: Hiding perl code
Jon, I've been doing some thinking along these lines (for website security, not for releasing code). I don't have a solution, but below are some thoughts I've had. I would love to hear from anyone who knows solutions for any of the points below. Most of the thoughts below are based on encryption, as I don't believe that obfuscating or compiling offer any real security for an attacker who is determined. For Apache::Registry (or Apache::PerlRun) scripts, it should be fairly trivial to write an Apache::RegistryEncrypt, based on Apache::RegistryNG, that would first decrypt a source file during compile using a public key stored in a (presumably) safe location before turning it into a module. The secret key could be stored on a different (development) server and not be accessible, which would give you fairly good security, both for reading and writing. Unfortunately, this would not protect modules (particularly application modules) which are use'd from these scripts. For modules, it might be possible to write a module which would first decrypt a file before using it (would something using the same type of method as ex::lib::zip* work?). Modules could then be preloaded using PerlModule from the Apache configuration or use lines from a startup.pl file. However, I imagine it might be difficult to decide which modules *have* to be encrypted - if all modules have to be encrypted, that would affect even standard modules, but if it is selectable, there would have to be a way of keeping an attacker from simply placing a module earlier in the INC path. Maybe something like everything with the FOOBAR:: prefix has to be encrypted? The other benefit of this is that the same solution would also work for encrypting true mod_perl handlers, not just scripts. I believe this would be preferable to using a source filter, as a source filter would only protect reading, not writing. Since a source filter operates on everything after the use Filter::Whatever; line, an attacker could simply place code above that line, or replace the file completely and negate any benefit from using it. Besides that, it might be difficult to access a public key from a source filter in a secure manner. For website security, the other solution I considered was to use Apache::RegistryBB or something homebrew which wouldn't check the modification time of a script after the initial compile and use, then simply unmount the filesystem after Apache startup. Of course, like the above solution, this only protects the on-disk copy, the code would still be accessible in memory if debugging was available, etc. Other than that, this just seems like a clunky solution, and not very good if the filesystem has to be manually mounted to restart the webserver, but the admin isn't available :-) Thanks, Nathan Byrd * http://search.cpan.org/search?mode=modulequery=ex%3A%3Alib%3A%3Azip On Sun, 2002-07-21 at 21:58, Jonathon M. Robison wrote: Anyone know offhand a good way to hide your perl code when using mod_perl? Acme::Bleach isn't doing it - httpd is failing to start on initial test, and then on second test I find that httpd.conf suddenly got a 'use Acme::Bleach' inserted at line 1 and the whole thing is bleached. Perhaps perl2exe? --Jon R
take23 and what we're doing
take23.org has been very quiet. I think it'd be cool if everyone on this list posted a short piece about their current mod_perl project. It could be a module they're working on, a site they built, or even something as simple as how I used Apache::MP3 to let everyone in our house listen to our music collection. It'd be fun to see what everyone else is doing, and it'd really help give the site a lift. If the articles were RSSed and picked up by meerkat (www.oreillynet.com/meerkat) I think it'd do good for the world to see a constant flow of mod_perl activity. What do you say, Matt? Nat
Re: Excellent article on Apache/mod_perl at eToys
I suppose I should point out that perl.com is always interested in mod_perl articles. If you've learned lessons that others could benefit from, contact the perl.com editor, Simon Cozens [EMAIL PROTECTED]. Nat
Re: p5ee list active
Stas Bekman writes: The list's goal is to create the Perl 5 Enterprise Extensions. Send mail to [EMAIL PROTECTED] to join. When we've decided on a path and start to code, I'll have a CVS repository created. any reason for hardcoding 5 in the name? Two reasons: * perl6 doesn't exist yet * the modules are going to be specific to a particular version of perl. The built-in language features and standard modules with perl6 may incorporate some of the features we implement and necessarily change what goes into a P6EE. Any further discussion about this should take place on the p5ee list. Thanks, Nat
Re: [preview 1] new mod_perl site concept
Stas Bekman writes: Notice that I've just taken a few pages together, but let me know what you think. Nice. I assume that we're at the stage of criticising the design and not the text/ (I'd like you to use the text I came up with for my experiment at http://24.255.234.11/~gnat/modperl/). I have some questions: * why have a splash screen? They're an incredible waste of time. I've not heard a single word in favour of them. * I prefer a nav bar on the left-hand side to tabs. Does splash handle that? The way the tabs 'nest' is really ugly. * blue on blue at the bottom for the http://perl.apache.org/ link is almost unreadable Thanks for making progress on this! Nat
Re: Excellent article on Apache/mod_perl at eToys
Leon Brocard writes: Perhaps a port of JMS is in order. Interestingly, I've been thinking along the same lines. Spread (http://www.spread.org/) can be used for the publish/subscribe messaging domain but queueing seems to be important too. Straying a bit offtopic perhaps, but I wonder what would be involved... I like the idea of P2EE. If the goal is to provide the same features as Java, why not just implement the Java messaging, transactions, etc. APIs in Perl? That is, endeavour to have the same classes and methods as Java, to the greatest extent possible. That'll also make it possible for Java programmers to become Perl programmers, bwahaha. Someone described Java beans to me as being more or less classes that follow conventions on things like accessor names and methods to respond to events. Those conventions permit introspection and interoperability between two classes that have no a priori knowledge of each other. I like that idea, too. It'd be fun to see what kinds of UI (both GUI and web) things become easier with this kind of functionality. Of course, we couldn't call it a Java bean. They'd have to be Camel droppings. :-) Nat
Re: [OT] P2EE Redux was: Excellent article on Apache/mod_perl at eToys
Stephen Adkins writes: If no one suggests an appropriate list, I propose starting a p2ee group on SourceForge. This gives us mailing lists and a CVS repository for the artifacts of the effort (which will mostly be specifications and documentation, with maybe some Bundle files). I would also submit the list information to perl.org for inclusion in the list of lists. We'd be glad to host it at perl.org. If that's cool with you, I'll ask Ask to create the mailing list and CVS repository on perl.org. Once we have something to show, we can get a website too. I'd imagine the CVS would include code we write, snapshots of which would be periodically released to CPAN. Anyway, that's for the list once we have it. Nat
Re: [OT] P2EE Redux was: Excellent article on Apache/mod_perl at eToys
Stephen Adkins writes: That would be great (as long as perl.org can host the CVS too). My concern was that perl.org might not be as specialized in hosting development teams as sourceforge.net. Do you support viewcvs or similar for web browsing of the CVS repository? cvsweb. You can see what we've got at cvs.perl.org. I'll ask Ask to add the list and repository. Cheers; Nat
p5ee list active
The list's goal is to create the Perl 5 Enterprise Extensions. Send mail to [EMAIL PROTECTED] to join. When we've decided on a path and start to code, I'll have a CVS repository created. Nat
Re: perl.apache.org / apache.perl.org
Ask Bjoern Hansen writes: I'll chew on a new layout and give you something by the end of the week. Thanks, awesome! :-) I did have something by the end of last week, just not much. I'd hoped to find the time to plug the holes this week, but haven't been able to. So here it is, woefully incomplete. The URL is: http://c1853353-a.ftclns1.co.home.com/~gnat/modperl/ I've got: * Home page * About * Download done. My plan was to just go through perl.apache.org and move content into that framework (for instance, success stories and testimonials go as a page under 'About'). There are some web design To Do items: * ensure colors are part of the standard palette (right now they're just easy to type in hex :-) * contemplate CSS and enforcing standards like all links are in bold. Nat
Re: IBM patents Template Systems?
Joe Schaefer writes: A causal reading seems to suggest that most mod_perl-based templating systems do exactly what this patent will cover: i.e. set up a non-HTML based website where templates dynamically convert non-HTML files into HTML. IANAL (and IVAGINAL too, but that's for a different time :-) but as far as I can see, the patent applies to applications that interact with the user to build the website. In other words, mod_perl's character-based DIY stuff wouldn't count. http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2Sect2=HITOFFp=1u=/netahtml/search-bool.htmlr=10f=Gl=50co1=ANDd=ft00s1=HTMLOS=HTMLRS=HTML Abstract A software tool is provided for use with a computer system for simplifying the creation of Web sites. The tool comprises a plurality of pre-stored templates, comprising HTML formatting code, text, fields and formulas. The templates preferably correspond to different types of Web pages and other features commonly found on or available to Web sites. Each feature may have various options. To create a web site, a Web site creator (the person using the tool to create a web site) is prompted by the tool through a series of views stored in the tool to select the features and options desired for the Web site. Based on these selections, the tool prompts the web site creator to supply data to populate fields of the templates determined by the tool to correspond to the selected features and options. Based on the identified templates and supplied data, the tool generates the customized Web site without the web site creator writing any HTML or other programming code. Based on roles-based, multi-level security, certain users of the web site may have access to certain information and others may not. Nat
Re: perl.apache.org / apache.perl.org
Stas Bekman writes: Everything is under CVS, and if somebody wants to come and give a hand to redo the site, there is no problem to give a cvs access to this person. I'll chew on a new layout and give you something by the end of the week. Thanks, Nat
Re: [OT] New Micro$oft vulnerability?
Tim Peoples writes: I tried doing the s/OK/DECLINED/ thing and it didn't do the trick. :-( I forgot to mention that this is in combination with HTML::Mason, but I doubt that should have any effect. This appears to be a bug in mod_perl, partially (said, I think, Geoff Young) fixed in the latest version but still not completely eradicated. I was mistaken with the OK/DECLINED change--that doesn't make PerlSetEnv work again. I don't have a workaround, sorry. I don't know exactly what triggers the problem (is it PostReadRequestHandler, is it preventing logging, is it a 408?) It might be that you could use a different phase of the transaction, and work around it. Sorry I can't be more help. Nat
Re: [OT] New Micro$oft vulnerability?
http://www.torkington.com/vermicide.txt has a mod_perl handler to catch the requests as soon as they arrive, and discard them with a minimum of work to Apache. If your web server is struggling under the load, this might help. The heuristic it uses for requests to ignore with prejudice is the presence of root.exe, cmd.exe, or default.ida. You might want to tweak the regexp if those files are part of your web site :-) Yes, it's ugly to put the code into your httpd.conf. Consider this a visual reminder to take it out once the worm scare has passed. Nat
Re: [OT] New Micro$oft vulnerability?
[Apologies if you get this twice--mailed it first from my oreilly.com account, which may not be the address subscribed to this list] http://www.torkington.com/vermicide.txt has a mod_perl handler to catch the requests as soon as they arrive, and discard them with a minimum of work to Apache. If your web server is struggling under the load, this might help. The heuristic it uses for requests to ignore with prejudice is the presence of root.exe, cmd.exe, or default.ida. You might want to tweak the regexp if those files are part of your web site :-) Yes, it's ugly to put the code into your httpd.conf. Consider this a visual reminder to take it out once the worm scare has passed. Nat
Re: [OT] New Micro$oft vulnerability?
Tim Peoples writes: This 'Apache::Vermicide' module, installed as a 'PerlPostReadRequestHandler', seems to be preventing any 'PerlSetEnv' directives from being parsed out of a '.htaccess' file (or equivalent). IOW, the ENV vars aren't getting set properly. I'm investigating how to remedy this issue. Whoops! Returning OK terminates the PostReadRequest phase, apparently. Changing that to return DECLINED made PerlSetEnv work again. Sorry, Nat
Re: [OT] New Micro$oft vulnerability?
Tim Peoples writes: I tried doing the s/OK/DECLINED/ thing and it didn't do the trick. :-( You're right, it was the restart that did it. OK/DECLINED makes no difference in that handler. I'm seeing, with or without my handler, the PerlSetEnv stuff only happening once per connection rather than once per request. That is, the first time I hit a printenv page, I see the envariables. The second, third, etc. times I don't. Unless I wait a while, in which case my browser closes the persistent connection to the server, and then the next load of the printenv page displays the variables again. As I say, this happens regardless of whether or not I enable the PostReadRequest handler. I forgot to mention that this is in combination with HTML::Mason, but I doubt that should have any effect. I'm seeing it in mod_perl 1.22 on Apache 1.3.12 on FreeBSD, without Mason. Nat
POST params with Location
Hey all- I'm beating my head against this issue, and I can't seem to figure it out. The problem is I have a Location block with a PerlHandler for a ticketing system app I'm writing: Location /tickets SetHandler perl-script PerlHandler Apache::TicketSystem /Location I'm using Apache::Request to access the params with this simple code: sub handler { my $r = Apache::Request-new(shift()); my %args = %{ $r-param }; # more code ... } When I call the app with GET params, everything works fine. When I use POST, though, I don't get anything in %args. Reading the manpage for Apache::Request it looks like I should automatically get the params, ala CGI.pm. Oh yeah, and CGI.pm doesn't work either, so it doesn't seem to be an Apache::Request problem. Am I doing something wrong? Does Location not support POST params? All the packages are at the latest rev as far as I'm aware. perl 5.6.1 apache 1.3.20 mod_perl 1.25 libapreq 0.33 Thanks for any help. -Nate -- Nathan Wiger Sysadmin and Perl Hacker Sun Microsystems
Re: POST params with Location (solved)
Tom Servo wrote: There could be something I'm missing here, but I believe you need to use $r-content() to get POST arguments. Beware though, that once you call content() you can't call it again, so hang onto whatever comes out of it. Also...isn't it $r-args() or am I just completely missing something here? Yeah, but if you use Apache::Request then you get a param() method which works just like CGI.pm's. That is, it transparently gives you your params whether they're POST/GET/whatever. It also works really nicely with uploads. Anyways, it was a stoopid mistake, which you hit on in your reply. I had a module using a module using a module which was using CGI. Once I wrapped it in a check for MOD_PERL everything works. Thanks, Nate
Apache::ConfigFile just uploaded
Hey all- So, about 2 years after I originally discussed it here, I finally put the finishing touches on Apache::ConfigFile and uploaded it to CPAN. It is available in my CPAN directory: http://www.cpan.org/authors/id/N/NW/NWIGER/ This modules does the following: - Gives you offline access to any Apache style config file - Provides methods for accessing config commands and sections - Provides a dir_config() which gives you access to PerlSetVar declarations by name, just like mod_perl - Properly expands Include directives and handles paths relative to ServerRoot - Handles multiple declarations for the same context (for example, multiple VirtualHost definitions) - Provides autoloaded methods for common core functions, such as server_root() - Also has several options which can be used to extend the Apache/NCSA syntax, so that you can write a custom config module for your own applications and use this module to parse it. In any case, the module is stable but I'd be shocked it is bug-free. So if you have any comments or bugfixes I'd like to know about them. Hope you find this useful! -Nate -- Nathan Wiger Sysadmin and Perl Hacker Sun Microsystems
Re: OT: Re: ApacheCon Dublin Cancelled?
Matt Sergeant writes: I guess TPC::Hawaii is out then :-) Don't think I haven't argued for it! Nat
Re: OT: Re: ApacheCon Dublin Cancelled?
Matt Sergeant writes: I doubt it's the last one we'll see fall... I suspect TPC will be a shadow of its former self... :( Despite my best efforts (zillions more tracks than last year, 200+ talks, five days instead of four, all in a tanking economy), there's going to be an OScon with TPC next year. They're arguing about the dates right now (June? Or September? June! September!) and I can announce them next week. We've talked about next year, and the basic story is that there'll be fewer tracks than this year, getting it back to a manageable level. I think we're going to keep it at 5 days. Attendance at this year's conference will be down from last year, but it's nowhere near the point where we'd say that's it, we can't do this any more. I'm so looking forward to going back to last year's convention size. Organizing this year's convention (TPC+modperl+Apache+PHP+Zope+Python+ MySQL+PostgreSQL+Mozilla+Linux+OpenSource+Java+Tcl+EmergingTopics) was threatening my sanity--too many talks to keep straight, too many speakers to cancel at the last minute, too many different special interests pissed off for whatever reasons. Anyone have requests for next year? I know everyone wants a cheaper conference, but I've banged my head against a brick wall at O'Reilly for four years arguing that it should be cheaper. If you feel that there'd be more attendees at a lower price, then I suggest you tell that to every O'Reilly conferences person you see at TPC (except for me :-) Are there any requests other than price for next year? What would you like to see? What could you do without? Nat
Re: Help, no room at the inn!
Jeffrey W. Baker writes: Because I am an Authentic 99.44 Percent Pure Jackass(tm) I haven't booked a room at the O'Reilly convention fast approaching. I called the hotel today and all they were able to offer me were some overpriced suites that I don't want. I would be very grateful if one of you good fellows with whom I have shared this list for so long, and who booked a double room for themselves, would generously allow me to occupy the other bed and split the room rate. This information was valid a while ago, not sure if they still have rooms available: Property Name:San Diego Bay View Thriftlodge Property Address: 1943 Pacific Highway San Diego, California, United States, 92101 Property Phone Number: 619-232-7551 Reservation Phone: 1-800-578-7878 The ThriftLodge is 1.8 miles from the Sheraton Less than the length of the airport runway in the picture. Easily walkable in 30-40 minutes and even more easily bike-able. Or, with the savings one realizes from lodging, one could rent a car. (The airport car rental agencies are, ironically, about halfway between the ThriftLodge and the Sheraton, along the walking path.) A car would cost $20-30 per day -- far less than the difference in hotel rates. The AAA rate is $40.50 per night for a non-smoking room with a queen bed. There's also an EconoLodge -- same company -- within two blocks. It's slightly more (not a lot more) per night and has a few more amenities. (See http://www.travelodge.com/ctg/cgi-bin/Travelodge.) Finally, there's a Best Western that's $80-90 per night (if you get a discount) in the other direction on the west side of the harbor. The footpath goes there too, though it's a longer walk. Good luck! Nat
Re: Mod Perl Tutorials??
Stas Bekman writes: Anyway, you can take tutorials without going to any conferences. My tutorials are available from http://stason.org/talks/, Nat has posted his tutorial's URL a few months ago and it should be available in the archives. I suppose you can ask other folks that deliver mod_perl tutorials at OSC to give you the URL of their talks. I won't be giving my tutorial at the Open Source Convention. I'd just like to remind folks that the course-notes are not the only reason to attend the tutorial. The other is the face-to-face information exchange, which has a vastly higher bandwidth than email. I learned more practical information listening to the mod_perl guys drinking beer at ApacheCon than I did from the mailing list. I heard knowledge *emerge* from conversations (wow, it sounds like most everyone modifies Apache::DBI for their own needs). It was really cool. I point this out because this year we REALLY REALLY need attendees. The economy is in the crapper just as we expanded to have many more tracks and topics (splitting mod_perl off from Perl, so you can have a dedicated room of just mod_perl for two days, is one example). If you can justify attending, and you can convince your boss to pay for it, then please try to come. I don't normally beg this shamelessly, but if we end up with 200 attendees, it *will* affect how much of a convention we can put on next year. So by all means read the tutorials online, but remember that there are lots of other reasons to attend the Open Source Convention (the big shindig that includes The Perl Conference and the mod_perl track). Thanks, Nat (oscon/tpc content planner)
Re: Object - RDBMS mapping tools and mod_perl
Ray Zimmerman wrote: I'm looking for a good package to use for Object - RDBMS mapping in the context of mod_perl and Mason. Something that will handled object inheritance and nested objects, etc. One that I've been meaning to try out when I get a chance is GOODS at: http://www.ispras.ru/~knizhnik/goods.html I've never used it and have never heard of anyone useing it either, but it looks intriging and has perl bindings. I want to attempt to store XML trees in it, as I've yet to find a good free sytem for storing arbitrary XML data. If you do attempt to use it, please let me know how it works out. Nathan
Re: PERL.COM, ORA and Songline mailservers SUCK!
Jesse Erlbaum writes: I've been trying for THREE DAYS to email SOMEBODY at PERL.COM about taking out a damn ad in their Perl.Com newsletter. The bounces from songline and oreillynet were very bogus. I've sent your mail to someone high up at perl.com to figure out what's going on and get in touch with you. Sorry for the trouble you've had reaching us! Nat (editor at O'Reilly, also [EMAIL PROTECTED] if you have any more trouble with ORA mail servers)
Re: [OT] Apachecon folks
Matt Sergeant writes: For what it's worth, I'm now back out from spending a week and a bit under the bar. What a hangover! :-) I'd like to attest that I did see Matt away from the bar. Sometimes he was pool-side, and sometimes he went to Fry's with us. :-) I can't say how much fun it was meeting the mod_perl folks face-to-face. I'm normally insane at TPC, so it was good to meet everyone whose messages I've been reading for the last few years in a more relaxed atmosphere (translation: over 21oz Guinness and a cheesecake pizza :-) Nat
Re: Fw: Re: [OT] ApacheCon BOF
Blue Lang wrote: I'd like to officially vote for Maude Pearl, the 1920's Bettie Paige-ish dominatrix-esque mod_perl mascot. Wow. I've had "perl6 themes" as a background process for a while now. SM is certainly a meme that precious few other programming languages have made use of ... There's a kill() function, but don't forget your safe word! Nat
Re: [OT] JMS-like event framework for Perl
"Michael A. Nachbaur" wrote: Since today seems to be "The Day of the Off Topic(tm)", I thought I'd jump in with my question. Is there a event messaging framework available for Perl, similar to JMS? I'd like to be able to have an object registered as a handler for certain "events", and have perl code throw those events causing the object to be run automatically (publish / subscribe model). I think there's an Event.pm, but you're probably after something like POE: http://www.perl.com/pub/2001/01/poe.html - intro and tutorial http://poe.perl.org/ - homepage (down?) http://poe.dyndns.org/ - Rocco's dialin machine Nat
Re: [OT] JMS-like event framework for Perl
jeff saenz wrote: Might be possible that soap is addressing messaging issues. Is there a event messaging framework available for Perl, similar to JMS? I'd like to be able to have an object registered as a handler for certain "events", and have perl code throw those events causing the object to be run automatically (publish / subscribe model). You're right, SOAP::Lite can do these things (and more). I was hallucinating, thinking that you wanted to write a program in an event-driven style. http://www.soaplite.com/ http://guide.soaplite.com/ Nat
RE: Looking for a new distro
We use Slackware (oi oi oi), have been since about '95, I love it :) 7.1 on a few machines, but 4.0 on most, Apache 1.3.14 and mod_perl 1.24_01 on nearly all of the important ones. We don't have a mind-boggling load, but several machines with a whole bunch of software/performing many different functions (including development at the same time) run for 6 months at a time on average. I believe there are reiserfs patches, but the only colleague I've seen try it out had a few probs with sendmail (overlapping messages etc), but everything else worked fine. Cheers, NP -Original Message- From: Joshua Chamas [mailto:[EMAIL PROTECTED]] Sent: Sunday, 14 January 2001 9:36 AM To: Jamie Krasnoo Cc: Modperl Subject: Re: Looking for a new distro Jamie Krasnoo wrote: Ok, I've had it with RH 7.0. Too many problems. What Linux distro are some of you using with Apache 1.3.14 and mod perl 1.24_01? I haven't used it yet, but I would eagerly be looking for one that has reiserfs compiled in. Is that a debian distro? I'm sitting on a redhat 6.2 distro and fsck'ing a 20G ext2fs raid-1 partition is not my idea of happy downtime. :( -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Mod_perl tutorials
Gunther Birznieks writes: However, I am willing to concede that as a first cut, fancy slides are probably not worth it because the slides will change too often. Once v1 is released, then someone can transcribe the slides to PPT (or maybe a tool will exist by then) as a "stable release" if they want to (probably someone like me.) Getting anything done with a mailing list full of programmers is nearly impossible. Everyone wants to write tools, but nobody has said "give me the slides for a week and I'll make them better". Instead we're arguing about the best source format :-) I developed the slides in a POD-like slide format that Tom Christiansen uses. One of his trainers developed a slide2rtf converter, and the rtf can then be imported into PowerPoint. That doesn't work with StarOffice, as importing RTF immediately drops you into the WordProcessor. I think that my slides are pretty close to a v1. I don't know that the subsequent tweaks will be worth the hassle of PPT conversion. I'd rather not revert back to the POD-like format. Importing into PPT is a pain in the arse. I'd rather find someone who wants to work on the class and say "ok, it's yours for a week--fix it". So consider this a call to arms: anyone with StarOffice/Powerpoint want to bang on the class? Nat
Re: Advocacy idea ...
Homsher, Dave V. writes: With all of the advocacy talk on the ML right now I've been mulling around the idea of having a "peer review" forum where one could post code that you are currently working on w/an explanation of what you are trying to accomplish and have the community review/give suggestions warnings, etc. or how to improve code (maybe /. style?). http://www.perlmonks.org/ is kinda like this. Kinda. I like the idea. Is there a threaded discussion package for mod_perl? cat take23-ideas mod_perl application index ^D Nat
Re: Mod_perl tutorials
J. J. Horner writes: What is the story on these tutorials? Is it something you can distribute, or did most of it come off of the top your head? Tutorials seems like a deadend for effort. I've had zero (0) responses to my offer of my "Introduction to mod_perl" tutorial. If nobody's interested in increasing the number of mod_perl programmers through tutorials, then the only other option I can think of is strategically-placed success stories. I know that perl.oreilly.com is making a point of collecting Perl success stories and is always hungry for more. They won't convert the unwashed there, though. It'd sure be nice to have a WebTechniques special issue on mod_perl. Hint, hint, Randal :-) Nat
Re: Re[2]: Mod_perl tutorials
Allen Wilson writes: I for one...would like to see some tutorials. I am just starting to use mod_perl and it hard getting a firm start. http://prometheus.frii.com/~gnat/mod_perl is the only freely-available tutorial that I know of. There are a few (ahem) bugs in the code, but the tutorial is still useful (IMHO). I'd appreciate any feedback you have. Nat
Re: Mod_perl tutorials
Matt Sergeant writes: Basically I see the distinction as news/community vs the official home page. The same as php3.org vs phpbuilder. I think modperl.com should be the webpage that shows modperl to be an active vibrant technology. In other words, I think take23 should really be on modperl.com. The domain name is the killer. Nat
Article idea: mod_perl + JSP
I think the 100% Java idea has had its day. Microsoft's .NET is a tacit admission that in the real world Microsoft will never own 100% of the market, so let's make things work better together. In that vein, I'd love to see an article on mod_perl and JSP cooperating. That is, a website that uses both and admits that each has its place. I know a lot of people don't like Java (I'm one of them), but mentioning JSP is the foot in the door to getting mindshare back from those folks who now think that Java is the only way. Anyone run such an installation? Anyone want to write about their setup and experiences? Nat
Re: Article idea: mod_perl + JSP
Perrin Harkins writes: Anyway, I think a better approach for getting attention from Java-minded people is to demonstrate that there are well-designed, carefully engineered sites being built in mod_perl. Most of the articles I see about Perl tend to play up the "quick hack" aspect, and ignore things like OO design, maintainability, and scalability. Those things are the stock in trade of Java articles, as a quick look through Java World will show. That's an offer of an article? :-) Nat
A plea for editing
Please trim your replies so that there aren't two pages of quoted material and then five lines of original response. Sometimes I feel like I need a map and compass to find the new message :-) Thanks, Nat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RFC: mod_perl advocacy project resurrection
J. J. Horner writes: I'd be interested in something like this. Certification is a quagmire. If it's done well, it takes a lot of work by the certification authority, and that makes it expensive for those certified. If it's done poorly, it's useless and is just a moneymaker for the certification authority. I think that certification is only really meaningful when you have too many applicants and need to give the employers a sense of how good the applicants are. That's the Cisco and Microsoft model, even though MCSE is a joke. I don't see a surfeit of mod_perl programmers. If anything, a stark shortage. I'd rather see us find some way to churn out perl and mod_perl programmers. For instance, release a beginner class on Perl and mod_perl and have local Perlmongers lead classes. I have my slides from the University of Perl, which I'd contribute to such an effort (they're pretty closely based around the Eagle book, and some of the details should be replaced with sections on Mason et al.). Nat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_perl advocacy project resurrection
ActiveState has built an Perl/Python IDE out of Mozilla: http://www.activestate.com/Products/Komodo/index.html too bad it's windows only :/ It says at: http://www.activestate.com/Products/Komodo/index.html that it is cross platform for Windows, Linux, and Unix. The beta they have available for downloading is win only, but I can't imagine them not supporting the other platforms once it's released since it's based on mozilla, which has made quite an effort to be truely cross platform. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RFC: mod_perl advocacy project resurrection
martin langhoff wrote: snip. Another item that we should really have is a good (and somehow sanctioned) RPM that replaces the apache rpm (or deb) included in broken distros. Then we can include in the guide and related pages a link for [broken-distro-name] users, so they get a suitable replacement with a similar config. That's an important issue, because a redhat user has other non-standard modules included in his rpm, such as PHP, and compiling a *complete* apache, with mod_perl, php and the kitchen sink is a daunting task -- and too high an entry price. anyway, not an easy task ... mmhhh.. martin Has anyone out there tried the apache toolbox? It looks like an interesting program that asks you what options you want in your apache, then downloads, compiles and installs your apache server. If it works as described, it would be a good option to recommend for users with broken rpms as you describe. It suposedly supports mod_perl, ssl, and even php all together somehow. I've never used it, but am planning to give it a shot next time I have to compile a new server. Its at: http://www.apachetoolbox.com/ Nathan Stitt Head Programer, Chief Cook, and Bottle Washer. Alliance Medical http://www.allmed.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RFC: mod_perl advocacy project resurrection
Stas Bekman writes: Luckily Matt has got sick of waiting for someone to work on the advocacy of mod_perl and he has just taken over it. Having a good informational site is good, but it's not enough. We need to solve the problem of people to find this site and wanting to use mod_perl. Solution? Spreading the word. I picture only 10% of people who build web sites ever needing to use mod_perl directly. I think they're more likely to use the systems that are built *in* mod_perl, like Mason, AxKit, and so on. If there's a with a lot of information about building web sites with those systems, then you'll make people happy. I'm an editor at O'Reilly now, for those who didn't know, and I am *very* interested in a book on building websites with mod_perl technology. That's not the mod_perl book, nor the mod_perl guide, but a book on using Mason and AxKit and the other solutions to build bitching dynamic websites. Anyone interested, contact me ([EMAIL PROTECTED] or [EMAIL PROTECTED]). 1) Online zines. The O'Reilly Network is one place to push this. In January sometime there'll be a new site launched that will be perfect for this type of content. I'll let you know more closer to the date, when *I* will know more. The mod_perl advocacy site should have RSS summaries available so that updates can go into the Meerkat system (meerkat.oreillynet.com). That will also raise the image. Announce the site (I think modperl.com or perl.apache.org should be the advocacy site, which contains a pointer to the tech docs) in TPJ and via the Perl News (news.perl.org). ApacheWeek should mention it. Nat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RFC: mod_perl advocacy project resurrection
Paul writes: Any idea what it would take to get a link there from webs like tpj and Perl.com? Those two I can easily make happen. Send me email saying what you want a link to, and what you want the link to say. Writers for perl.com are always wanted. Pitch your article ideas to [EMAIL PROTECTED] and he'll work with you to make the good ones happen. Nat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sponsoring advocacy
Stas Bekman wrote: Well, here comes a different question. Most of us have very limited resources on helping the project. The best scenario is when someone is doing mod_perl coding for his tasks at work and contributes back. But we are talking about things that require more than that. We need people with time on their hands to do this different work (articles/sites/packaging/apps/etc). But it's a time consuming thing, and many prefer to have some well deserved rest than work for free, even if they love mod_perl. So here is the question: Will you or your company support a few people to do full/part time advocacy which involves talking, coding, helping, and a lot more. Imagine that we create a group of people who will indirectly benefit your business by creating the man power (teaching), hype and acceptance by those who make decisions (media), knowledge base (articles and cookbooks), more extended help/support at the list level and of course making the product itself better thru coding. I'm interested to know two things: 1) whether there is an interest to sponsor such an endeavor. 2) whether there are people interested to do the work. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sponsoring advocacy
Nathan Stitt attmpted to write: Stas Bekman wrote: Well, here comes a different question. Most of us have very limited resources on helping the project. The best scenario is when someone is doing mod_perl coding for his tasks at work and contributes back. But we are talking about things that require more than that. We need people with time on their hands to do this different work (articles/sites/packaging/apps/etc). But it's a time consuming thing, and many prefer to have some well deserved rest than work for free, even if they love mod_perl. So here is the question: Will you or your company support a few people to do full/part time advocacy which involves talking, coding, helping, and a lot more. Imagine that we create a group of people who will indirectly benefit your business by creating the man power (teaching), hype and acceptance by those who make decisions (media), knowledge base (articles and cookbooks), more extended help/support at the list level and of course making the product itself better thru coding. I'm interested to know two things: 1) whether there is an interest to sponsor such an endeavor. 2) whether there are people interested to do the work. !#@$! Mozilla! I really did type text in my earlier reply! Perhaps that's what they mean when they say, 'This browser is a beta, it may eat your email'. Actually was a build from about a week ago, and untill now has worked fine.. gobbles memory like crazy, but not too crashy. And here I was doing so good staying out of non-free with debian. My apologies for wasting everyone's time/bandwidth on my earlier useless post. As I said before mozilla screwed the pooch on me, Stas, I (and I hope many others) would be glad to help with whatever task need to be done to ensure mod_perl keeps/gains mindshare. To be honest, I had never really given a thought to what might happen if mod_perl loses mindshare to php or java. Although to be honest, I've never considered php worth worrying about, as I've found it a fine language for smaller sites, (and a horrible one for larger ones IMHO). What gives me the willies is some day waking up and not being able to find work except using java servlets, or horrors .asp. In my opinion, what we all need is a leader(s) who can plot out a plan for web domination, put it up for critiques and flames, revise according to the well thought out critiques and then parcel it up in small sections for people to claim ownership off. As you allude to, the small parcels of work would not be all code, and therefore there would probably be work for any skill level above rank newbie. (and they can still test the user friendlyness of it). As I said before I really hadn't thougth much about the need for mindshare before today's long thread, so am still not sure how I can contribute, but would definatly be willing to help compile a list simular to what I outlined above, and grab a few jobs off it. Of course choosing said leader(s) is the tricky part! I have no idea how to go about that. However if someone with suitable stature could come up with the plan, they could perhaps get a critical mass of developers to follow. As to a paying position hacking opensource mod_perl, that would be great and probably pretty close to my dream job, but I'm not holding my breath on a company picking up the tab in that fashion, and I don't think we need to wait for it to happen either. Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Putting together the TPC mod_perl track
Stas Bekman writes: Sorry about not mentioning all the other speakers who have added to the YAPC fun. Nat was there, so we will make sure to bring at least a little of this fun to TPC. I know that people pay a lot of money to attend TPC, compared to YAPC, but I doubt that people would complain about a few laughs. Nat? Laughs, yes. Chaos, no. The Perl Golf from this year taught me that. Chaos works well at a YAPC. People get tetchy about it when they pay TPC rates for a conference. Nat
Re: Putting together the TPC mod_perl track
Matt Sergeant writes: Since its getting towards the end of the year, should we be thinking of putting together a mod_perl track for TPC? I've got a room allocated to mod_perl for two days of conference at the next OScon. With this group's blessing I'd like to call it "the mod_perl conference", as nobody else is offering mod_perl this kind of exposure. It'll be mentioned in TPC advertising, but it won't be a Perl or Apache track of the conference: it'll be labelled and promoted as mod_perl only. The low-hanging fruit (obvious topics) will be: * Doug MacEachern on mod_perl 2 * Matt on AxKit (also likely to make an appearance in the XML track) * Brian on AO (please please dark gods let AO come to fruition) * talk(s) on how to do good things with Apache::ASP * mod_perl + backhand = ass-kicking * Tips for developing or tuning HTML::Mason sites * Case studies showing how big companies use mod_perl This latter is an important part of the Perl conference. Many companies who would never 'fess up to using Perl seem quite happy to send employees to speak at conferences. Their talks end up as a big advertisement for Perl, and lets us name-drop the company as a Perl user. I see no reason why the same shouldn't happen with mod_perl. Nat
Re: Putting together the TPC mod_perl track
I wrote: I've got a room allocated to mod_perl for two days of conference at the next OScon Man, that'll teach me to open my big mouth :-) OScon is O'Reilly's Open Source Convention. Next year it will be in San Diego. See http://conferences.ora.com/ for a link to this year's OScon. OScon has several tracks on things like Apache, Python, PHP, etc., as well as The Perl Conference. I don't have a layout or blurb for this year's convention, because we're still planning it. The layout of tracks is gelling. The CFP is supposed to go out in a week's time, a target that may or may not be reached. Nat
Re: Putting together the TPC mod_perl track
Perrin Harkins writes: I may be able to offer something on how we use mod_perl at eToys. We recently rewrote our codebase to take better advantage of mod_perl and are using some fun OO stuff, as well as a bunch of scalability tricks. I was also thinking about presenting a comparison of templating methods and modules. That'd be really cool. We'll post a CFP as soon as we know exactly what's going on. The CFP will explain just what information we want (probably title, brief description, outline, and author information). Thanks, Nat
Re: Producing an error page
-Original Message- From: Jay Strauss [mailto:[EMAIL PROTECTED]] I've tried the suggestions so far: cgi::carp http://perl.apache.org/guide/snippets.html#Redirecting_Errors_to_t he_Client BEGIN { print "Content-Type: text/plain\n\n"; *STDERR = *STDOUT } Jay, Below is a module I wrote for doing what you want. It'll need some name changing, but the POD at the bottom should explain mostly how to use it. One feature is that you can give it a list of "developer" IP addresses that should see the Perl errors, while other people get a nice bug report form. It even works with mod_perl, but beware: once you use it on one Registry CGI, all your mod_perl CGIs handle their errors this way. I don't think I've done everything the most proper or best way but it has worked in a production environment for a year or so. I'd welcome comments or encouragement to put it in CPAN. Cheers, nathan ~~~~~ Nathan Vonnahme [EMAIL PROTECTED] http://enteuxis.org/nathan http://thethirdsector.com # $Id: CGI_errors.pm,v 1.3 1998/08/26 01:53:55 nathanv Exp $ # Enteuxis::CGI_errors # improve CGI error-reporting! Give an intelligible message to someone on a development machine, # or a bug report form to a user and an email report to $alert_email. # # see the pod documentation at the bottom for more... # # Copyright 1998 Internet Alaska, Inc. # # written by [EMAIL PROTECTED] package Enteuxis::CGI_errors; use vars qw(@ISA @EXPORT $VERSION); require Exporter; @ISA = Exporter; @EXPORT = qw(setup_CGI_errors); $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); use strict; use CGI::Carp; my $mailprog = '/usr/lib/sendmail'; my $FORMMAIL_URL = 'http://www.alaska.net/cgi-bin/FormMail.pl'; my $default_email = 'nathan\@enteuxis.org'; my @dev_machines = ( '208.151.124.132', 'inferno.infoinsights.com', ); my @warnings = (); sub setup_CGI_errors { $| = 1; my $alert_email = shift || $default_email; $main::SIG{'__WARN__'} = sub { push @Enteuxis::CGI_errors::warnings, @_ ; }; $main::SIG{'__DIE__'} = sub { my $mesg; # set $header to a valid HTTP header my $header = "Content-type: text/html\n\n"; if ( ! $ENV{REMOTE_HOST} || (join " ", @dev_machines) =~ /\b$ENV{REMOTE_HOST}\b/ ) { $mesg = "h1SCRIPT ERROR/h1\n"; $mesg .= "h2WARNINGS:/h2\nul\n"; foreach ( @Enteuxis::CGI_errors::warnings ) { $mesg .= "li$_\n"; } $mesg .= "/ul\nbrhr"; $mesg .= "h2DIE MESSAGE:/h2ulli @_/ulbr"; my($package,$file,$line) = caller(); $mesg .= "bDied/b in $package at $file line $line.\n"; print STDOUT $header . $mesg; exit; } else { my $url = "$ENV{SERVER_URL}$ENV{SCRIPT_NAME}$ENV{PATH_INFO}?$ENV{QUERY_STRING}"; $mesg = qq[ html headtitleScript Error/title/head body bgcolor=#ff h1SCRIPT ERROR/h1 Congratulations! You've found a bug! Our staff have been notified and the problem should be fixed soon.\n We'd like it if you can also send us a short description of what you were trying to do:hr form action="$FORMMAIL_URL" method="POST" input type=hidden name="recipient" value="$alert_email" input type=hidden name="subject" value="broken CGI comment" input type=hidden name="the URL in question" value="$url" Your name (optional)input type=text name="realname" value=""br Your email address (optional)input type=text name="email" value="\@alaska.net"br What were you trying to do? textarea name="comment" rows=3 cols=40 wrap="virtual"/textarea input type=submit value="mail comments" /formhr /body/html \n\n]; open ERRMAIL, "|$mailprog -t" or die "couldn't open mail pipe- $!"; print ERRMAIL "To: $alert_email\n", "From: the.web.server\n", "Subject: $ENV{SCRIPT_NAME} is broken!\n\n"; print ERRMAIL "The CGI at $url died!\n\n"; print ERRMAIL "WARNINGS:\n", join( "\n", @Enteuxis::CGI_errors::warnings ), "\n\n"; print ERRMAIL "DIE MESSAGE:\n@_
Re: ignore header_only()?
Thanks for the speedy response. You've now emboldened me to ask my second question: sometimes I see people not calling send_http_header() and yet their HTML still comes through. Does mod_perl sometimes automatically call this for you? Nat
Re: ORA conference
Ask Bjoern Hansen writes: We have a mod_perl BOF the 19th from 8-9pm (that's 20-21 for the rest of us) - http://www.oreillynet.com/pub/w/bofs.html - which means that we have to stay sober enough to at least remember what time it is while we drink VA Linux's beer. :-) http://www.oreillynet.com/pub/w/evening_events.html I tried but failed to get this changed this year. I will try harder to change it for 2001. The BOFs should be a 6:30-8:30 type of deal, rather than 8:30-late. We'll get there. Nat
Re: Apache::Session::Object
Perrin- modifying Apache::Session to support both interfaces and sending Jeffrey the patch. This is a good suggestion. I'll try modifying Apache::Session first and sending Jeff the patch. If he doesn't want to integrate it I'll package it as a separate module. -Nate
Apache::Session::Object
Hi- I've created an object interface to Apache::Session. It's a simple module that I've called Apache::Session::Object (seemed pretty intuitive) that presents the following interface: # Create new session using the default File store use Apache::Session::Object; my $session = new Apache::Session::Object; my $id = $session-session_id; # get session_id $session-{visa_number} = "4441 2001 2039 1100"; $session-param('visa_number') = "4441 2001 2039 1100"; # same # Open existing session in the DB_File store use Apache::Session::Object; my $session2 = new Apache::Session::Object ($id, {Store = 'DB_File', Transaction = 1}); print $session2-_session_id;# leading _ ok # yet another way to skin the same cat $session-visa_number("4441 2001 2039 1100"); print $session2-visa_number; Any comments on this? I wanted to write it to make a more consistent interface with the other modules. It might also make sense to integrate this with the existing Apache::Session module. The module itself is pretty simple, just playing some tricks with new() and AUTOLOAD() to provide a virtual OOP interface. Thanks, Nate
Possible mod_perl or ??? bug?
Hi all- On a totally different subject, I've been experiencing problems with the interaction between CGI::Carp and Apache::Session. I find that in a mod_perl context, if I import CGI::Carp before I import Apache::Session, then I run into the following error: [Thu Jun 29 13:14:03 2000] [error] (in cleanup) Can't use an undefined value as a symbol reference at /apache/perl/lib/site_perl/5.005/Apache/Session/Lock/File.pm line 109. This happens if I use "PerlModule" in httpd.conf or "use" in the script to import them. If you reverse the order, importing Apache::Session before CGI::Carp, then everything's ok! This also only happens under mod_perl - under a normal CGI context it works just fine. Strange. The code this is referencing is this: sub release_all_locks { my $self= shift; my $session = shift; flock($self-{fh}, LOCK_UN); --- line 109 if ($self-{opened}) { close $self-{fh} || die $!; } $self-{opened} = 0; $self-{read} = 0; $self-{write} = 0; } So something is screwing up the $self that should be passed to Apache::Session::Lock::File::release_all_locks() by DESTROY(). Since this only seems to happen when these two modules play together, it's been difficult for me to try and find what the problem is. Anyone have any ideas or see a similar thing on their systems? My config is mod_perl 1.24 / Apache 1.3.12 / Solaris 8. Thanks, Nate
Re: Apache::Config module
James- You and are are saying the same thing, just with different terminology. I agree completely. :-) -Nate James G Smith wrote: Nathan Wiger [EMAIL PROTECTED] wrote: UseCanonicalName On# = 1 UseCanonicalName Off # = 0 #UseCanonicalName On# = undef (commented out) That way, the logic in your script/module/whatever can set a default value: if ( ! defined($conf-{usecanonicalname}) ) { # not specified, set default(s) } elsif ( ! $conf-{usecanonicalname} ) { # explicitly turned off } else { # explicitly turned on } I think I would prefer it not exist in the hash if it is commented out in the config file (the same as not existing in the config file). Then UseCanonicalName On# = 1 UseCanonicalName Off # = 0 UseCanonicalName # = undef #UseCanonicalName On# = non-existant (commented out) Otherwise, we can't distinguish between the last two possibilities. -- James Smith [EMAIL PROTECTED], 979-862-3725 Texas AM CIS Operating Systems Group, Unix
Re: Apache::Config module
NW] In any case, I have several questions: NW] NW] 1. Does a module like this exist anywhere? You may want to take a look at AppConfig module. It does provide generic capability to parse various kinds of config file. But I'll be a happy user to have more spesific Apache related in this regard. Yeah, I checked out AppConfig, and I actually emailed the author about modifying it a little so I could use it as a base class possibly for Apache::Config. Unfortunately, I haven't heard anything back yet. AppConfig would be a great base class, the only problem is that: # it handles comments like this # but not like this that's the only sticking point to not being able to extend AppConfig. Hopefully I'll hear something back from him. The fix is just the addition of a \s* to a regexp. Apache::Config will be sufficient, IMHO, as later someone might write another module, say Apache::Config::Deploy, that syncronize the configuration of some httpds across some networks. Not bad - I like the idea for an extension. I'll keep plugging away on it then, hopefully the author of AppConfig will get back to me as that would help save some work, but regardless the parsing of the httpd.conf is not really that hard in and of itself. I'll use the name Apache::Config unless I hear otherwise. Thanks again to everyone who responded for their input! -Nate
Apache::Config module
Hi all- I've written a module that can parse the Apache httpd.conf config file (and in fact any Apache-like config file). It will take a set of directive like: ServerName www.mydomain.com UseCanonicalName Off And parse it case-insensitively, returning a ref to a hash: my $ac = new Apache::Config; my $conf = $ac-readconf($configfile); print $conf-{servername}; # = "www.mydomain.com"; print $conf-{usecanonicalname}; # = 0 (not undef so can test #for defined() still) I am also finishing up the ability to parse within contexts, such as Directory and Location. I am still unsure of the interface, I have two ideas: 1. multi-level hash, i.e. $conf-{"directory /"}-{sethandler} 2. individual functions, i.e. $conf-directory("/")-{sethandler} If anyone has any input, I'm all ears. Right now I'm leaning towards the second one, if I can get it working. The first one is really flexible and easy, the problem is that it's difficult to search. The second one helps with this issue, but the downside is that new functions have to be added if new Apache contexts are defined. I'm trying to play some tricks with the AutoLoader ala Shell to get new functions defined on the fly. If anyone has good ideas for a better interface, I'd also like to hear them. In any case, I have several questions: 1. Does a module like this exist anywhere? I saw Doug's Apache::httpd_conf, but this only takes care of writing a very minimal config file. I looked thru all the Apache:: modules but didn't see one. 2. Is the name Apache::Config a good name for this module? It seems like the obvious choice to me, and doesn't look like it's taken. I've also played around with Apache::ConfigFile and Apache::ReadConf, either of which I'm open to as well (or other suggestions?). I'm aware of the Apache and Apache::Constants modules, which do provide Apache API methods for getting to this data that work great for mod_perl. My goal with this module was to make it general enough to be used to parse any Apache-style config file. That way, if you wanted (a) write a CGI script outside of mod_perl that used httpd.conf data, or (b) wrote a custom (maybe non-web) app that used an Apache-like config file, you could get at the data quickly. In this way it would be like Apache::Session, where it can work either in a CGI or mod_perl context. Thanks for your help and input. -Nate
Re: Apache::Config module
James- You might want to reconsider the usecanonicalname setting. The hash element should exist if and only if it appears in the configuration file. It should be defined if and only if it has an argument in the configuration file. Thus, the following results: UseCanonicalName results in $conf-{usecanonicalname} == undef UseCanonicalName Off results in $conf-{usecanonicalname} == 0 Then use existance in the hash array to test existance in the configuration file. You may have already been thinking along this line. If so, then I'm only clarifying a point... You're exactly right - that's why I make a distinction between 0, 1, and undef, so: UseCanonicalName On# = 1 UseCanonicalName Off # = 0 #UseCanonicalName On# = undef (commented out) That way, the logic in your script/module/whatever can set a default value: if ( ! defined($conf-{usecanonicalname}) ) { # not specified, set default(s) } elsif ( ! $conf-{usecanonicalname} ) { # explicitly turned off } else { # explicitly turned on } This lets you default to any value you want (on or off). Does this help clarify? Regarding this: Perhaps 3. multi-level hash, i.e. $conf-{directory}-{'/'}-{sethandler} This is, afaik, more in-line with what the Perl.../Perl sections do. I would suggest making it so the output of this module could easily be fed into the mod_perl configuration engine in the Perl sections. This gives us the ease of the second example with the programming simplicity of the first (i.e., no new functions). I actually like this alot. My question would be how to parse something that didn't have one element, or that had multiple ones, for example I can envision: Perl /Perl SomeContext "/a" "/b" /SomeContext The first one exists, while the second one is (as far as I'm aware) only theoretical. However, should they be solved as: $conf-{perl}-{somesetting} $conf-{somecontext}-{'/a'}-{'/b'}-{somesetting} Input??? I just want to plan this out from the start so that as things are added later the syntax and/or structures don't get unwieldy. I don't want to change the "API" to such a module once it's out there. Thanks again for the feedback. -Nate
Re: gensym()
Matt Sergeant writes: Nope, but often I do use the TomC "my $fh = do { local *FH; };" method, because I hate those ugly HANDLE capital letters everywhere - they use up more bytes than lower case ones... ;-) When you have 5.6.0, it's even easier: my $fh; open($fh, " foobar") or die; # $fh autovivified to a filehandle Whee! You can even use the 3-arg open for maximum delight. Nat
Re: [summary] holding a mod_perl conference
Stas Bekman writes: Therefore a possible solution, as offered by both conference organizers, is to have a dedicated mod_perl track this summer in Monterey and in Close, but not quite. It's too late to adjust the July 2000 conference (layout was finalized around March 1), but we are all systems go to have a separate mod_perl track in 2001. Can't wait. Nat
Re: [RFC] holding a mod_perl conference
I guess I'm not sure why mod_perl needs a conference of its own. Would a mod_perl track as part of the O'Reilly Open Source Conference work for you? That way you wouldn't need to kill a member of the community by pushing organization onto them, as O'Reilly's (excellent) conference organization folks can do the hotels, A/V, catering, and other logistics. Nat
Re: [RFC] holding a mod_perl conference
I said: I guess I'm not sure why mod_perl needs a conference of its own. Would a mod_perl track as part of the O'Reilly Open Source Conference work for you? That way you wouldn't need to kill a member of the community by pushing organization onto them, as O'Reilly's (excellent) conference organization folks can do the hotels, A/V, catering, and other logistics. And if this isn't acceptable, I could always have a word in the O'Reilly folks' ears about having a mod_perl conference as a standalone event, at a different time and place from the Open Source conference. The problem with standalone conferences is that you need to have reasonably high attendance before they pay for the logistical work and equipment hire needed to put them on. "Reasonably high" could be anywhere from 200 to 500 depending on the hotel, speakers fees, tutorial attendance, number of parallel tracks, etc. It's much less ambitious to start with a track or two devoted to mod_perl at the Open Source conference, and then fork it off into a separate conference if the attendance at those tracks shows there's the interest to justify it. Nat
Re: [RFC] holding a mod_perl conference
Jeff D. 'Spud (Zeppelin)' Almeida writes: 1) I don't think getting 200 people to attend a mod_perl conference is particularly ambitious at all, especially if it's held in a manner convenient for people to attend. 20,000 people went to Linux World in New York, and it wasn't THAT great of a show If you hold a conference where you already have a fairly thick concentration of mod_perl developers, and you get the right people to speak, people WILL come. Right, I think 200 people is very do-able. I think you're fooling yourself if you think that Linux World is anywhere comparable to a mod_perl conference. It's beyond apples and oranges. It's peas and watermelons. 2) What people are saying isn't that we want a huge, IDG-ish production with tracks and a tradeshow floor and catered water and soundsystems and skirted tables. Several people have said they would rather have something along the YAPC model... a small, productive session, perhaps better suited for the conference facilities of a University than those of a hotel. If ever there was something calling for the "KISS" mantra, it was this con. :) Right. But I'm saying that putting on a YAPC conference blows the organizer's mind. Kevin Lenzo, the YAPC organizer, had to worry about food, tracks, sound systems, projectors, rooms, accomodation, and printed proceedings. These problems didn't go away because YAPC was on a smaller scale, and in some ways they became more of a problem because there was one person doing the organization and he had to handle it all. I'm not saying that a YAPC-style conference can't be done, I'm just saying that it's not as easy as it sounds. Would we appreciate logistial support from O'Reilly? Of course. Do we want this con to be large enough to have to worry about revenue models? Not particularly. Actually, O'Reilly is pretty mellow about revenue too. They're willing, unlike a lot of companies, to put in time building and promoting conferences. They don't expect wild successes initially. I know this because of my work with them on the Perl conference, which has certainly never been a cash cow. I'm not forcing an O'Reilly conference on anybody, and I don't even have the authority to promise it. I just have the ears of the right people and could suggest that they work with the mod_perl community to put on a conference. Frankly, I think your Route of Least Pain (coincidentally also the Route Most Likely to Succeed) is to have separate mod_perl tracks at the Open Source conference. You'll get rooms dedicated entirely to mod_perl, you (or Doug or whoever the program chair is) can put whatever talks you want in there, you can have your own tutorials. You can even have a room during tutorials for the folks *behind* mod_perl (Doug, Staks, Vivek, etc.) to meet and hammer out future directions and development issues. When I spoke with the conference folks last week, they were keen to get more into helping the developers of the open source tools meet and plan. There was a some-random-java-technology developers meeting at the O'Reilly Java conference, where the folks writing the code that others use got to meet and iron out tricky issues. They had a recorder, whiteboards, the whole nine yards. I'm sure that such a track might even be called a conference in the materials, if you wanted that cachet. Ok, I'm going to shut up now unless people actually ask me a question. I'm sure you all think I'm some kind of O'Reilly stooge. Nat
Re: [RFC] holding a mod_perl conference
Jason Bodnar writes: I guess my big problem with the ORA conference last year was that all the tutorials I attended last year tried to cover the basics and didn't lead enough time for in-depth informaiton. Yup, I agree. The level of the material offered, though, is in the hands of the program chair. So when I put together the Perl conference tutorials, I try to make sure that at any one time there's something that *I* would like to see, as well as something that a less advanced (more intermediate) programmer might want to attend. So this year there's Damian Conway's "making your mind go boom with OO in Perl" talks, as well as MjD's hardcore Perl. The modperl program chair could decide to have a "how to get started" tutorial as well as a "popping the hood and attacking the transmission with a wrench" tutorial. In fact, I hope that'd happen. In some ways the program chair is limited to the tutorials that people offer: if nobody is interested in giving a tutorial on pushing Mason to its limits, it can't be offered. By the way, now's the time to start thinking of topics and tutorials and other material for the 2001 conference. The earlier the program chair can start hounding folks for talks and tutorials, the better. Nat
Re: [RFC] holding a mod_perl conference
Jeff D. 'Spud (Zeppelin)' Almeida writes: I don't know why it is that we (as a computer industry) feel compelled to attach grossly overinflated registration fees to our professional meetings, but the ones that don't have them (like YAPC) tend to be better-appreciated. The registration fee is set based on the costs of producing it. TPC has higher marketing, organization, and execution costs than YAPC did. TPC could then afford to help speakers get to the conference--many of the more remote Perl gods were helped with their travel to the early TPCs. YAPC is cheaper, and is fun in its own right, but it was a completely different experience to TPC. Both, IMHO, were fun. YAPC was more intimate and I had the feeling of excitement that it was being done on the wire by folks just like me. At TPC I enjoyed the crowds, the huge variety of people I could talk to, the ability to sit back and put myself in someone else's hands, the resort atmosphere. One wasn't, I don't think, better than the other. They both pleased me in different ways. The easiest way to avoid the Open Source Conference registration fee is to be a speaker. I really strongly encourage *everyone* who does fun and interesting mod_perl things to submit proposals for talks and tutorial to the next conference. Speakers and tutors are comped registration. Tutors even get *paid*. Imagine: being paid to fly to Monterey in July and hang out with a bunch of mod_perlers Nat
Re: [RFC] holding a mod_perl conference
Leslie Mikesell writes: personal styles of perl coding are involved. It would be nice if some outlines/slides of the material could be online before the signup deadlines and the actual session could spend more time in discussion and question/answer than covering the overview. (getting away from mod_perl here, sorry) We hear and obey. This year's conference has quite detailed descriptions of the tutorials. For example: Apache::ASP Joshua Chamas Tuesday, 7/18/2000 at 8:45 AM Who Should Attend: Web developers who have used CGI.pm, mod_perl, or IIS/ASP; and Web designers who want to make their sites dynamic. A basic understanding of Perl, object oriented Perl, and HTML would be helpful. Learn how to build a full-featured Web site with Apache::ASP, exploring the ins and outs of mixing HTML with Perl; session user tracking and logins; ASP Web events; SSI include code modularization; object methods and banner serving; performance tuning; Web clustering; and XML rendering embedded with HTML Perl. Course Outline: Syntax(creating a live Web page by embedding Perl into HTML) User tracking Events (Making a Web site more like an application) Modularity Objects Performance tuning Web clustering XML and Apache::ASP Future of Apache::ASP I encourage tutors to leave more time for QA, but that's up to the individual tutor's discretion. Nat
Re: [RFC] holding a mod_perl conference
Gunther Birznieks writes: Of course that brings us to the question as to whether OReilly Perl conference is really giving people the depth in what seems to be an increasingly popular reason for using Perl: mod_perl. If you want to do a tightly focused Apache::Mod_perl conference, then, I would tend to think it would be cool to have a mod_perl specific track rather than bundling it with another track. Hi, I work with O'Reilly on the Perl Conference, and advise them on the other tracks and general structure of their conferences. Thanks for the kind words about the Open Source conference and the Perl Conference. I've been pondering the mod_perl thing too. The attendance figures for the Perl conference last year were down about 200 people, but those numbers are deceptive because of the conference situation. First I think we lost some people because of the move to Monterey, but I really doubt it was that big. The big cause of smaller numbers is that the down-by-200 number is reached by asking attendees "which track are you here for?" and 200 fewer people said "Perl" in 1999 than attended the Perl Conference in 1998. But mod_perl was bundled with The Perl Conference in 1998, whereas in 1999 they were counted separately. I think they're beautifully complementary subjects. I've though a little about a separate mod_perl track at future conferences. The big problem I see is that then the Apache conference doesn't have mod_perl in it. People who turn up to that will be exposed to PHP, Java jerklets, Active Spooging Pages, and all the rest, but not to Perl. And that makes me nervous. Perhaps the best solution is to have the Apache track contain a room (two? rooms are tight, perhaps only one) dedicated just to mod_perl. It could be geographically situated so it's between the rooms used for the Perl conference and the rooms used for the Apache track. We might even be able to find some labelling gimmick such that it appears as a part of both the Perl conference and the Apache tracks. ANYTHING you wanted to about Perl (which was great idea) -- the only problem with last year is that they shoved the Guru Is In sessions into some side office building that was hard to find (for my first time anyway). We definitely got scorched for this in the feedback. To some degree we're at the mercy of the hotel layout: if there isn't a small room available, we can't justify sacrificing a track and using a 150-person room for the guru sessions. The rooms are reconfigurable to some degree, with the air walls, but the basic problem is geographical. I know that the conference folks are aware of it, though, and will be working hard to avoid a repeat. Similarly, the papers room at the Perl conference was isolated, and we're going to try to avoid isolating anyone this time around. Nat