[ANNOUNCE] Apache::App::Mercury (new module)
This is a new application for mod_perl - just released. Apache::App::Mercury is a customizable, extensible customer to customer, store and forward messaging application for Apache mod_perl (1.x). It uses a relational database (accessed via DBI) to store and retrieve messages, and uses CGI.pm to display them in standard HTML. It's design closely resembles a MVC design pattern, and it handles all message box navigation, message composition, sending, replying, etc. In short, it is a complete web (intra server) messaging application for your Apache mod_perl server, which can be customized to fit your specific needs (e.g. private labelling). At the moment, installation has quite a few steps. Sorry about that. I tried to make it as simple and straightforward as possible, but the complexity is necessary since it needs to tie into your existing mod_perl app. Cheers, -Adi -- The URL http://adiraj.org/sw/Apache-App-Mercury/Apache-App-Mercury-0.80.tar.gz has entered CPAN as file: $CPAN/authors/id/A/AD/ADIRAJ/Apache-App-Mercury-0.80.tar.gz size: 38372 bytes md5: 96d5369bf2ad83168ce00829c0102357 No action is required on your part Request entered by: ADIRAJ (Adi Fairbank) Request entered on: Sun, 20 Jul 2003 04:31:15 GMT Request completed: Sun, 20 Jul 2003 04:32:58 GMT
Re: [RFC] web-messaging application for mod_perl
On, or in the near vicinity of Mon, 14 Jul 2003 18:49:58 +0300 Stas Bekman [EMAIL PROTECTED] has thus written: Probably the best bet is to give it some cool unique name, like Apache::AdiChat and then you are all set, since you are not going to take over any future framework/namespaces... Well, I don't like that name, but I do get what you mean. ( I wouldn't want to have any piece of software named after me... just my personal style. Software lives for too long, especially open source. It would still be called that long after I'm dead. ) What's wrong with WebMessaging ? Do you foresee that interfering with some future software in the Apache:: namespace, or is it just too generic? I thought it was a good name since it accurately describes what it is: not webmail, not instant messaging, but web messaging. (basically, it's like those message boxes you get on a stock trading website when you login to your account) Here are the possibilities: 1 Apache::WebMessaging 2 Apache::App::WebMessaging 3 Apache::SomeOtherUniqueName (e.g. ServerMessaging, or UserMessaging, or SystemMessaging) I personally prefer 1 or 2, so if there are no serious objections, I'll pick one of those. Let me know which you like the best. -Adi
Re: [RFC] web-messaging application for mod_perl
On, or in the near vicinity of Tue, 1 Jul 2003 11:23:00 +0200 Enrico Sorcinelli [EMAIL PROTECTED] has thus spoken: On Mon, 30 Jun 2003 12:57:00 -0700 Adi Fairbank [EMAIL PROTECTED] wrote: Apache::WebMessaging I am about ready to release an intraserver web-messaging application for mod_perl. A brief description of the app follows; I'd like to hear some comments from the mod_perl/Perl/P5EE community on: You could look about Apache::* modules naming conventions: http://perl.apache.org/products/apache-modules.html#Module_Naming_Conventions Apache::App::WebMessaging namespace could be a right place :-) According to the asterisk note below Apache::App:: However, if you are planning a substantial framework with many inter-related modules, you should probably go with a top-level namespace outside of Apache::. This app already has 7-8 inter-related modules, though I would not call it a substantial framework. In fact it requires you to already have your own application framework setup in order to use it. It's basically a plug-in application for your existing mod_perl framework. I could rename it to just WebMessaging:: but it is specifically designed for mod_perl, which is why I think it should go in Apache::. Also, I noticed there are currently no Apache::App:: modules. Should this be the first?? -Adi
[RFC] web-messaging application for mod_perl
Apache::WebMessaging I am about ready to release an intraserver web-messaging application for mod_perl. A brief description of the app follows; I'd like to hear some comments from the mod_perl/Perl/P5EE community on: * is there anything like this already out there? * namespace suggestions (if Apache::WebMessaging is undesirable) * where and how to integrate it into the p5ee project (e.g. P5EEx::Blue::Messaging::WebMessaging ?) * general comments, questions? This software was started as a way to deliver automatic server-generated messages to users of a commercial web application. It was running on our production webserver for a few years, so could be deemed commercial-quality (whatever that means.. good or bad?). It has since been completely rewritten into a form more suitable for general use in the open-source community. It has support for attachments and outbound e-mail forwarding (via smtp). It dynamically generates HTML using CGI.pm, using basic HTML v3 forms for user interaction. It is entirely modular and component-oriented, so can easily be private-labelled or embedded in another application. The design is fairly similar to MVC architecture. It stores messages in a DBMS using DBI, and attachments on a filesystem with a reference in the database table. It has an object-oriented Perl API so message delivery can be triggered from either inside a running mod_perl server or from a standalone app (e.g. another daemon or a cron job). User-to-user messaging is supported through the standard web interface. My motives for releasing it open source are: * to advocate mod_perl * to attract developers to help improve the software, especially by adding extensions (e.g. inbound SMTP, pgp, gpg, jabber, alternate backing stores, interfacing with standard mailbox types: mbox, Maildir, etc) If you want to play with it before I release it to CPAN, you can get a copy here: http://adiraj.org/sw/Apache-WebMessaging/Apache-WebMessaging-0.80pre1.tar.gz TIA for any comments, -Adi
Re: Few Important Questions
On, or in the near vicinity of Wed, 18 Jun 2003 18:34:09 -0700 (PDT) Mustafa Tan [EMAIL PROTECTED] has thus spoken: Another question is that, why hosting guys avoid using mod_perl. Is it just because mod_perl is memory hungry? One reason I've heard is because of namespace security issues. Ie. if ISPs allow all their users access to mod_perl on the same Apache server, then any user can potentially interfere with/have access to other users' mod_perl modules. Don't know if this is a really valid reason (it seems with Apache::Registry this would not be a problem), it's just something I've heard. Has anyone in the mod_perl community given namespace security much thought? Finally how can I dynamically ban an ip address in mod_perl. For example, normally you can specify certain ip addresses with Allow, Deny directives. How can I do that dynamically using mod_perl. You would need to write your own AuthzHandler, and specify it with a PerlAuthzHandler directive in your Apache conf file. See the mod_perl docs/guide/books etc. Very briefly, you'll want to do something like: package My::IPFilter; use Apache::Constants qw(:common M_GET FORBIDDEN REDIRECT); sub ip_filter { my ($class, $r) = @_; my $ip = $r-connection-remote_ip; my @banned_ips = ('w.x.y.z', 'a.b.c.d', ...); if (grep($ip eq $_, @banned_ips)) { return FORBIDDEN; } return OK; } Then, in your httpd.conf: Location /secure_uris SetHandler perl-script PerlAuthzHandler My::IPFilter-ip_filter /Location This is a very minimal example of what you need, just to get you started in the right direction - you should consult the docs to get you further. You may want to use require statements in your conf file, in which case you'll need more than that. I recommend Apache::AuthCookie as it has good builtin support for custom require methods in mod_perl. -Adi
full-featured online database apps
Does anyone know of a good customizable, user-friendly, online database application, preferably mod_perl-based? I want to migrate a small Access database to MySQL with a web interface, for added features and room for growth. Has anyone come across a good open source project or toolkit that would make this job really easy? TIA, -Adi
Re: full-featured online database apps
For example, what I'm looking for are other projects similar to Gedafe: http://isg.ee.ethz.ch/tools/gedafe/ but maybe with a more customizable front-end. -Adi
Re: loss of shared memory in parent httpd
Yes, this is my theory also. I figured this out a while back, and started a thread on this list, but since then haven't had enough time to investigate it further. The thread is here: http://mathforum.org/epigone/modperl/wherdtharvoi which includes some helpful hints from Doug on how to call mlockall() from the mod_perl parent process. HTH.. I'm very curious to know if this works. -Adi Ed Grimm wrote: I believe I have the answer... The problem is that the parent httpd swaps, and any new children it creates load the portion of memory that was swaped from swap, which does not make it copy-on-write. The really annoying thing - when memory gets tight, the parent is the most likely httpd process to swap, because its memory is 99% idle. This issue aflicts Linux, Solaris, and a bunch of other OSes. The solution is mlockall(2), available under Linux, Solaris, and other POSIX.1b compliant OSes. I've not experimented with calling it from perl, and I've not looked at Apache enough to consider patching it there, but this system call, if your process is run as root, will prevent any and all swapping of your process's memory. If your process is not run as root, it returns an error. The reason turning off swap works is because it forces the memory from the parent process that was swapped out to be swapped back in. It will not fix those processes that have been sired after the shared memory loss, as of Linux 2.2.15 and Solaris 2.6. (I have not checked since then for behavior in this regard, nor have I checked on other OSes.) Ed On Thu, 14 Mar 2002, Bill Marrs wrote: It's copy-on-write. The swap is a write-to-disk. There's no such thing as sharing memory between one process on disk(/swap) and another in memory. agreed. What's interesting is that if I turn swap off and back on again, the sharing is restored! So, now I'm tempted to run a crontab every 30 minutes that turns the swap off and on again, just to keep the httpds shared. No Apache restart required! Seems like a crazy thing to do, though. You'll also want to look into tuning your paging algorithm. Yeah... I'll look into it. If I had a way to tell the kernel to never swap out any httpd process, that would be a great solution. The kernel is making a bad choice here. By swapping, it triggers more memory usage because sharing removed on the httpd process group (thus multiplied)... I've got MaxClients down to 8 now and it's still happening. I think my best course of action may be a crontab swap flusher. -bill
[ANNOUNCE] ApacheBench 0.62 released
In my ongoing effort to bring the ApacheBench module up to date with the ab distributed with Apache, here is another release. This one mainly incorporates * support for HTTP Keep-Alive feature, * support for HTTP HEAD requests, * global and per-run time limits, * accurate tallying of sent, good, and failed requests (previously these were fudged) * a few small bug fixes. Please see the Changes file for complete details. Happy benchmarking! -Adi
[ANNOUNCE] ApacheBench 0.62 released
In my ongoing effort to bring the ApacheBench Perl module up to date with the ab distributed with Apache, here is another release. This one mainly incorporates * support for HTTP Keep-Alive feature, * support for HTTP HEAD requests, * global and per-run time limits, * accurate tallying of sent, good, and failed requests (previously these were fudged) * a few small bug fixes. Please see the Changes file for complete details. Happy benchmarking! -Adi
Re: Apache Bench
I got an e-mail a while back from one of the CPAN testers that my Perl API version of ApacheBench worked on Cygwin. I don't know how that compares to straight NT/2000, but you might try compiling ab with Cygwin. Since my code is based on ab, in theory ab should also work on Cygwin. You could also just use the my Perl version of ab which has most of the same functionality as ab. Let me know if it works for you. -Adi Joshua Chamas wrote: Last I checked, ab which comes with Apache, had not yet been ported to NT/2000 officially. However, there does seem to be a port available here: http://www.remotecommunications.com/apache/ab/ Upon testing their precompiled version however, I found that that it doesn't seem to work too well, in that it can only do some 1 request per 4 seconds :( -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [challenge] new mod_perl site
Nick Tonkin wrote: No one doubts your commitment to mod_perl, or your hard -- and unpaid -- work on the guide and many other things. But if you want to be a leader who inspires people to collaborate and work as a team under your direction, you'd do well to work on bringing your people skills up to par with your technical skills, IMHO. Have a nice day :) -nick Personally, I think Stas is a doing a fine job as a leader. Even if he is getting paid now, I'm sure he is still *under* paid for what he's doing. Most of us don't even notice all the things he is doing behind the scenes. Remember he is juggling many tasks now, whereas most of us only contribute a single piece of the puzzle. With a single polite e-mail he inspired me to bring the ApacheBench module up-to-date, which had gotten way out of date (from the newest ab) due to my laziness. BTW Stas, the next update with Keep-Alives is almost ready. Next will be authentication and proxy support, then SSL support. my 2c. -Adi -- We are Linux. Resistance is an indication that you missed the point.
[ANNOUNCE] ApacheBench 0.61 released
I've released a new version of ApacheBench, the Perl API to Apache's ab tool with added features that make it usable for regression testing as well as benchmarking. I am trying to keep up (catch up) with Apache's work on ab, so expect more releases soon. changes since 0.60: * bugfixes: - fixed a segmentation faults that occurred when custom Content-type: headers were used - fixed bug that prevented Host: lines to be read by server, which broke requests to virtual hosts * better error checking to eliminate configuration related segfaults * arbitrary headers can now be added to HTTP requests * removed 512 byte hard-coded maximum size of HTTP requests; now requests can be arbitrarily large * all HTTP requests are now stored and accessible via regression methods * improved documentation Have fun! Adi -- The uploaded file ApacheBench-0.61.tar.gz has entered CPAN as file: $CPAN/authors/id/A/AD/ADIRAJ/ApacheBench-0.61.tar.gz size: 54512 bytes md5: ea5c2e1ff8c1c455917bcad8b5d725e6 No action is required on your part Request entered by: ADIRAJ (Adi Fairbank) Request entered on: Tue, 23 Oct 2001 04:20:01 GMT Request completed: Tue, 23 Oct 2001 04:21:15 GMT Virtually Yours, Id: paused,v 1.74 2001/05/20 14:59:52 k Exp k
Re: [OT] Re: DB_File needs compatible versions
I had this problem also with redhat 7.1, and I fixed it the same way. I believe it is caused by loading two different versions of the same shared object into the Apache webserver. In my case, I was loading one version (db2) of berkeley db with: LoadModule db_auth_module modules/mod_auth_db.so and then a different version with DB_File.so inside mod_perl. If you leave the /usr/include/db.h pointing to db3/db.h when you compile DB_File, it results in a version 3 DB_File.so object. Another solution would probably be to comment out the LoadModule statement in your .conf. But that would only work if you don't need it for anything. -Adi [EMAIL PROTECTED] wrote: I have seen this one before, you will have to recompile DB_File.pm. Maybe someone can shade some light of why this happen, anyways here's how I fix it. 1) I changed the symlink of db.h under /usr/include (btw, I'm using redhat 7.1) and point it to db2/db.h i.e. lrwxrwxrwx1 root root8 Jul 12 11:05 db.h - db2/db.h 2) untar the source of db_file.pm and modify the config.in file - change the value of INCLUDE to /usr/include - change the value of LIB to /usr/lib - change the value of DBNAME to -db2 3) save and compile, install the source. -I have choose to use BerkelyDB 2 instead of 3, since I still have some berkely db file generated with BerkelyDB2. -I am not completely sure if this will cause any harm to the system (especially the symlink part), but so far, everything works just fine for me. Good luck. Tor. Robin Berjon wrote: On Tuesday 02 October 2001 20:19, [EMAIL PROTECTED] wrote: When I go to start apache with my startup.pl file it fails and says DB_File needs compatible versions of libdb db.h you have db.h version 3.1.17 and libdb version 2.4.14 Go to http://www.sleepycat.com, grab the latest BerkeleyDB, install it, re-install the Perl module DB_File, and try again. It's likely that RH messed these up somewhere. Otherwise, check that your includes and library paths are in sync (some versions of BerkeleyDB use different paths). -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Radioactive cats have 18 half-lives.
Re: [OT] New Micro$oft vulnerability?
I wish someone would just write a worm that would put these IIS machines out of their misery and stop causing the rest of us such a headache. Nick Tonkin wrote: Sorry for the off-topic post; there was a lot of discussion here of CodeRed and Reuven's module to report attempted attacks. Since this a.m. I have had hundreds of requests like: /scripts/root.exe?/c+dir /MSADC/root.exe?/c+dir /c/winnt/system32/cmd.exe?/c+dir /d/winnt/system32/cmd.exe?/c+dir /scripts/..%5c../winnt/system32/cmd.exe?/c+dir /_vti_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir /_mem_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir etc. They seem to come in batches of a dozen or more with slight variations in the URI requested. I am thinking about adding support to CodeRed.pm (which should probably be renamed if so) to report these attacks via e-mail in the same way it does for CodeRed. Any interest in that? Or any info on these bogus requests? ~~~ Nick Tonkin
Re: Callback called exit. x 100000
I had this problem a while back and it turned out to be an infinite loop in my code. I found it by writing in better logging mechanisms which pinpointed exactly where the infinite loop was. HTH, Adi Christoph Bergmann wrote: Hi... I have a problem with an apache_mod_perl-server which flushes the httpd.error_log-file with the following lines: Attempt to free unreferenced scalar during global destruction. Attempt to free unreferenced scalar during global destruction. Attempt to free unreferenced scalar during global destruction. Attempt to free unreferenced scalar during global destruction. Out of memory! Callback called exit. Callback called exit. Callback called exit. Callback called exit. Callback called exit. Callback called exit. Callback called exit. Callback called exit. ...etc. The last line Callback called exit. is repeated a million times until the whole disc is full. It happens from time to time, I can't say when. Maybe it has something to do with heavy load, the webserver has about 10 hits / second, in peak times more. I'm not sure it has _definitely_ something to do with mod_perl, but I guess so, because of the Attempt to free unreferenced scalar during global destruction. lines before... Does anybody know what happens here and what to do? Thanx in advance! Best regards, Christoph Bergmann
Re: Apache::Session::File and free memory weirdness
Perrin Harkins wrote: Odd thing #1: As it gets into evening time, load on the machine drops off and there are fewer httpd children running, but I am not seeing free memory return to that 1.3GB level. At most it comes back up to 400MB or so. I don't think the httpd children are hanging on to memory, because they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and none of the processes are ever more than a couple minutes old when I look in. Is there any reason to think the parent httpd process would hang on to anything? I have noticed that over time the new processes will spawn with less memory shared. I'm not sure exactly why this is, but it does seem to happen. A nightly complete restart of the server will reset things, but you may not have that option. I have noticed this also. I have a theory about its cause, but I haven't had the free time to hack with it yet. My theory is that when the VM subsystem swaps pages of the mod_perl parent process, those pages become forever unshared (even after they return to memory from swap). So I was going to test the mlockall() Linux system call to see if it made a difference. (Search the archives for mlockall). However, I am using the Linux platform - the VM behavior may be totally different on Solaris. If anyone else has some time to play with mlockall() on Linux, I'd like to know the results. It'll be a few more weeks till I get a chance. -Adi
Re: ODBC for Apache
Joshua Chamas wrote: Castellon, Francisco wrote: Hi I am running on Windows98SE, Apache 1.20, mod_perl 1.25, php 4.0.6, and have the latest Apache::ASP installed and have Activestate's Perl installed (build 626). I want to be able to access, Oracle, SQL and MSAccess databases as well as a couple of other Databases that support ODBC. I want to access these DBs from my apache server. What do i need?? DBD::ODBC is your ticket, running under DBI http://dbi.symbolstone.org/ You can probably install DBD::ODBC for Activestate perl with the ppm installer, as they will likely already have compiled it for you. Apache::DBI is installed with CPAN. What's the stability of DBD::ODBC like? It claims to be alpha software. Does anyone have any experience with it in a production environment? Is it at least stable with MS SQL server? -Adi
Re: swapping of mod_perl parent process / mlockall()
Doug MacEachern wrote: On Tue, 26 Jun 2001, Adi Fairbank wrote: If this is the case, it would be helpful to prevent the parent process from *ever* swapping to disk. The Linux kernel has a system call mlockall() which disables all memory paging for the current process. This sounds like exactly the recipe for preventing parent process swapping. It won't affect spawned child processes, so shouldn't pose a threat of consuming all physical memory and crashing the system. I want to play around with this, but I'm not sure where in the mod_perl source to call mlockall(). It would need to be before the parent spawns any children.. Has anyone tried using Linux's mlockall()/mlock() with mod_perl? according the manpage: Child processes do not inherit page locks across a fork. so you would need to call it in a child init handler, but: Only root processes are allowed to lock pages. Actually, I don't want child processes to inherit the page locks across a fork. I just wanted to experiment with performance issues when only the parent process is locked in memory. (I have a theory that when the parent process swaps to disk, the swapped pages become unshared for the rest of the server's life) I was hoping you could give me a hint as to where in the source code I could call mlockall(), e.g. file mod_perl.c, line NNN.. Thanks, -Adi
swapping of mod_perl parent process / mlockall()
Is it correct that when the Apache/mod_perl parent process swaps to disk, a large part of it (swapped pages) becomes unshared? Even after the kernel restores the pages from swap, do they remain unshared? So once the parent process becomes unshared, new apache children that are spawned only share the parent's pages that have never been swapped? This is what I've grok'ed from my experiments with top/GTop. If this is the case, it would be helpful to prevent the parent process from *ever* swapping to disk. The Linux kernel has a system call mlockall() which disables all memory paging for the current process. This sounds like exactly the recipe for preventing parent process swapping. It won't affect spawned child processes, so shouldn't pose a threat of consuming all physical memory and crashing the system. I want to play around with this, but I'm not sure where in the mod_perl source to call mlockall(). It would need to be before the parent spawns any children.. Has anyone tried using Linux's mlockall()/mlock() with mod_perl? -Adi
Re: Real Widgets and Template Languages
Stephen, I read your proposal and I like it a lot. I will help filling out the HTML::Widget::HTML* space (in your package structure suggestion). However, I like Gunther's suggestion for a namespace of Widget:: better than HTML::Widget::, because it will not be exclusively HTML, but WML, JS10, etc. But either one is fine with me. Sounds fun! -Adi Stephen Adkins wrote: Hi, I will step up to write this code. (if it is what I think it is) I have responded to the message by beginning a requirements document. http://www.officevision.com/pub/HTML-Widget/ Please read it and send me any comments.
Re: Real Widgets and Template Languages
Gunther, I have been interested in the concept of an HTML widget module for a while now. The reason being, my application currently generates all HTML using CGI.pm in a mod_perl handler OO-style design, and we are starting to notice patterns.. similar pieces of HTML that get generated over and over. Needless to say, componentized, reusable widgets would be very useful for us. Though I can't make the commitment of writing it myself (if I did, it would be about 6 months before you saw any code), I would definitely contribute to it, if it existed. And like you said, the hard part is getting people to write the widget objects. -Adi
Re: an unusual [job request] + taking mod_perl to the commercialworld
On Sat, 28 Apr 2001, Gunther Birznieks wrote: [text cut] So for Adi -- I think the messaging server is great and I am sure it is cool and works well. And I am sure there are people on this list who will benefit. But unless your company makes the healthcare system itself open source, then it's another application that we don't have to make people interested in using mod_perl from the application side. [text cut] The problem is that most company's that spend the time to write an app based on Java close-source that app. The same thing is true of the mod_perl world if things like Adi's healthcare system or SmartWorker's OpenDesk remain closed systems. I know that they consider it their business model to have to keep these closed source. But it also means less applications on top of mod_perl to entice the masses to it. Thanks Gunther, We actually have discussed releasing our entire application open source. I personally would love to release it, being the chief architect, but there are other people involved who have put in a lot of work (directional/advisement/guidance... not coding) who would not benefit nearly as much as I would from it being open source. Also, as a company we have to evaluate what the best option is financially. We are currently a pretty low-budget operation, and if we release it what will prevent someone with deep pockets to come along, take it, and then dump tons of money into marketing it under a different brand name? I'm sure we could devise a license that would prevent such an occurrence, but it would have to be a pretty restrictive license, which would in itself limit the interest in the software. I know releasing it open source would get plenty of interest from developers, but would it generate interest from potential customers? We concluded that it probably wouldn't make much difference since healthcare is in general way behind the technology curve. Most people in healthcare haven't even heard of Linux yet. (that may be a bit of an exaggeration, but not too much) In any case, we are still planning on releasing it eventually - to allow it to grow beyond what our in-house development crew is capable of. We really are just waiting to gain some significant market share and brand recognition in order to make it more difficult for someone to take our software and compete with us directly. We also need to rewrite parts of it and document it. I personally would be embarassed if the open source community saw certain parts of it. :-) Any comments are much appreciated. Cheers, -Adi
Re: mod_perl shared memory with MM
Sean Chittenden wrote: Is there a way you can do that without using Storable? Right after I sent the message, I was thinking to myself that same question... If I extended IPC::MM, how could I get it to be any faster than Storable already is? You can also read in the data you want in a startup.pl file and put the info in a hash in a global memory space (MyApp::datastruct{}) that gets shared through forking (copy on write, not read, right?). If the data is read only, and only a certain size, this option has worked _very_ well for me in the past. -sc Yeah, I do use that method for all my read-only data, but by definition the persistent session cache is *not* read-only... it gets changed on pretty much every request. -Adi
Re: mod_perl shared memory with MM
Sean, Yeah, I was thinking about something like that at first, but I've never played with named pipes, and it didn't sound too safe after reading the perlipc man page. What do you use, Perl open() calls, IPC::Open2/3, IPC::ChildSafe, or something else? How stable has it been for you? I just didn't like all those warnings in the IPC::Open2 and perlipc man pages. -Adi Sean Chittenden wrote: The night of Fat Tuesday no less... that didn't help any either. ::sigh:: Here's one possibility that I've done in the past becuase I needed mod_perl sessions to be able to talk with non-mod_perl programs. I setup a named bi-directional pipe that let you write a query to it for session information, and it wrote back with whatever you were looking for. Given that this needed to support perl, java, and c, it worked _very_ well and was extremely fast. Something you may also want to consider because it keeps your session information outside of apache (incase of restart of apache, or desire to synchronize session information across multiple hosts). -sc
[OT] Re: mkdir function syntax
Chriss, Please mark your subject [OT] for off-topic in the future, as this is not a mod_perl question, but a general Perl question and probably should be taken to one of the comp.lang.perl.* newsgroups anyway. In the good natured spirit of the mod_perl community, I'll answer the question anyway. replace 14 MKDIR ($makeDirectoryDocs$ProjectNumber); 15 16 MKDIR ($makeDirectoryImages$ProjectNumber); with 14 mkdir ($makeDirectoryDocs.$ProjectNumber, 0755); 15 16 mkdir ($makeDirectoryImages.$ProjectNumber, 0755); On my platform, mkdir must be lowercase, but maybe not on yours. It also requires a second MODE parameter, but likely not on the mac. You'll also need to change 22 body bgcolor="#ff" onLoad="document.location.href='categories.mch?ProjectNumber$ProjectNumber';" to 22 body bgcolor="#ff" onLoad="document.location.href='categories.mch?ProjectNumber=$ProjectNumber';" in order for CGI.pm to get your ProjectNumber correctly. -Adi
mod_perl shared memory with MM
I am trying to squeeze more performance out of my persistent session cache. In my application, the Storable image size of my sessions can grow upwards of 100-200K. It can take on the order of 200ms for Storable to deserialize and serialize this on my (lousy) hardware. I'm looking at RSE's MM and the Perl module IPC::MM as a persistent session cache. Right now IPC::MM doesn't support multi-dimensional Perl data structures, nor blessed references, so I will have to extend it to support these. My question is: is anyone else using IPC::MM under mod_perl? .. would you if it supported multi-dimensional Perl data? My other question is: since this will be somewhat moot once Apache 2.0 + mod_perl 2.0 are stable, is it worth the effort? What's the ETA on mod_perl 2.0? Should I spend my effort helping with that instead? Any comments appreciated, -Adi
Re: mod_perl shared memory with MM
Perrin Harkins wrote: Adi Fairbank wrote: I am trying to squeeze more performance out of my persistent session cache. In my application, the Storable image size of my sessions can grow upwards of 100-200K. It can take on the order of 200ms for Storable to deserialize and serialize this on my (lousy) hardware. I'm looking at RSE's MM and the Perl module IPC::MM as a persistent session cache. Right now IPC::MM doesn't support multi-dimensional Perl data structures, nor blessed references, so I will have to extend it to support these. Is there a way you can do that without using Storable? Right after I sent the message, I was thinking to myself that same question... If I extended IPC::MM, how could I get it to be any faster than Storable already is? Basically what I came up with off the top of my head was to try to map each Perl hash to a mm_hash and each Perl array to a mm_btree_table, all the way down through the multi-level data structure. Every time you add a hashref to your tied IPC::MM hash, it would create a new mm_hash and store the reference to that child in the parent. Ditto for arrayrefs, but use mm_btree_table. If this is possible, then you could operate on the guts of a deep data structure without completely serializing and deserializing it every time. If not, maybe you should look at partitioning your data more, so that only the parts you really need for a given request are loaded and saved. Good idea! That would save a lot of speed, and would be easy to do with my design. Silly I didn't think of that. I'm pleased to see people using IPC::MM, since I bugged Arthur to put it on CPAN. However, if it doesn't work for you there are other options such as BerkeleyDB (not DB_File) which should provide a similar level of performance. Thanks.. I'll look at BerkeleyDB. -Adi
Re: [ANNOUNCE] Apache::SOAP 0.47 (mod_soap)
Paul, I've done some work on Keith Brown's SOAP module, and I like its design, but one thing I noticed is that it is slow. Even under mod_perl, it can take up to 1 second(!) to serialize a large data structure. I believe the reason is that it makes method calls for every element in the Perl data structure, and method calls in Perl are inefficient due to the symbol table lookups and @ISA checking. So the larger the data structure the worse the performance. (I added array support to it and tested an array of 200 values, which took ~1 sec to serialize under mod_perl). I'd be interested in speed comparisons between SOAP and SOAP::Lite. I've looked at your code, but not actually run it. It doesn't look like you use recursive method calls the way Keith does. Have you done any benchmarks on large data structure serialization? I assume deserialization performance will be roughly equivalent for SOAP vs. SOAP::Lite since they both use XML::Parser. I read the PERFORMANCE section on base64 encoding, but it didn't mention serialization speed. I am currently using SOAP, because I like the DM design, but I would switch to SOAP::Lite if its serialization speed is significantly better. Cheers, -Adi Paul Kulchenko wrote: you are dedicated to supporting the full SOAP API (not sure what SOAP::Lite leaves out). First thing I did seven months ago was my email to Keith Brown (author of DM's SOAP/Perl module) about possible ways for cooperation and I'v been told that he's willing to, but design of his module should be consistent with other DM's implementations and he has no plans to change it. There was no easy way to combine our efforts and I came up with another implementation. Don't want to praise myself, but feature set seems to be pretty comparable with other toolkits. I took ::Lite, just because SOAP namespace was already taken. It does much more than you can expect from something with suffix Lite. "Lite suffix reflects number of calories you should spend using this module".
[ANNOUNCE] ApacheBench 0.60
The uploaded file ApacheBench-0.60.tar.gz has entered CPAN as file: $CPAN/authors/id/A/AD/ADIRAJ/ApacheBench-0.60.tar.gz size: 51190 bytes md5: e2325d7f89e32fecb6f76643ae38f7ed No action is required on your part Request entered by: ADIRAJ (Adi Fairbank) Request entered on: Fri, 23 Feb 2001 20:03:29 GMT Request completed: Fri, 23 Feb 2001 20:04:51 GMT Significant new features since 0.52: - much better OO API - new memory level setting to store only certain information about each regression run (meant to reduce memory usage) - customizable Content-type: headers in http requests (need content type "text/xml" for soap and xml/rpc) NAME HTTPD::Bench::ApacheBench - Perl API for Apache benchmarking and regression testing. SYNOPSIS use HTTPD::Bench::ApacheBench; my $b = HTTPD::Bench::ApacheBench-new; # global configuration $b-concurrency(5); $b-priority("run_priority"); # add HTTP request sequences (aka: runs) my $run1 = HTTPD::Bench::ApacheBench::Run-new ({ urls = ["http://localhost/one", "http://localhost/two"] }); $b-add_run($run1); # send HTTP request sequences to server and time responses my $ro = $b-execute; # calculate hits/sec print (1000*$b-total_requests/$b-total_time)." req/sec\n"; GOALS This project is meant to be the foundation of a complete benchmarking and regression testing suite for an advanced, transaction-based mod_perl site. We need to be able to stress our server to its limit while also having a way to verify the HTTP responses for correctness. Since our site is transaction-based (as opposed to content-based), we needed to extend the single-URL ab model to a multiple-URL sequence model. ApacheBench is based on the Apache 1.3.12 ab code (src/support/ab.c). ... see the pod for full documentation
Re: Response time under mod_perl
Michael Fuhr wrote: On Fri, Dec 08, 2000 at 02:57:33AM -0200, Edmar Edilton da Silva wrote: I need to know the response time of a Perl script running under mod_perl. To do this I need a function that it's returns the current time of the system in milliseconds. Please, have anyone any idea what function I can use? Try the Time::HiRes module on CPAN. Or HTTPD::Bench::ApacheBench if you want to see response time from the perspective of the client. -Adi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache User Creation
Manhar, HTTPD-User-Manage is exactly what you're looking for. Get it from CPAN at: http://www.cpan.org/modules/by-authors/id/L/LD/LDS/HTTPD-User-Manage-1.54.tar.gz -Adi Manhar Goindi wrote: Hi, Are there any APIs available in Apache modperl which can be used to create Apache users in Perl/CGI scripts? Are there any ways (I mean through APIs) to delete these created Apache users and modify the passwords of these Apache users? We would appreciate a lot of help in this area. If this is not the right forum pertaining to this discussion, then could you send me the e-mail address of the forum where I can pose my queries? Thanks Best Regards, Manhar Goindi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AuthCookie
Check your apache logs.. I don't think your server is actually sending the protected page, Netscape is showing you a cached version. I think this is a bug in Netscape 4.7 (for linux anyway), because that happens to me occasionally even with "Cache-Control: no-cache" and no "Expires:" header. If you click reload, it will actually hit the server and show you your login script page again. HTH, -Adi Kiran Kumar wrote: Hi, I have Installed AuthCookie Module but it does not work on netscape (4.7) but works on IE . In netscape after I logout and later i request a protected page i still get the page ,Can anyone help me on this . Thanks in advance Kiran - 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: two identical directives in Perl configuration (doc patch included)
Dave Kaufman wrote: "Adi Fairbank" [EMAIL PROTECTED] wrote: Dave Kaufman wrote: $Location{"blah"} = { require = "group payer_manager, payer_group demo" }; should do the trick. I wrote: Thanks, that fixed it. Actually, no that didn't fix it! $r-requires returns [{ 'group' = "payer_manager, payer_group demo"}] d'oh! we have the syntax wrong to begin with. http://www.apache.org/docs/mod/core.html#require says: Yes, but I'm using Apache::AuthCookie, which allows you to implement your own require methods. Theoretically, I could have as many require'ments as I write perl methods in the PerlAuthzHandler. require group payer_manager require payer_group demo require user_ip 127.0.0.1 require dayofweek wednesday etc.. This is why it would be useful for Perl sections to support: $Location{"blah"} = { require = ["req 1", "req 2", "req 3", "req 4", ..] }; -Adi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
two identical directives in Perl configuration
Say I have a $Directory{} configuration in a Perl section like so: $Directory{"/home/httpd/html-ssl/demo"} = { SetHandler = "perl-script", PerlAuthenHandler = "Authen", PerlAuthzHandler = "Authz", require = "group payer_manager", require = "payer_group demo", }; Obviously this won't work because the second "require = " directive will clobber the first. So what's the workaround? I couldn't think of what the logical perl translation to having two require directives would be... -Adi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two identical directives in Perl configuration (doc patch included)
Dave Kaufman wrote: i belive it is. in fact, i didn't realize specifing two require coditions (one group and one user) worked on *separate* lines :) something like: $Location{"blah"} = { require = "group payer_manager, payer_group demo" }; should do the trick. -dave Thanks, that fixed it. One thing I noticed through all this, is I think the mod_perl documentation is wrong.. I don't think the following is supported... DirectoryIndex = [qw(index.html index.htm)], ... unless DirectoryIndex is a special case. From perl_config.c: 1148 #define SECiter_list(t) \ 1149 { \ 1150 I32 i; \ 1151 for(i=0; i=AvFILL(entries); i++) { \ 1152 SV *rv = *av_fetch(entries, i, FALSE); \ 1153 HV *nhv; \ 1154 if(!SvROK(rv) || (SvTYPE(SvRV(rv)) != SVt_PVHV)) \ 1155 croak("not a HASH reference!"); \ 1156 nhv = newHV(); \ 1157 hv_store(nhv, (char*)key, klen, SvREFCNT_inc(rv), FALSE); \ 1158 tab = nhv; \ 1159 t; \ 1160 SvREFCNT_dec(nhv); \ 1161 } \ 1162 entries = Nullav; \ 1163 continue; \ 1164 } lines 1154-1155 will cause it to croak if any array value in entries is not a hashref, so an arrayref of scalars (e.g. DirectoryIndex = [qw(index.html index.htm)]) won't work. Am I wrong here? I did some simple tests which confirmed my suspicions, but I may still be missing something. Below is a documentation patch that I think will prevent other people's confusion in the future: Index: mod_perl.pod === RCS file: /home/cvspublic/modperl/mod_perl.pod,v retrieving revision 1.20 diff -u -r1.20 mod_perl.pod --- mod_perl.pod2000/03/05 23:46:30 1.20 +++ mod_perl.pod2000/11/17 23:18:54 @@ -618,7 +618,7 @@ AuthUserFile = '/tmp/htpasswd', AuthType = 'Basic', AuthName = 'test', - DirectoryIndex = [qw(index.html index.htm)], + DirectoryIndex = 'index.html index.htm', Limit = { METHODS = 'GET POST', require = 'user dougm', - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two identical directives in Perl configuration (doc patch included)
Dave Kaufman wrote: i belive it is. in fact, i didn't realize specifing two require coditions (one group and one user) worked on *separate* lines :) something like: $Location{"blah"} = { require = "group payer_manager, payer_group demo" }; should do the trick. -dave I wrote: Thanks, that fixed it. Actually, no that didn't fix it! $r-requires returns [{ 'group' = "payer_manager, payer_group demo"}] for the above $Location{} directive. It does no comma separation. I guess the only workaround is to split on comma after calling $r-requires (in the Auth handler). This is definitely not ideal.. I think we should fix this in perl_config.c. Basically I think there should be some straightforward way to have two (or more) require statements in $Location{} directives. The most logical seems to be what Tom suggested: require = ["group payer_manager", "payer_group demo"] I'd be happy to submit patches if I got a go ahead from Doug that this would be useful. -Adi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]