Re: Can't upload binary file (Apache::ASP sample)
Just to follow up ... Greg found the problem to be that Apache 1.3.11 did some kind of Russian encoding, including multipart/form-data content, so that 0x00 data was converted to 0x20 automatically. This would then mangle the file uploads. *Whew* glad that's solved ! :) -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 Greg wrote: - Original Message - From: Joshua Chamas [EMAIL PROTECTED] To: Greg [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, February 01, 2000 6:28 AM Subject: Re: Can't upload binary file (Apache::ASP sample) So first, I might use a sysread(FILEHANDLE,SCALAR,LENGTH,OFFSET) call to slurp the binary into a scalar, then if you want to print it, try a $Response-BinaryWrite() as shown at: I have to save file at server, and as response simply make link to it (IMG SRC=...). I've tried to use sysread syswriteb but result remained the same: 0x20 instead 0x00... :(( If you want to make your example above work, try setting OUT to binmode, with binmode(OUT), before you write to it. I'm sure that file uploads - filesize is the same, but content differs... and this code works fine at local machine: if ((open IN, "in.jpg") (open OUT, "out.jpg")) { binmode(IN); binmode(OUT); while (IN) { print OUT $_; } close IN; close OUT; } so I think all trouble is in $filehandle.. no I'm SURE! that code works perfectly fine on test data, and there is no mess with 0x00 and 0x20! i've read something about filehandles at http://stein.cshl.org/WWW/software/CGI/cgi_docs.html#upload_caveats - that it must be obtained throug different package - like that: $file = $query-param('file to upload'); $file = "main::$file"; ... but I don't know what package I have to use...
XML Configuration [Was: Re: Caucho faster than mod_perl?]
On Wed, 02 Feb 2000, Perrin Harkins wrote: I'm not trying to belittle Resin in any way -- in fact I'm impressed by both its design and performance. In learning about Resin during these tests, I found that JSP is in many ways easier to use than mod_perl. The smart caching that Resin does (with compiling .java - .class, etc.) is effective, and the XML configuration is a joy to deal with compared to Apache's httpd.conf. Actually what interests me more about this benchmark (which as you say - are starting to get meaningless now anyhow) is the XML configuration. Would people prefer to setup mod_perl using some sort of XML configuration, because I might be interested in doing this, if there's interest. Also, what's different between Resin's smart caching and mod_perl's? Is it just like StatINC? -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Cleaning up
if a variable within a modperl program is created whether a reference to an object or just a var, does mod_perl know when to clean it up or should you do that yourself at the end i.e $main::var="LARGE STRING" does mod_perl know that the var is nolonger in use after the script has run?? One of the main reason for the enquiry is the use of selectall_arrayref via DBI We currently use this as most of the selects return a small number of rows, but occasional the number of rows returned may be large. Thanks John This e-mail is intended only for the addressee named above. As this e-mail may contain confidential or privileged information, if you are not the named addressee, you are not authorised to retain, read, copy or disseminate this message or any part of it.
RE: perl.apache.org AWOL?
ObModPerl: I don't seem to have a route to perl.apache.org. Isn't this just a virtual host on www.apache.org? Used to be, but has changed recently. perl.apache.org is now hosted on locus.apache.org. You must have experienced a network glitch, I can access perl.apache.org fine as of this writing. -- Eric
Re: Cleaning up
On Wed, 02 Feb 2000, MOORHOUSE, John NW Group Risk wrote: if a variable within a modperl program is created whether a reference to an object or just a var, does mod_perl know when to clean it up or should you do that yourself at the end i.e $main::var="LARGE STRING" does mod_perl know that the var is nolonger in use after the script has run?? Yes - using the normal perl scoping rules. However if you've created a closure things are a little different. See the guide. This e-mail is intended only for the addressee named above. As this e-mail may contain confidential or privileged information, if you are not the named addressee, you are not authorised to retain, read, copy or disseminate this message or any part of it. Damnit. Now what am I going to do... :) -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Re: runaway httpd processes
I know there are alot of happy Apache::session users, that is why I don't understand why my mod_perl apache::session scripts are hanging I didn't mean to "blame" apache::session, just ask for some help in figuring out what is going on that is one of the purposes of a listserv, isn't it? To recap I have a solaris 2.7 box with apache 1.3.6, mod_perl and apache::session and my scripts intermittently hang, and also when I try to update a variable in a session, the variable sometimes never updates (but the script seems to complete)? I just wanted to ask if anyone had this happen to themI was NOT blaming apache::session! I did want to find out what I AM DOING WRONG! .or if it is a problem with solaris. any happy silient users using solaris with apache::session? KK - Original Message - From: Michael Robinton [EMAIL PROTECTED] To: Victor Zamouline [EMAIL PROTECTED] Cc: Jeffrey W. Baker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 02, 2000 1:05 AM Subject: Re: runaway httpd processes There are a large number of happy, silent Apache::Session users. Yes, I am a silent and happy Apache::Session user. You're right Jeffrey, happy users should not be silent. Ditto that. Have Apache::Session serving content for a dynamic chat page. It gets hit every 30 - 45 sec by every user in the chat room -- thousands of hits an hour. It's been running for months without a shutdown or reboot.
How to create mod_perl DBI .pm modules?
Hello, I am trying to create a library (.pm file) of DBI functions for use in my MOD_PERL scripts, but am not totally clear on how to use exporter (do I absolutely NEED to use exporter?, or can I just "use" the .pm library?) Is the following correct? The TEST.pm package { package TEST; use DBI; use Exporter(); @ISA=qw(Exporter); @EXPORT=(); sub dbConnect { . } sub fetchTest { } The MOD_PERL script --- use CGI; use DBI; use TEST; use Apache; { my $v=new CGI print $v-header; TEST-dbconnect(); my $var = TEST-fetchTest(); }
Re: How to create mod_perl DBI .pm modules?
I am trying to create a library (.pm file) of DBI functions for use in my MOD_PERL scripts, but am not totally clear on how to use exporter (do I absolutely NEED to use exporter?, or can I just "use" the .pm library?) Is the following correct? This has nothing to do with mod_perl! Please use the appropriate forums for non-mod_perl questions! Thank you! However, these will help you: http://perl.apache.org/guide/databases.html#Some_useful_code_snippets_to_be_ http://perl.apache.org/guide/databases.html#The_My_DB_module http://perl.apache.org/guide/perl.html#Using_Exporter_pm_to_share_globa ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: Embperl 1.2.1: multipart/form-data processing and nested pages (solved)
Gerald Richter wrote: [...] Sorry to confuse everybody, but I found the bug, and indeed it had nothing to do with the Execute call. The page was somewhat complex and I tried to reproduce the bug with a simpler setup, which did not work. I just searched in the wrong direction, as the upload was working when trying it from the main page but not from the executed page. The offending code was a little three-liner in the form-setup, which escaped any backslashes in the %fdat values. (Which didn't do any harm to unix filenames, but screw up for windows. Really stupid.) It was supposed to work around the problem that Embperl "eats" any backslashes the user enters in "text" fields, when you rely on automatic values in a form. Btw, is there any way to switch the backslash escapes for output processing off ? Enno P.S.: This one really drove me crazy...
Re: XML Configuration [Was: Re: Caucho faster than mod_perl?]
--- Matt Sergeant wrote: Would people prefer to setup mod_perl using some sort of XML configuration, because I might be interested in doing this, if there's interest. --- end of quote --- I can't say it'd add much to doing it by hand, but it'd probably make writing configuration assistants a whole lot easier, which would be a boon for mod_perl (I've setup mod_perl for so many otherwise-smart friends who just couldn't get it going). -Bill
Anyone else have mod_perl and Apache::session httpd hangs on Solaris?
Hi, Apache::session is a wonderful product. Is there anyone successfully using Apache::session on solaris 2.7? Do to MY misuse, or solaris problem, my httpd hangs upon my mod_perl/Apache::session script request. I have traced the hang in my script to where I am issuing : tie %session 'Apache::session::File', $session_id, {NSems = 16}; Most of the time it works, BUT somtimes is just plan never returns, and the httpd process never goes away. When I try and stop/start the apache server, it says the the httpd process didn't accept the sigterm and then goes on to issue a kill -9 on the process. Is this some sort of locking problem? Keith - Original Message - From: William P. McGonigle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 02, 2000 10:23 AM Subject: Re: XML Configuration [Was: Re: Caucho faster than mod_perl?] --- Matt Sergeant wrote: Would people prefer to setup mod_perl using some sort of XML configuration, because I might be interested in doing this, if there's interest. --- end of quote --- I can't say it'd add much to doing it by hand, but it'd probably make writing configuration assistants a whole lot easier, which would be a boon for mod_perl (I've setup mod_perl for so many otherwise-smart friends who just couldn't get it going). -Bill
Re: Anyone else have mod_perl and Apache::session httpd hangs on Solaris?
Hi again, P.S. I seem to have just duplicated the problem running JUST the example.perl script contained within the Apache::session distribution It occurs when you try to create a new session I am able to create a number of new sessions, and then on the 8th or 9th try, it hangs! This is the unmodified example.perl script (ok, I did have to do NSems=16, otherwise it didn't work at all on Solaris) Keith - Original Message - From: Keith Kwiatek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 02, 2000 10:36 AM Subject: Anyone else have mod_perl and Apache::session httpd hangs on Solaris? Hi, Apache::session is a wonderful product. Is there anyone successfully using Apache::session on solaris 2.7? Do to MY misuse, or solaris problem, my httpd hangs upon my mod_perl/Apache::session script request. I have traced the hang in my script to where I am issuing : tie %session 'Apache::session::File', $session_id, {NSems = 16}; Most of the time it works, BUT somtimes is just plan never returns, and the httpd process never goes away. When I try and stop/start the apache server, it says the the httpd process didn't accept the sigterm and then goes on to issue a kill -9 on the process. Is this some sort of locking problem? Keith - Original Message - From: William P. McGonigle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 02, 2000 10:23 AM Subject: Re: XML Configuration [Was: Re: Caucho faster than mod_perl?] --- Matt Sergeant wrote: Would people prefer to setup mod_perl using some sort of XML configuration, because I might be interested in doing this, if there's interest. --- end of quote --- I can't say it'd add much to doing it by hand, but it'd probably make writing configuration assistants a whole lot easier, which would be a boon for mod_perl (I've setup mod_perl for so many otherwise-smart friends who just couldn't get it going). -Bill
Re: Newbie Question
I am a relative newbie to mod_perl myself, but - I would think if you just want "a script to handle forms" that a vanilla CGI would be cake to set up and sufficient for your needs unless you get huge traffic. And I am led to think that if you just loaded ActivePerl then you are a long way from having mod_perl installed anyway. Have you recompiled Apache etc.? -S At 01:58 PM 2/2/00 +1000, you wrote: Thanks for your responses so far, I know I have a lot of reading to do but I just thought I would add this to my first post. After loading Activeperl I changed the httpd.conf file by adding the following: Alias /perl/ c:/Program Files/Apache Group/Apache/cgi-bin Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Location PerlModule Apache::Registry PerlModule CGI PerlSendHeader On It was after adding this that the service refused to restart. I will obviously have to read a whole lot more before this is going to work. The annoying thing is that I just want to run a script to handle forms seems like a hell of a lot of effort for such a simple request :) Thanks all Ian * Ian Ollier - [EMAIL PROTECTED] Systems Administrator Queensland Centre for Schizophrenia Research Wolston Park Hospital, Wolston Park Road Wacol QLD 4076 AUSTRALIA ph: +61 7 3271 8592 fax: +61 7 3271 8567 mobile: 0411145593 website: http://www.qcsr.uq.edu.au Any opinions herein are my own and do not necessarily reflect my employer's views. *
Re: Newbie Question
I am a relative newbie to mod_perl myself, but - I would think if you just want "a script to handle forms" that a vanilla CGI would be cake to set up and sufficient for your needs unless you get huge traffic. And I am led to think that if you just loaded ActivePerl then you are a long way from having mod_perl installed anyway. Have you recompiled Apache etc.? Or just use already built Win Apache / PERL / mod_perl distribution : ftp://theoryx5.uwinnipeg.ca/pub/other/ Regards, Waldek Grudzien _ http://www.uhc.lublin.pl/~waldekg/ University Health Care Lublin/Lubartow, Poland tel. +48 81 44 111 88 ICQ # 20441796 I know I have a lot of reading to do but I just thought I would add this to my first post. After loading Activeperl I changed the httpd.conf file by adding the following: Alias /perl/ c:/Program Files/Apache Group/Apache/cgi-bin Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Location PerlModule Apache::Registry PerlModule CGI PerlSendHeader On It was after adding this that the service refused to restart. I will obviously have to read a whole lot more before this is going to work. The annoying thing is that I just want to run a script to handle forms seems like a hell of a lot of effort for such a simple request :)
XML applications in mod_perl/apache xml project
Hi, I embarking on writing a mod_perl handler that accepts XML posted from client apps/browsers and then does "stuff" with the received XML snippets. I would like to take advantage of some of the projects discussed at xml.apache.org (The Apache XML Project), but I'm not sure how they fit into the mod_perl framework. Any XML gurus on this list have any experiences, pointers, or suggestions with integrating xml.apache.org projects with a mod_perl enabled apache server? I'd like to avoid using the java parsers and jserv if possible, but it seems that some of the nicer features of Cocoon, etc. are only available in java (hence the "Cocoon is a 100% pure Java publishing" tag line :). Thanks for your time and advice Thanks, Alex Alex Schmelkin [EMAIL PROTECTED]
can't undef active subroutine.. in error_log
Greeting all, after using mod_perl smoothly for awhile,today suddently meet a weird problem.I wrote a script to collect user input data and store in database,sounds simple.after some modification,a problem occur,after click the submit button,the browser just display info in the status bar" host connected..waiting for responce.." then just there waiting for a long time,then end with error.I find a interesting line in the error_log: [Thu Feb 3 00:55:30 2000] [error] Can't undef active subroutine at /usr/lib/perl5/site_perl/Apache/Registry.pm line 102. hmm..this is my first time got this error,anyone has some idea?and why this error occur?since I didn't lock any variable in the script.I think the error occur since some script is stillexecuting while perl try to exit? TIA Vincent __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
Re: can't undef active subroutine.. in error_log
after using mod_perl smoothly for awhile,today suddently meet a weird problem.I wrote a script to collect user input data and store in database,sounds simple.after some modification,a problem occur,after click the submit button,the browser just display info in the status bar" host connected..waiting for responce.." then just there waiting for a long time,then end with error.I find a interesting line in the error_log: [Thu Feb 3 00:55:30 2000] [error] Can't undef active subroutine at /usr/lib/perl5/site_perl/Apache/Registry.pm line 102. hmm..this is my first time got this error,anyone has some idea?and why this error occur?since I didn't lock any variable in the script.I think the error occur since some script is stillexecuting while perl try to exit? Does this help? http://perl.apache.org/guide/troubleshooting.html#Can_t_undef_active_subroutine TIA Vincent __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001 ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: Caucho faster than mod_perl?
Bill Moseley wrote: Is Apache::Registry really that much of a hit in performance over a plain old Apache content handler? And if so, why? No, it isn't. This is a "Hello World" benchmark we're talking about here, designed to show the difference in startup costs. A real app would not have such a big difference in performance, although there would be some difference. Regardless, I encourage people to code for the Apache API rather than Apache::Registry. Besides the performance, it's just cleaner, and it avoids some problems that can happen when you turn your program into a sub, like accidental closures. - Perrin
Re: XML Configuration [Was: Re: Caucho faster than mod_perl?]
Personally, I don't care. A conf file is a conf file. From the advocacy standpoint, I think it's probably a smart move on the part of mod_perl/httpd developers. There is a HUGE value in hyped up techologies with upper management. I wish I were kidding when I say that in the past I have seen several managers choose utilities because they have XML configurations (or some swift GUI, etc.). The product, in four of the six instances, turned out to be a nightmarish hell that entailed many sleepless nights on the phone with the Exodus NOCies talking them through how to coach servers back to life (mod_perl to the rescue!!!). Anyway, I think this would be pretty groovin' and would lend itself to a "public friendly" system that would sell better, which, seems to be mod_perls big problem (IMHO). Programmers are doing the marketing/advertising, etc... managers, who make the decissions listen to non-techies (typically) and are going w/ Java. The question remains then, what part of the config outside of the httpd.conf could be put into an XML config? --SC On Wed, 02 Feb 2000, Matt Sergeant wrote: On Wed, 02 Feb 2000, Perrin Harkins wrote: I'm not trying to belittle Resin in any way -- in fact I'm impressed by both its design and performance. In learning about Resin during these tests, I found that JSP is in many ways easier to use than mod_perl. The smart caching that Resin does (with compiling .java - .class, etc.) is effective, and the XML configuration is a joy to deal with compared to Apache's httpd.conf. Actually what interests me more about this benchmark (which as you say - are starting to get meaningless now anyhow) is the XML configuration. Would people prefer to setup mod_perl using some sort of XML configuration, because I might be interested in doing this, if there's interest. Also, what's different between Resin's smart caching and mod_perl's? Is it just like StatINC? -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Re: XML Configuration [Was: Re: Caucho faster than mod_perl?]
Matt Sergeant wrote: Also, what's different between Resin's smart caching and mod_perl's? Is it just like StatINC? It can cache output in a way similar to Mason. They call this "Smart Caching". It reloads servlet classes pretty cleanly when code is updated, but doesn't track dependencies, so it may be not as good as StatINC there. It also does a very nice job with JSP pages, turning them into first-class servlets. This produces less overhead than the current crop of perl-in-HTML tools available for mod_perl. We tested the same "Hello World" app as a servlet and as a JSP page and found no difference in performance. - Perrin
Adding directives using mod_perl
I'm following the description in Chap 8. of the Eagle Book for creating a module which adds configuration directives to Apache, however on my server version etc (see below), the first time through, the directive passes, but the directive gets rejected as an invalid command in the reload phase. Does the method in the Eagle book for defining directives no longer work, if this is the case, what can I do to have per-server variables such that I can use them at another modules initialisation time. MBM ---8--- The server reports itself as Apache/1.3.11 (Unix) mod_perl/1.21 PHP/3.0.7 mod_ssl/2.5.0 OpenSSL/0.9.4 and [mbm@rigel]:~$ /usr/sbin/httpd -l Compiled-in modules: http_core.c mod_so.c mod_perl.c suexec: enabled; valid wrapper /usr/sbin/suexec [mbm@rigel]:~$ /usr/sbin/httpd -V Server version: Apache/1.3.11 (Unix) Server built: Feb 1 2000 21:17:00 Server's Module Magic Number: 19990320:6 Server compiled with -D EAPI -D EAPI_MM -D EAPI_MM_CORE_PATH="/var/run/httpd.mm" -D HAVE_MMAP -D HAVE_SHMGET -D USE_SHMGET_SCOREBOARD -D USE_MMAP_FILES -D USE_FCNTL_SERIALIZED_ACCEPT -D HTTPD_ROOT="/usr" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="/var/run/httpd.pid" -D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard" -D DEFAULT_LOCKFILE="/var/run/httpd.lock" -D DEFAULT_XFERLOG="/var/log/httpd/access_log" -D DEFAULT_ERRORLOG="/var/log/httpd/error_log" -D TYPES_CONFIG_FILE="/etc/httpd/conf/mime.types" -D SERVER_CONFIG_FILE="/etc/httpd/conf/httpd.conf" -D ACCESS_CONFIG_FILE="/etc/httpd/conf/access.conf" -D RESOURCE_CONFIG_FILE="/etc/httpd/conf/srm.conf"
closure vs. nested sub
Well, it seems that the mistake I've made a while ago, explaining the "closure" effect in the guide has been propagated to many people on the list. I've fixed it since then, but probably a few noticed this in the CHANGES log. There is no 'closure' effect caused by Registry scripts!!! This is called the 'nested sub' effect. Please take a moment to reread the corrected writeup: http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S P.S. of course you can create a closure in your code, but in general case of registry "problems" it's not a closure. I apologize for creating a confusion. This is what happens when there is no proof reading of such a big document. I wish more people wouldn't take things for granted and send me corrections. I know there are bugs and omissions in the guide, because I find them myself from time to time, and Ged did an enourmous work cleaning the whole thing up for all of us. (I know the new release is due, will do that very soon now :) If you wander who told me about the 'closure' mistake, it's quite interesting. I've found it when I've received my tutorial evaluation from O'Reilly conference (half a year after I taught the tutorial). Among comments about my German accent :) there was one that included a long list of things that should be corrected. I wish there were more attendant like this guy. Talking about conferences... I hope to see you in Orlando in March at ApacheCon (apachecon.com)... there will be more mod_perl classes :) Enjoy. ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: runaway httpd processes
Keith Kwiatek wrote: I know there are alot of happy Apache::session users, that is why I don't understand why my mod_perl apache::session scripts are hanging I didn't mean to "blame" apache::session, just ask for some help in figuring out what is going on that is one of the purposes of a listserv, isn't it? To recap I have a solaris 2.7 box with apache 1.3.6, mod_perl and apache::session and my scripts intermittently hang, and also when I try to update a variable in a session, the variable sometimes never updates (but the script seems to complete)? I just wanted to ask if anyone had this happen to themI was NOT blaming apache::session! I did want to find out what I AM DOING WRONG! .or if it is a problem with solaris. any happy silient users using solaris with apache::session? Can you do some basic debugging with this box? Try attaching to hung process with 'gdb' and see what it is doing. Use the 'strace' program to look at syscalls it is making. Use the ps command to see what state the processes are in. Further, if you are using the semaphore locking mechanism, check your semaphores. Is one of them stuck on? Seems unlikely since you say you can write to the session hash but you can't overwrite a variable ...? -jwb
Re: Anyone else have mod_perl and Apache::session httpd hangs onSolaris?
Keith Kwiatek wrote: Hi again, P.S. I seem to have just duplicated the problem running JUST the example.perl script contained within the Apache::session distribution It occurs when you try to create a new session I am able to create a number of new sessions, and then on the 8th or 9th try, it hangs! This is the unmodified example.perl script (ok, I did have to do NSems=16, otherwise it didn't work at all on Solaris) How are you running it? Under Registry?
Re: Using network appliance Filer with modperl
On Tue, 1 Feb 2000, Pascal Eeftinck wrote: At 11:25 1-2-2000 -0600, Leslie Mikesell wrote: According to Elizabeth Mattijsen: We have been using such a setup for over 2 years now. The only real issue we've found is not so much with mod_perl itself, but with MySQL. If you put your databases on the NetApp, either have a seperate central database server, or make damn sure you do not use the same database from two different front-end servers. We've seen database corruption that way (using Linux front-end servers with NFS 2). It is probably reasonable for MySQL to assume that only one server is accessing the files at once since it has its own remote client access protocol. Do you happen to know if there is a performance difference for MySQL between local drives and a NetApp? All MySQL operations are atomic. You can always be sure that no two threads will be updating a table at the same time, for example. If you need to work on multiple tables while making sure data stays consistent among them, lock these tables before use. A single MySQL server will have no problems running with its databases mounted on an NFS store, although performance probably won't be very good. It shouldn't hurt too much for huge tables that you don't access that heavily, but those that you do use frequently had better be kept on a local disk. Of course you can just make symlinks in your var directory to the tables that you've stored on an NFS store somewhere. Multiple MySQL servers running on the same database stored on an NFS store is not something you should try at all. Threaded locking is unreliable by itself on Solaris and Linux if I read the MySQL docs correctly, and NFS locking is worse than that. You'd absolutely need a thread-safe flock() implementation that works over NFS as well - good luck with your quest. :) When you do use locking, be very very careful if you use Apache::DBI or similar persistent connections. MySQL threads keep tables locked until the thread ends (connection is closed) or the tables are unlocked. If your session die()'s while tables are locked, they will stay neatly locked as your connection won't be closed either This was a nasty one I bumped in to ... Unless you write a clean code that worries to clean up no matter what happens to the script. This is a snippet from my DB handling code. It's a part of the bigger OO module, but notice the DESTROY subroutine that worries to unlock the tables and disconnect if you aren't using Apache::DBI (if you do it's just a NOP) ## # lock the passed tables in the requested mode (READ|WRITE) and set # internal flag to handle possible user abortions, so the tables will # be unlocked thru the END{} block # # sql_lock_tables('table1','lockmode',..,'tableN','lockmode' # lockmode = (READ | WRITE) # # _side_effect_ $self-{lock} = 'On'; # ## sub sql_lock_tables{ my $self = shift; my %modes = @_; return unless %modes; my $do_sql = 'LOCK TABLES '; $do_sql .= join ",", map {"$_ $modes{$_}"} keys %modes; $self-{sth} = $self-{dbh}-prepare($do_sql); $self-{sth}-execute(); # Enough to set only one lock, unlock will remove them all $self-{lock} = 'On'; } # end of sub sql_lock_tables ## # unlock all tables, unset internal flag to handle possible user # abortions, so the tables will be unlocked thru the END{} block # # sql_unlock_tables() # # _side_effect_: delete $self-{lock} # ## sub sql_unlock_tables{ my $self = shift; my $do_sql = 'UNLOCK TABLES '; $self-{sth} = $self-{dbh}-prepare($do_sql); $self-{sth}-execute(); # Enough to set only one lock, unlock will remove them all delete $self-{lock}; } # end of sub sql_unlock_tables # DESTROY makes all kinds of cleanups if the fuctions were interuppted # before their completion and haven't had a chance to make a clean up. ### sub DESTROY{ my $self = shift; $self-sql_unlock_tables() if defined $self-{lock}; $self-{sth}-finish if defined $self-{sth} and $self-{sth}; $self-{dbh}-disconnect if defined $self-{dbh} and $self-{dbh}; } # end of sub DESTROY ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re:can't undef active subroutine.. in error_log
Sorry that I didn't search in the old messages of this ML.Now I've found some.I use apache 1.3.9,mod_perl 1.21 and perl 5.004. According to Stas Bekmen 's solution in the old email,if upgrade my perl to 5.005,this problem will alright ?But after read the perl.apache.org/guide/troubleshooting.html,got this: Can't undef active subroutine at /usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm line 102. Called from package Apache::Registry, filename /usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm, line 102 SO means perl 5.005 won't be helpful?? another possible said in old email is the $SIG{PIPE}. but the Problem is that I even dont know what's those $SIG{PIPE}. sure I didn't use it at all.so,any other suggestion? Hmmm, it can be some module that you use. What do you see at: http://localhost/perl-status?sig aix... yes, I remember I saw many of these back when I was using it. Luckily I don't use it any more. AIX caused so many problems... ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: XML applications in mod_perl/apache xml project
Alex Schmelkin wrote: Hi, I embarking on writing a mod_perl handler that accepts XML posted from client apps/browsers and then does "stuff" with the received XML snippets. I would like to take advantage of some of the projects discussed at xml.apache.org (The Apache XML Project), but I'm not sure how they fit into the mod_perl framework. Any XML gurus on this list have any experiences, pointers, or suggestions with integrating xml.apache.org projects with a mod_perl enabled apache server? I'd like to avoid using the java parsers and jserv if possible, but it seems that some of the nicer features of Cocoon, etc. are only available in java (hence the "Cocoon is a 100% pure Java publishing" tag line :). Thanks for your time and advice I'm looking to add some level of XML support to Apache::ASP, but may not be quite what you are looking for. What about the Cocoon project or any other at xml.apache.org would you like to use ? I guess I'm asking that you clarify what "does stuff" means. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Job openings at Northern Light Technology, Cambridge, MA.
Who we're looking for: We're looking for a Senior/Principal Engineer in the Web Architecture/Systems group, which is responsible for all aspects of web server technology and the development of core technology components for our web based applications. (We have a separate Applications development group who are also hiring; see our jobs page at http://www.northernlight.com/docs/jobs_company.html for other open positions). About you: You will have 2+ years software development experience using C/C++/Perl in a UNIX environment, plus intimate familiarity with the Apache web server, mod_perl, and a good understanding of system performance and tuning issues in a high traffic Web environment. Ability to work on multiple projects at once, good communications skills and a tolerance for organized chaos are all highly desirable. About Northern Light: Since it premiered as the first Web-based research engine in August of 1997, Northern Light has grown considerably, earning accolades for its search engine technology. We're now a 150 person company (pre IPO) headquartered in the Kendall Square area of Cambridge, Mass. We're not new kids on the block. Our management team has been around a few blocks with, combined, over 100 years of experience in the software industry. They know what it takes to make the company successful. At the same time, we're very young at heart. We tackle interesting projects and actively encourage creative thinking and continuous learning. The energy, humor, and commitment to quality shared by people at Northern Light are unsurpassed. Please send your resume by email, fax or ground mail to: Human Resources Northern Light Technology 222 Third Street, Suite 1320 Cambridge, MA 02142 Fax: (617) 621-3459 Email: [EMAIL PROTECTED] Feel free to call me at (617) 621 5296 or email me if you have any questions. - Simon Rosenthal ([EMAIL PROTECTED]) Web Systems Architect Northern Light Technology 222 Third Street, Cambridge MA 02142 Phone: (617)577-2796 : URL: http://www.northernlight.com "Northern Light - Just what you've been searching for"
Re:can't undef active subroutine.. in error_log
I am using RH 5.2,Kernel 2.2.14,apache 1.3.9,when you mentioned taht some modules I use.yes,the error occur while I change my own COOKIE script(via process the $ENV{'HTTP_COOKIE'}) to Apache::Cookie(newest version),this error occur.other module I used is standard,DBI,Apache::Registry,Apache::DBI,and a script write by myself to process DBI query stuff.the perl-status?sig looks like following: ABRT = ALRM = BUS = CHLD = CLD = CONT = FPE = HUP = ILL = INT = IO = IOT = KILL = PIPE = IGNORE POLL = PROF = PWR = QUIT = SEGV = STKFLT = STOP = TERM = TRAP = TSTP = TTIN = TTOU = UNUSED = URG = USR1 = IGNORE USR2 = VTALRM = WINCH = XCPU = XFSZ = __DIE__ = __WARN__ = __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
Re:can't undef active subroutine.. in error_log
I am using RH 5.2,Kernel 2.2.14,apache 1.3.9,when you mentioned taht some modules I use.yes,the error occur while I change my own COOKIE script(via process the $ENV{'HTTP_COOKIE'}) to Apache::Cookie(newest version),this error occur.Also anothe error after change to Apache::CCookie is several "use of uninitialized value of...Cookie.pm" according to my following code: my $r = Apache-request; my $cookie = Apache::Cookie-new($r); my $uid = $cookie-get('uid'); other module I used is standard,DBI,Apache::Registry,Apache::DBI,and a script write by myself to process DBI query stuff.the perl-status?sig looks like following: ABRT = ALRM = BUS = CHLD = CLD = CONT = FPE = HUP = ILL = INT = IO = IOT = KILL = PIPE = IGNORE POLL = PROF = PWR = QUIT = SEGV = STKFLT = STOP = TERM = TRAP = TSTP = TTIN = TTOU = UNUSED = URG = USR1 = IGNORE USR2 = VTALRM = WINCH = XCPU = XFSZ = __DIE__ = __WARN__ = __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001
Re:can't undef active subroutine.. in error_log
I am using RH 5.2,Kernel 2.2.14,apache 1.3.9,when you mentioned taht some modules I use.yes,the error occur while I change my own COOKIE script(via process the $ENV{'HTTP_COOKIE'}) to Apache::Cookie(newest version),this error occur.other module I used is standard,DBI,Apache::Registry,Apache::DBI,and a script write by myself to process DBI query stuff.the perl-status?sig looks like following: ABRT = ALRM = BUS = CHLD = CLD = CONT = FPE = HUP = ILL = INT = IO = IOT = KILL = PIPE = IGNORE of course it should be: PIPE = \Apache::SIG::PIPE grep the code you use for PIPE, something have overriden the Apache sighandler POLL = PROF = PWR = QUIT = SEGV = STKFLT = STOP = TERM = TRAP = TSTP = TTIN = TTOU = UNUSED = URG = USR1 = IGNORE USR2 = VTALRM = WINCH = XCPU = XFSZ = __DIE__ = __WARN__ = __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001 ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
RE: XML applications in mod_perl/apache xml project
I remember the thread from a couple of weeks ago between you and Matt Sergeant about adding XML support to Apache::ASP. From what I could tell, you were proposing to extend your ASP tag parser to allow for dynamic creation of documents based on XML templates. What I'm discussing here is something slightly different: creating a mod_perl handler that reads posted XML snippets and then passes them off to other perl modules that know what to do with the XML (e.g., parse it and stuff in a database, store it to the filesystem). I'm assuming my other modules would then know the correct XML responses to create to send back to the client/browser. Based on the breed of client that is connecting to the system, the returned XML may optionally be passed through another filter, XSL processor, or passed directly to the client. This system appears to be fairly easy to create under mod_perl with a few handlers and the use of the myriad XML modules on CPAN. Cocoon appears to be trying to automate this process with a java object API where the developer can define the "producer", "processor", and "formatter" of the XML on the server. The concept seems easily recreatable in a mod_perl context, and I'm wondering if anyone has attempted it and what are some possible pointers/pitfalls/advice to consider. Thanks, Alex -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Joshua Chamas Sent: Wednesday, February 02, 2000 1:41 PM To: Alex Schmelkin Cc: [EMAIL PROTECTED] Subject: Re: XML applications in mod_perl/apache xml project Alex Schmelkin wrote: Hi, I embarking on writing a mod_perl handler that accepts XML posted from client apps/browsers and then does "stuff" with the received XML snippets. I would like to take advantage of some of the projects discussed at xml.apache.org (The Apache XML Project), but I'm not sure how they fit into the mod_perl framework. Any XML gurus on this list have any experiences, pointers, or suggestions with integrating xml.apache.org projects with a mod_perl enabled apache server? I'd like to avoid using the java parsers and jserv if possible, but it seems that some of the nicer features of Cocoon, etc. are only available in java (hence the "Cocoon is a 100% pure Java publishing" tag line :). Thanks for your time and advice I'm looking to add some level of XML support to Apache::ASP, but may not be quite what you are looking for. What about the Cocoon project or any other at xml.apache.org would you like to use ? I guess I'm asking that you clarify what "does stuff" means. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Using network appliance Filer with modperl
On Wed, 2 Feb 2000, Stas Bekman wrote: Date: Wed, 2 Feb 2000 20:21:20 +0200 (IST) From: Stas Bekman [EMAIL PROTECTED] To: Pascal Eeftinck [EMAIL PROTECTED] Cc: mod_perl list [EMAIL PROTECTED] Subject: Re: Using network appliance Filer with modperl # DESTROY makes all kinds of cleanups if the fuctions were interuppted # before their completion and haven't had a chance to make a clean up. ### sub DESTROY{ my $self = shift; $self-sql_unlock_tables() if defined $self-{lock}; $self-{sth}-finish if defined $self-{sth} and $self-{sth}; $self-{dbh}-disconnect if defined $self-{dbh} and $self-{dbh}; } # end of sub DESTROY Stas, are you sure DESTROY executed when children died ? I'm using ApacheDBI and have problem with DESTROY when I use finish or disconnect methods. Regards. Oleg ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com _ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83
No Status From Server
I'm setting up a local monitoring service using SiteScope from Freshwater Software. When I put in an URL for one of my cgi-perl scripts, the monitor comes back with the following error: no status in reply from server Static pages and standard cgi script work fine, so I am assuming that my scripts (or mod_perl) is not sending a Status OK to the browser. Do I have to send this via my script or am I missing something obvious? Jim
RE: No Status From Server
are you using PerlSendHeader On in your httpd.conf? maybe that will help? --Geoff -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:18 PM To: [EMAIL PROTECTED] Subject: No Status From Server I'm setting up a local monitoring service using SiteScope from Freshwater Software. When I put in an URL for one of my cgi-perl scripts, the monitor comes back with the following error: no status in reply from server Static pages and standard cgi script work fine, so I am assuming that my scripts (or mod_perl) is not sending a Status OK to the browser. Do I have to send this via my script or am I missing something obvious? Jim
Re: No Status From Server
I was going to post that but I though PerlSendHeader was just responsible for the Content-type and not the status code. In either case, I have PerlSendHeader Off. Jim are you using PerlSendHeader On in your httpd.conf? maybe that will help? --Geoff -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:18 PM To: [EMAIL PROTECTED] Subject: No Status From Server I'm setting up a local monitoring service using SiteScope from Freshwater Software. When I put in an URL for one of my cgi-perl scripts, the monitor comes back with the following error: no status in reply from server Static pages and standard cgi script work fine, so I am assuming that my scripts (or mod_perl) is not sending a Status OK to the browser. Do I have to send this via my script or am I missing something obvious? Jim -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters
RE: No Status From Server
true... I was thinking that your header might not be complete and it was the header, not the status code, that was causing the problem. I assumed your browser was seeing the script output ok... Hmmm... -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:28 PM To: [EMAIL PROTECTED] Subject: Re: No Status From Server I was going to post that but I though PerlSendHeader was just responsible for the Content-type and not the status code. In either case, I have PerlSendHeader Off. Jim are you using PerlSendHeader On in your httpd.conf? maybe that will help? --Geoff -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:18 PM To: [EMAIL PROTECTED] Subject: No Status From Server I'm setting up a local monitoring service using SiteScope from Freshwater Software. When I put in an URL for one of my cgi-perl scripts, the monitor comes back with the following error: no status in reply from server Static pages and standard cgi script work fine, so I am assuming that my scripts (or mod_perl) is not sending a Status OK to the browser. Do I have to send this via my script or am I missing something obvious? Jim -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters
Re: Using network appliance Filer with modperl
On Wed, Feb 02, 2000 at 08:21:20PM +0200, Stas Bekman wrote: This thread has drifted way off topic, but anyway... my $do_sql = 'UNLOCK TABLES '; $self-{sth} = $self-{dbh}-prepare($do_sql); $self-{sth}-execute(); I'd express all that as: $self-{dbh}-do("UNLOCK TABLES"); Tim.
%SIG localization partly resolved
I was asked a few times about %SIG localization and have stumbled upon this problem myself. Either it's a $SIG{PIPE}, $SIG{__WARN__}, $SIG{__DIE__} or $SIG{CHLD} -- the most relevant sigs for mod_perl. Here is the problem. Consider this code: MyRun.pm: - package MyRun; $SIG{__DIE__} = \mydie; sub dienow{ print "Content-type: text/plain\n\n"; print "before die\n"; die("I'm dying..."); print "after die\n"; } sub mydie{ my $why = shift; print "Die was trapped: $why\n"; exit; } 1; die.pl -- use MyRun; MyRun::dienow(); works OK, the __DIE__ sig gets trapped, no problem. But you don't want to write code like this since it affects the whole process! So I add local before $SIG{__DIE__}: local $SIG{__DIE__} = \mydie; and my sighandler is ignored. Notice that if I move all the code into a single script, local does work. Actually not the code, but only the sighandler assignment. MyRun.pm: - package MyRun; sub dienow{ print "Content-type: text/plain\n\n"; print "before die\n"; die("I'm dying..."); print "after die\n"; } sub mydie{ my $why = shift; print "Die was trapped: $why\n"; exit; } 1; die.pl -- use MyRun; $SIG{__DIE__} = \MyRun::mydie; MyRun::dienow(); Surprising, but this appears to work. I didn't see this problem covered in perlipc. (It behaves completely identical without mod_perl). Is it a bug or a feature? So for my understanding it appears to be the bug in Perl. Since you cannot reassign the handler after this was trapped with local and if you don't use local() you affect the whole process, which you don't want to. So this code won't work correctly as expected: sub mydie{ my $why = shift; print "Die was trapped: $why\n"; local $SIG{__DIE__} = \mydie; # reassign the sig exit; } The above code is required on *some* OSes, because the SIG gets cleared after it was called for the first time. Also I couldn't make it work inside the modules, where the sig was supposed to be localized. e.g with SIG{CHLD} when forking a process, to prevent zombies. This is it. ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: No Status From Server
true... I was thinking that your header might not be complete and it was the header, not the status code, that was causing the problem. I assumed your browser was seeing the script output ok... Correct. The browser reports no errors. AND... the monitor, although it reports no status code, does print out the server response and HTML. Here's the first few lines for reference: - http://tradwww1/cgi-perl/marketplace_help?topic_id=1 GET /cgi-perl/marketplace_help?topic_id=1 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Accept: */* Host: tradwww1 html ... /html - Jim Hmmm... -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:28 PM To: [EMAIL PROTECTED] Subject: Re: No Status From Server I was going to post that but I though PerlSendHeader was just responsible for the Content-type and not the status code. In either case, I have PerlSendHeader Off. Jim are you using PerlSendHeader On in your httpd.conf? maybe that will help? --Geoff -Original Message- From: Jim Serio [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 02, 2000 2:18 PM To: [EMAIL PROTECTED] Subject: No Status From Server I'm setting up a local monitoring service using SiteScope from Freshwater Software. When I put in an URL for one of my cgi-perl scripts, the monitor comes back with the following error: no status in reply from server Static pages and standard cgi script work fine, so I am assuming that my scripts (or mod_perl) is not sending a Status OK to the browser. Do I have to send this via my script or am I missing something obvious? Jim -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters
Re: Using network appliance Filer with modperl
On Wed, 2 Feb 2000, Oleg Bartunov wrote: On Wed, 2 Feb 2000, Stas Bekman wrote: Date: Wed, 2 Feb 2000 20:21:20 +0200 (IST) From: Stas Bekman [EMAIL PROTECTED] To: Pascal Eeftinck [EMAIL PROTECTED] Cc: mod_perl list [EMAIL PROTECTED] Subject: Re: Using network appliance Filer with modperl # DESTROY makes all kinds of cleanups if the fuctions were interuppted # before their completion and haven't had a chance to make a clean up. ### sub DESTROY{ my $self = shift; $self-sql_unlock_tables() if defined $self-{lock}; $self-{sth}-finish if defined $self-{sth} and $self-{sth}; $self-{dbh}-disconnect if defined $self-{dbh} and $self-{dbh}; } # end of sub DESTROY Stas, are you sure DESTROY executed when children died ? I'm using ApacheDBI and have problem with DESTROY when I use finish or disconnect methods. Of course! This works for me: die.pl use MyRun; print "Content-type: text/plain\n\n"; print "hi\n"; my $obj = new MyRun; die "dying..."; print "End of program\n"; MyRun.pm package MyRun; sub new{ return bless {}, shift;} DESTROY{ print STDERR "destructor was called\n";} 1; The disconnect method shouldn't work as it gets overriden by Apache::DBI with NOP. However finish() is supposed to work. ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Cross Site Scripting security issue (fwd)
I'm sure that some of you didn't get this. And some of you are unaware of the security issues covered below. Enjoy the reading and run fix your scripts :) or may be :( is a better choice. -- Forwarded message -- Date: Wed, 2 Feb 2000 12:22:12 -0700 (MST) From: Marc Slemko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Cross Site Scripting security issue -BEGIN PGP SIGNED MESSAGE- As you may already be aware, today CERT released an advisory about a security vulnerability that has been discovered associated with malicious HTML tags (especially scripting tags) being embedded in client web requests. The common name currently associated with this problem is "Cross Site Scripting", even though this name is not entirely accurate in its description of the problem. Please review the CERT advisory available at: http://www.cert.org/advisories/CA-2000-02.html for more details. Pay particular attention to their Tech Tip for Web Developers, available at: http://www.cert.org/tech_tips/malicious_code_mitigation.html There are a number of ways in which this issue impacts Apache itself, and many more ways in which it impacts sites developed using related technologies such as Apache modules, CGI scripts, mod_perl, PHP, etc. that runs on top of Apache. We have put together some information about this and it is available at: http://www.apache.org/info/css-security/ Please visit this page for more information if you think this problem impacts your site or if you don't understand if the problem impacts your site. Included on this page are patches to Apache to fix a number of related bugs and to add a number of features that may be helpful in defending against this type of attack. We expect to release a new version of Apache in the immediate future that includes these patches, but do not yet have an exact timeline planned for this release. Please note that this issue does not in any way compromise the security of your server directly. All the issues related to this involve tricking a client into doing something that is not what the user intends. We expect to update our pages with more information in the future, as more of the details of and consequences of this issue are discovered. - -- Marc Slemko | Apache Software Foundation member [EMAIL PROTECTED] | [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: PGPfreeware 5.0i for non-commercial use Charset: noconv iQCVAwUBOJiD51Qv/g4Arev1AQFp+AP+PYknXFPhcFExJvrZ2OdXhR43w2Fwuhgp UzhJFj8WLnpuaXNipQnE5/lVxNu2s7X6hshPP9GpDUkhU8u0WMXcJqydI4+/1OEV O2yRhVeIMwhE8k38SDxIiJJ+DsPQJ5p/Rfi8tZRh4GneSU5JBhY3d5hkumfsPocs NZYgV5YnhRs= =fSkT -END PGP SIGNATURE-
Embperl/mod_perl name space problems?
Hi. I'm working on an Embper/modperl problem. I'm working with some people who are redesigning their site. They've written a 2 tier application server in perl using Embperl, DBI and an assortment of modules. Looking at performance, it was running in a pure cgi environment. I'd like to see us using mod_perl, however there are some issues that I'm having a hard time resolving. Background We're using apache 1.3.9, perl 5.005_03, CGI.pm 2.46, and Embperl 1.2.1. The problem I'm having is (I believe) a name space issue with Embperl. The symptom is, I'll hit an embperl page and it seems to work, but the code doesnt re-execute when you reload. As it stands, each directory has an index.cgi and a perl module that controls what templates get read in and executed. The template files share certain common files with embperl code (the top nav bar, the side bar elements, etc). Its these files I'm having a hard time with. The basic flow is: browser makes a request cgi program looks at the requested page and checks to see what template to load. The template is looked up in a hash table that retures what file to open. The file is opened and it may contain embperl that opens and evaluates other files. All the code is executed. A page gets returned to the browser. The server seems to be putting the 'included'embperl files into the same namespace. Each page works fine if you hup the server, going from one section of the site to annother results in the top nav bar being incorrectly displayed. Thats if we use Apache::Registry or Apache::PerlRun. If I use Apache::PerlRun, and set PerlRunOnce everythign works fine. While this gives us a decent speed increase from preloading the modules, I'd like to not have to use PerlRunOnce, and ideally be able to use Apache::Registry. Some code in a typical template, there's embperl like this: [* Execute($base.'/'.$top_nav,$app); *] $top_nav is a file that contains more embperl code. I've tried looking through the symbol table under /apache-status but I'm not really sure where to start looking. All cgi's and modules are written with the use strict pragma and have taint checking turned on. Just about all the code is OO perl. While I'm not leading the project, I'd love to see it run under mod_perl. I feel the speed/performance gained would be well worth it. So I guess what I'd like to know is, has anyone used Embperl the way we are? Where, instead of a .epl or a specific file type, you mix embperl and regular perl? Where embperl code gets run from inside annother module that may also do things like set cookies, connect to databases or whatever. Mental -- "You make insanity respectable." --Helcat on the subject of Mental PGP 2.6.3a Public Key: http://www.neverlight.com/Mental-PublicKey.pgp PGP signature
(USA-DC) Perl/Apache/mod_perl jobs
My name is James Holmes, and I work at Liquidation.com. We have a small full-time staff of developers and are looking to enlarge it greatly. I need senior, mid-level and junior developers fluent in Perl and mod_perl, and Mysql/Oracle and C/C++ experience would be great. Ideally, you've architected, designed and/or implemented large, scalable websites (many millions of hits a day) with Linux and Apache, Perl and Mysql/Oracle. That would be perfect--if that's you, stop reading and hit "reply" now! If that's not exactly you, but you enjoy Perl and mod_perl work, have a strong sense of software engineering (building for robustness, quality, and relibility) as well as some demonstrable experience, we may be right for you. You should have a desire to work for a fun, rapidly growing Washington DC internet start-up in the hot B2B space. You should want to learn new technologies and rapidly deploy large scalable systems. We do fun things here, in an exciting market space (B2B online auctions). Check us out at http://www.liquidation.com/ -- we've got our act together, we're building lots of interesting features and systems, and we need quality people to work on our challenging projects. We pay competitively and have good stock options, and a great work environment... we just need more quality people to help us build everything we`ve got in mind! Interested? I sure hope so! Please e-mail your resume/work experience info/URLs/etc. to [EMAIL PROTECTED] James Holmes - [EMAIL PROTECTED] Project Lead - http://www.liquidation.com/
Re: Anyone else have mod_perl and Apache::session httpd hangs onSolaris?
On Wed, 2 Feb 2000, Keith Kwiatek wrote: Hi again, P.S. I seem to have just duplicated the problem running JUST the example.perl script contained within the Apache::session distribution It occurs when you try to create a new session I am able to create a number of new sessions, and then on the 8th or 9th try, it hangs! This is the unmodified example.perl script (ok, I did have to do NSems=16, otherwise it didn't work at all on Solaris) Keith I had the same problem, however putting in an explicit 'untie %session' when I have finished with the tied variable fixes the problem. My guess is that it is related to the session variable not going out of scope, so the destructor method in the Apache::Session class is not invoked. Although I could be wrong. Jason. --- Jason Ball Electronic Commerce Specialist Corporate Express Australia Ltd Phone: +61 2 9335 0374 Fax: +61 2 9335 0753 Email: [EMAIL PROTECTED]
Re: Using network appliance Filer with modperl
On Wed, Feb 02, 2000 at 08:21:20PM +0200, Stas Bekman wrote: Oh, and while I'm being picky (nothing personal Stas!): $self-{sth}-finish if defined $self-{sth} and $self-{sth}; $self-{dbh}-disconnect if defined $self-{dbh} and $self-{dbh}; There's no need to test for "defined" and "true" since undefined is false and won't generate a warning when used in a boolean context. Thus just: $self-{sth}-finish if $self-{sth}; $self-{dbh}-disconnect if $self-{dbh}; Tim:
ANNOUNCE: Apache::AuthCookie v2.0
Hi, here's the eagerly-awaited announcement: ** * The URL * * http://mathforum.com/~ken/modules/archive/Apache-AuthCookie-2.000.tar.gz * * has entered CPAN as * * file: $CPAN/authors/id/KWILLIAMS/Apache-AuthCookie-2.000.tar.gz * size: 12760 bytes *md5: e943bebd35b8151d0d10aa039b67fb4a * * Changed in version 2.0: * * - Now owned by Ken Williams ([EMAIL PROTECTED]) * * - Created authenticate() and authorize() methods to replace authen() * and authz(). authen() and authz() are now deprecated and will * disappear in a later version. * * - AuthType can now contain colons [[EMAIL PROTECTED] (Adi)] * * - Nonexistent method calls (via 'require' directive) are no longer * shielded in authorization stage - if it fails it fails, and you * get a server error. * * - Multiple 'require' directives should work now - previously only * the first directive was respected. ** I've got a couple other changes I want to make soon, but I wanted to get version 2 out the door. Let me know how it goes. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
memory leaks redux
[EMAIL PROTECTED] (Doug MacEachern) wrote: there are hints in the SUPPORT doc on how to debug such problems. there was also several "Hanging process" threads in the past weeks with more tips, search in the archives for keywords gdb, .gdbinit, curinfo if you can get more insight from those tips, we can help more. I have also seen (and reported via the Debian bugs system) a problem which I think has been observed before where HUP'ing the root httpd causes it to reload every darn PerlModule directive, and bloat accordingly (with our server, that's 3M per SIGHUP, which makes log rotation somewhat painful (when you get 3 million hits in 8 hours, you rotate those logs pretty fast!)). It also appears that when you SIGHUP it WITHOUT any PerlModules, it still leaks memory (even with PerlFreshRestart Off), reloading all the standard implicit Apache stuff, viz (strace on the root PID): open("/usr/lib/perl5/5.005/i386-linux/Apache/Constants.pm", O_RDONLY) = 5 brk(0x8223000) = 0x8223000 fstat(5, {st_mode=S_IFREG|0644, st_size=3791, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0 x402dd000 read(5, "package Apache::Constants;\n\nuse "..., 4096) = 3791 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0x8224000) = 0x8224000 brk(0x8225000) = 0x8225000 brk(0x8226000) = 0x8226000 close(5)= 0 munmap(0x402dd000, 4096)= 0 brk(0x8227000) = 0x8227000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 On Sun, 9 Jan 2000, James Furness wrote: The server runs normally for several hours, then suddenly a httpd process starts growing exponentially, the swapfile usage grows massively and the server starts to become sluggish (I assume due to disk thrashing caused by the heavy swap usage). Usually when this started to happen I would log in and use apachectl stop to shutdown the server, then type 'killall httpd' several times till the processes finally died off, and then use apachectl start to restart apache. If I was not around or did not catch this, the server would eventually become unresponsive and lock up, requiring a manual reboot by the datacentre staff. Messages such as "Out of memory" and "Callback called exit" would appear in the error log as the server spiralled down and MySQL would start to have trouble running. Seen that, (Debian/i486 2.2.12 kernal, Apache 1.3.9. mod_perl 1.21) to the extent that our production webservers run: --- #!/bin/bash # cron checks this is running every so often # You DON'T run this from cron because if you get # half a dozen runaways, cron doesn't get a look in # in time to save you echo $$ /var/run/kill_runaways.pid runawaylogfile=/var/log/kill_runaways.log while true do runaways=`ps auxOv | awk '/httpd/ {if ($53) print $2}'` if [ ! -z "$runaways" ] then echo $runaways | xargs echo "`date`: killing:" \ $runawaylogfile echo $runaways | xargs kill -9 fi sleep 10 done Have not yet managed to figure out what's going on, except that strace once it's running away just shows call after call to brk(), and trying to do anything clever to catch it just before it starts brk()'ing doesn't help. -- Mike Whitaker | Work: +44 1733 766619 | Work: [EMAIL PROTECTED] Technical Manager | Fax: +44 1733 348287 | Home: [EMAIL PROTECTED] CricInfo Ltd | GSM: +44 7971 977375 | Web: http://www.cricket.org/
mod_perl with Stronghold
I searched the archives, but no mention of this. Does anyone have any experience with mod_perl and Stronghold? Thanks, Jon J. Horner [EMAIL PROTECTED] http://jjhorner.penguinpowered.com/ 10:00am up 8 days, 1:38, 6 users, load average: 0.04, 0.03, 0.00
Caucho tested on Apache with DSO
Hi there, on http://www.caucho.com/articles/benchmark.html you mention the following: quote Apache configurations used Apache 1.3.9. All modules were compiled with DSO support. /quote Why has this been done? On http://www.apache.org/docs/dso.html you can find a few disadvantages of DSO: quote The server is approximately 5% slower at execution time under some platforms because position independent code (PIC) sometimes needs complicated assembler tricks for relative addressing which are not necessarily as fast as absolute addressing /quote Please make sure DSO isn't a slowdown factor on your machines, benchmarks only count for something when done fairly. Cheers! -Renzo
Slight performance enhancement for dynamic sites.
Here's a tiny performance tweak that I stumbled across that I don't believe I've seen in any of the other online docs. (Stas, maybe you can suck this into the guide if you think it's something new...) In doing some tweaking on one of our modperl servers earlier this week, I noticed via 'truss' that a bunch of 'stat's were being done for non-existent files. The fact that they are non-existent is cool, because it's a site that has no document root, its sole purpose is to dynamically generate and cache date bar images in a bunch of different styles (http://date.boston.com/, BTW.) But I didn't like the thought that these stat calls were happening for each request. So, my solution was to add the following to the VirtualHost section for that host: VirtualHost 199.95.74.82:80 . . PerlTransHandler "sub { return OK; }" . . /VirtualHost This has the effect of short circuiting the normal TransHandler processing of trying to find a filesystem component that matches the given URI -- no more 'stat's! For this vhost, I was able to apply this globally, but I can imagine cases where others have portions of a document tree that are static along with portions that are dynamic, and needing to supply a bit more sophisticated TransHandler routine to only return OK if the requested URI matches the dynamic portions of the document tree. If anyone has a better way of handling this, or a pointer to somewhere in the book or online where this is discussed, I'll be happy to hear of it. Steve -=-=-=-=-=-=-=-=-=- My God! What have I done? =-=-=-=-=-=-=-=-=-= Steve Reppucci 617/929-7003 Director of Software Development [EMAIL PROTECTED] Boston.com (Times Company Digital) Be Open
Re: Caucho tested on Apache with DSO
Hi Tom, I made the assumption that DSO support would affect all content engines equally. Since it's only the relative numbers that matter, a uniform 5% hit wouldn't affect the benchmark results. It's the same as if the benchmarks were run on a 5% slower CPU. 5% is really in the noise. The real problem isn't the 5% that each engine might be affected by DSO, it's the big question of whether the benchmarks are representative. For example, mod_perl gets killed by adding function calls to the benchmark while Java isn't affected. I suspect if I added field references, Perl and PHP would start losing badly. In other words, as the benchmark becomes more realistic, Java performance looks even better against Perl and PHP. So, if anything, the benchmark is biased in favor of mod_perl and php. -- Scott Renzo Tom` wrote: Hi there, on http://www.caucho.com/articles/benchmark.html you mention the following: quote Apache configurations used Apache 1.3.9. All modules were compiled with DSO support. /quote Why has this been done? On http://www.apache.org/docs/dso.html you can find a few disadvantages of DSO: quote The server is approximately 5% slower at execution time under some platforms because position independent code (PIC) sometimes needs complicated assembler tricks for relative addressing which are not necessarily as fast as absolute addressing /quote Please make sure DSO isn't a slowdown factor on your machines, benchmarks only count for something when done fairly. Cheers! -Renzo
Permanent full-time position available in Montreal
Hi, I am not a recruiter (I read this list). I would be your co-worker! BCE Emergis in Montreal, Quebec is looking for a web developper who has experience with mod_perl and apache (as we are hiring to work on a site using such) as well as Oracle. You won't necessarily be limited to those platforms if you have other experience (we take care of several different sites on different platforms, but need someone especially dedicated to the mod_perl/apache/oracle project). This is a permanent full time job. We also are looking for a great graphics/html person with potential for other types of web programming (javascript, asp, perl, mod_perl, - if you can learn it you will do it). If you have ALL of these qualifications, you will be a shoe-in, but we do need two people. Maria Here is the official job ad for the first position (which I am supposed to post to our web site - http://www.emergis.com). I haven't edited the second one yet. * BCE Emergis is seeking an individual to join our team of Web Developers who are responsible for the development and maintenance of the company's internet presence. The candidate should have previous experience in web site management and a good understanding of different development platforms as well as Internet services. Experience in technical documentation, graphic design and creative content are definite assets. The candidate will be responsible for daily maintenance as well as future development of the various web presences for the company. Requirements : - Sound knowledge of HTML - Good knowledge of Perl and Oracle (SQL) - Knowledge of other programming languages (ASP, JavaScript and Java) and graphic design software are important assets - autonomous - Ability to write and speak in both official languages - Quick learner - Ability to work in a team - B.A. or equivalent experience in a related field required Should you feel that you qualify for this position, please forward your curriculum vitae with examples of your work to: Webmaster, e-News Services [EMAIL PROTECTED]
Re: ANNOUNCE: Apache::Filter 1.06
Ken Williams wrote: Changes: - Added 'handle' parameter to filter_input(), which lets callers open the input filehandle themselves. [[EMAIL PROTECTED] (Vegard Vesterheim)] Hi Ken. I've figured out that using this, I can *cheat* and get Apache::Filter to work with my handler whereas I could not get it to work before. Let me explain. I've got a PerlHandler called "MJS::AppServer" which was configured as: Location /myapps/ SetHandler perl-script PerlHandler MJS::AppServer /Location Basically what this handler does is accept a URI like: /myapps/CreateUser and the handler sees that "CreateUser" is in the path info. Because of this, it does "my $app = MJS::Applications::CreateUser-new($r); $app-service();" (well it does more, but that is the basic thing it does). Anyway, when using previous versions of Apache::Filter with this handler, I would get "NOT_FOUND" returned because of course, Apache::Filter cant open /myapps/CreateUser.. it just plain does not exist... Neither does the directory /myapps. But, using this version, in AppServer.pm, I am able to do: if (lc $r-dir_config('Filter') eq 'on') { $r-filter_input(handle=1); } And everything is fine from then out (I usually pass it through Apache::SSI). So now we use it like: PerlHandler MJS::AppServer Apache::SSI And it all works. Maybe you could consider making a dir_config() directive to get this behaviour? Something like "Filter_No_Input On" to say that there is no input for the first handler and the first handler provides the output itself? That way I dont have to resort to abusing the "handle" argument to get the desired behavior :) Or is there a different way to do this that I am missing? Thanks. Mike Schout
(USA-DC) Perl/Apache/mod_perl jobs
My name is James Holmes, and I work at Liquidation.com. We have a small full-time staff of developers and are looking to enlarge it greatly. I need senior, mid-level and junior developers fluent in Perl and mod_perl, and Mysql/Oracle and C/C++ experience would be great. Ideally, you've architected, designed and/or implemented large, scalable websites (many millions of hits a day) with Linux and Apache, Perl and Mysql/Oracle. That would be perfect--if that's you, stop reading and hit "reply" now! If that's not exactly you, but you enjoy Perl and mod_perl work, have a strong sense of software engineering (building for robustness, quality, and relibility) as well as some demonstrable experience, we may be right for you. You should have a desire to work for a fun, rapidly growing Washington DC internet start-up in the hot B2B space. You should want to learn new technologies and rapidly deploy large scalable systems. We do fun things here, in an exciting market space (B2B online auctions). Check us out at http://www.liquidation.com/ -- we've got our act together, we're building lots of interesting features and systems, and we need quality people to work on our challenging projects. We pay competitively and have good stock options, and a great work environment... we just need more quality people to help us build everything we`ve got in mind! Interested? I sure hope so! Please e-mail your resume/work experience info/URLs/etc. to [EMAIL PROTECTED] James Holmes - [EMAIL PROTECTED] Project Lead - http://www.liquidation.com/
Re: cross site scripting security issue headsup
On Wed, 2 Feb 2000, Marc Slemko wrote: http://www.apache.org/info/css-security/ http://www.cert.org/advisories/CA-2000-02.html I think I have found a little typo/oversight in the mod_perl example on http://www.apache.org/info/css-security/encoding_examples.html It uses escape_html rather then escape_uri on the href line, here is a tiny patch. Cheers, - Sander van Zoest [EMAIL PROTECTED] High Geek(858) 623-7442 MP3.com, Inc. http://www.mp3.com/ See you at ApacheCon 2000 - Your premiere Music Service Provider (MSP) diff -C3 -r1.4 encoding_examples.html *** encoding_examples.html 2000/02/02 19:26:03 1.4 --- encoding_examples.html 2000/02/03 00:23:54 *** *** 139,145 $Text = "foolt;bgt;bar"; $URL = "foolt;bgt;bar.html"; $r-gt;print(Apache::Util::escape_html($Text), "lt;BRgt;"); ! $r-gt;print("lt;A HREF=\"", Apache::Util::escape_html($URL), "\"gt;linklt;/Agt;"); /PRE PThis uses the same functions as in the Apache Module Example, called --- 139,145 $Text = "foolt;bgt;bar"; $URL = "foolt;bgt;bar.html"; $r-gt;print(Apache::Util::escape_html($Text), "lt;BRgt;"); ! $r-gt;print("lt;A HREF=\"", Apache::Util::escape_uri($URL), "\"gt;linklt;/Agt;"); /PRE PThis uses the same functions as in the Apache Module Example, called
Jobs: San Diego/CA, MP3.com, Inc.
Since we are still somewhat on the jobs thread. I just wanted to point out that MP3.com is still looking for apache/*ml/perl/modperl coders, interested in working intense hours while bringing the music industry onto the net. We run most of our site using open source tools and try to contribute back as much as we can. We primarily run on FreeBSD and Linux. Any other useful and related skills are always wanted as well. Security, Unix and general knowledge of building secure architectures and protocols are a big plus. Plenty of benefits from free food, drinks to health, dental to espp, options for those who are interested in working hard with our team of excellent engineers. Learn from us as we hope to learn from you! Please submit your resume (text/plain please) to [EMAIL PROTECTED] and feel free to contact me for more information. Cheers, - Sander van Zoest [EMAIL PROTECTED] High Geek(858) 623-7442 MP3.com, Inc. http://www.mp3.com/ See you at ApacheCon 2000 - Your premiere Music Service Provider (MSP)
Re: cross site scripting security issue headsup
Doh, thanks, fixed. I thought about not putting the mod_perl specific one in there at all (ie. just the CGI.pm one, and I had removed it, so the error probably came about when I put it back in), but figured I should include it for some reason. Don't know what that reason is. Oh well. On Wed, 2 Feb 2000, Sander van Zoest wrote: On Wed, 2 Feb 2000, Marc Slemko wrote: http://www.apache.org/info/css-security/ http://www.cert.org/advisories/CA-2000-02.html I think I have found a little typo/oversight in the mod_perl example on http://www.apache.org/info/css-security/encoding_examples.html It uses escape_html rather then escape_uri on the href line, here is a tiny patch. Cheers, - Sander van Zoest [EMAIL PROTECTED] High Geek(858) 623-7442 MP3.com, Inc. http://www.mp3.com/ See you at ApacheCon 2000 - Your premiere Music Service Provider (MSP)
lookup_uri and access checks
I have code that contains the line: $r-lookup_uri( $r-param( 'pm_uri' ) )-filename; The parameter pm_uri is a hidden form field that contains a URI for a file. I use lookup_uri() to translate that (eventually) into an absolute filename. However, if I have an access restriction that forbids access to files ending in a .pm extension and the URI maps to such a filename, then I get a "client denied by server confiruation" message in the error log. (Not surprising.) However, I'm still able to read the file myself from within the handler routine. (This is the desired behavior and it's also not surprising. I want to forbid *direct* access to .pm files by a client so user's can't see the contents, but still have them accessible to my handler.) What I'd like, though, is to resolve a URI to a filename *only* and not have Apache do access checks so I don't get a spurious "client denied" error. Is there any way to do this? - Paul
Re: Using network appliance Filer with modperl
On Wed, 2 Feb 2000, Stas Bekman wrote: Date: Wed, 2 Feb 2000 22:03:38 +0200 (IST) From: Stas Bekman [EMAIL PROTECTED] To: Oleg Bartunov [EMAIL PROTECTED] Cc: mod_perl list [EMAIL PROTECTED] Subject: Re: Using network appliance Filer with modperl On Wed, 2 Feb 2000, Oleg Bartunov wrote: On Wed, 2 Feb 2000, Stas Bekman wrote: Date: Wed, 2 Feb 2000 20:21:20 +0200 (IST) From: Stas Bekman [EMAIL PROTECTED] To: Pascal Eeftinck [EMAIL PROTECTED] Cc: mod_perl list [EMAIL PROTECTED] Subject: Re: Using network appliance Filer with modperl # DESTROY makes all kinds of cleanups if the fuctions were interuppted # before their completion and haven't had a chance to make a clean up. ### sub DESTROY{ my $self = shift; $self-sql_unlock_tables() if defined $self-{lock}; $self-{sth}-finish if defined $self-{sth} and $self-{sth}; $self-{dbh}-disconnect if defined $self-{dbh} and $self-{dbh}; } # end of sub DESTROY Stas, are you sure DESTROY executed when children died ? I'm using ApacheDBI and have problem with DESTROY when I use finish or disconnect methods. Of course! This works for me: die.pl use MyRun; print "Content-type: text/plain\n\n"; print "hi\n"; my $obj = new MyRun; die "dying..."; print "End of program\n"; MyRun.pm package MyRun; sub new{ return bless {}, shift;} DESTROY{ print STDERR "destructor was called\n";} 1; Such simple DESTROY works for me also. The disconnect method shouldn't work as it gets overriden by Apache::DBI with NOP. However finish() is supposed to work. I'm not sure it works: sub disconnect { my $self = shift; $self-sth_finish; warn "STH finished...\n"; $self-{dbh}-disconnect; warn "DB disconnected...\n"; } sub sth_finish { my $self = shift; foreach my $sth (keys %query) { $self-{$sth}-finish; } } sub DESTROY { my $self = shift; $self-disconnect; print STDERR "DB requests:PID:",$$,':', $self-total_db_requests(),"\n"; } I never get debug messages in error log. But If I comment all calling of methods I got what I expected. sub disconnect { my $self = shift; # $self-sth_finish; warn "STH finished...\n"; # $self-{dbh}-disconnect; warn "DB disconnected...\n"; } sub DESTROY { my $self = shift; $self-disconnect; print STDERR "DB requests:PID:",$$,':', $self-total_db_requests(),"\n"; } This behaivour doesn't depends whether or not I use ApacheDBI Another question: It seems DESTROY doesnt' executed when apache+mod_perl chidlren get killed :-) Regards, Oleg ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com _ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83
Re: ASP Application variable; StatINCMatch variable
[EMAIL PROTECTED] wrote: Joshua, I am enclosing parts of the log file. I turned the Debug variable to 2 in httpd.conf. However, I am not using global.asa or Session_OnEnd routine. When the user session times out and he clicks on any hyperlink, he gets redirected to another html file (forcelogout.html) which tries to use this Application variable to do some cleanup. In the log, you'll see a couple of print statements that I've put in forcelogout.html. You should use Session_OnEnd for this, that is what it is there for :) What is happening is that the Application_OnEnd is occuring, resetting the contents of $Application, which happens after the last users Session_OnEnd. You should do user session garbage collection in Session_OnEnd, and you will still have access to $Application data there. The only thing you can tell a user for certain after a session is destroyed is that they need to login again, and that timeouts occur after Apache-dir_config(SessionTimeout) minutes, if set. --Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051