How to handle the main parent exit
Hello, I would like to know if it's possible to handle the Apache's main parent exit event. I want call a method to clean some died datas (like shared memory segments). best regards, -- ___ O l i v i e rP o i t r e y
RE: How to handle the main parent exit
-Original Message- From: Olivier Poitrey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 8:08 AM To: [EMAIL PROTECTED] Subject: How to handle the main parent exit Hello, I would like to know if it's possible to handle the Apache's main parent exit event. I want call a method to clean some died datas (like shared memory segments). use Apache-server-register_cleanup(); from your startup.pl HTH --Geoff
[DIGEST] mod_perl digest 2001/08/25
-- mod_perl digest August 19, 2001 - August 25, 2001 -- Recent happenings in the mod_perl world... Features o mod_perl status o cvs patches o module announcements o mailing list highlights o news o links mod_perl status o mod_perl - stable: 1.26 (released July 11, 2001) [1] - development: 1.26_01-dev [2] o Apache - stable: 1.3.20 (released May 15, 2001) [3] - development: 1.3.21-dev [4] o Perl - stable: 5.6.1 (released April 9, 2001) [5] - development: 5.7.2 [6] cvs patches o allow overriding of container directive handlers using the func parameter [7] o require URI::URL to work with newer libwww-perl [8] [9] module announcements o Apache::ACEProxy 0.01 - a mod_perl based HTTP proxy server which handles internationalized domain names correctly, automatically detecting IDNs in Host: header and converting them to ACE encoding [10] o HTML::Template 2.4 - makes using HTML templates simple and natural by extending standard HTML with a few new HTML-esque tags [11] o HTML::Template::Expr 0.01 - an extension to HTML::Template which allows expressions in the template syntax [12] mailing list highlights o Long thread of the week goes to this [13] one, which takes a few turns but has some useful information about the nature of Apache::DBI o Apparently an API change to LWP::UserAgent from the latest version of libwww-perl is causing a few problems. You can read about them and find a few solutions here [14] [15] o If you are a native German speaking mod_perl expert, you may want to check this out [16] news o take23.org and axkit.org are going to be down for a few weeks until Matt gets settled in his new digs o Perrin's Choosing a Templating System article/TPC5 presentation can is featured on perl.com [17] links o The Apache/Perl Integration Project [18] o mod_perl documentation [19] o mod_perl modules on CPAN [20] o mod_perl homepage [21] o mod_perl news and advocacy [22] o mod_perl list archives - modperl@ [23] [24] - dev@ [25] happy mod_perling... --Geoff [EMAIL PROTECTED] -- [1] http://perl.apache.org/dist/ [2] http://perl.apache.org/from-cvs/modperl/ [3] http://www.apache.org/dist/httpd/ [4] http://dev.apache.org/from-cvs/apache-1.3/ [5] http://www.cpan.org/src/stable.tar.gz [6] http://www.cpan.org/src/devel.tar.gz [7] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=99876968513781w=2 [8] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=99885063100367w=2 [9] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=99885072400491w=2 [10] http://forum.swarthmore.edu/epigone/modperl/fulclerblimp [11] http://forum.swarthmore.edu/epigone/modperl/parlumjo [12] http://forum.swarthmore.edu/epigone/modperl/helwhorprex [13] http://forum.swarthmore.edu/epigone/modperl/phoiclandbil [14] http://forum.swarthmore.edu/epigone/modperl/sehpholzhex [15] http://forum.swarthmore.edu/epigone/modperl/zhenphimgrand [16] http://forum.swarthmore.edu/epigone/modperl/yelprelgrou [17] http://www.perl.com/pub/a/2001/08/21/templating.html [18] http://perl.apache.org [19] http://perl.apache.org/#docs [20] http://www.cpan.org/modules/by-module/Apache/ [21] http://www.modperl.com [22] http://www.take23.org [23] http://forum.swarthmore.edu/epigone/modperl/ [24] http://marc.theaimsgroup.com/?l=apache-modperlr=1w=2 [25] http://marc.theaimsgroup.com/?l=apache-modperl-devr=1w=2
Re: mod_perl memory consumption
I wrote a program that converts 5 gigs of emails stored in mysql to phisical messages on disk (resulting in approximately 10 gigs). The program consumes way to much memory although I've wrote it in a very clean way (use strict, no globals, use of udef $var; to help free memory). I start it telneting to :80 and through time process takes from 15 megs to more than 100 megs and only about 20% of messages are converted so far. The program uses vpopmail.pm and should run approximately one day. Maybe it would be faster if I used Apache::FakeRequest or something similar eleminating use of mod_perl (plain cgi) ? I'm using HTML::Mason. It will definitely not be faster if you use CGI. It may take care of your memory problems, but only by avoiding them. You should be able to fix the problem in your code and use mod_perl for this. Why is the memory consumption so high ? According to my calculations it should take less than 100 kilobytes. What are you basing that on? It sounds like you have some data structure which you are adding to and never clearing out. One thing to be careful of is the MySQL DBI driver. The last time I used it, it fetched all returned rows into memory. With a large result set, that could take up tons of RAM. - Perrin
Re: mod_perl memory consumption
[EMAIL PROTECTED] (Perrin Harkins) wrote: It sounds like you have some data structure which you are adding to and never clearing out. One thing to be careful of is the MySQL DBI driver. The last time I used it, it fetched all returned rows into memory. With a large result set, that could take up tons of RAM. Right, that sounds like the culprit. Miroslav, see the 'mysql_use_result' parameter in 'perldoc DBD::mysql', which will let you store the result in a mysql server table rather than in client memory. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Authen question
Hello I want to know if there is a way to show a page or another to some users depending in their logins. I have two users poiting to the same URL. But I dont want userA to see page B, and I dont want userB to see pageA. Thanks a lot Gustavo A. Lozano I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. Albert Einstein
Re: subscription
UNSUBSCRIBE
Re: Perl/Apache question
UNSUBSCRIBE
is anyone getting my messages
Just wonderingI have posted a couple of questionswith no avail Am I posting? -- === Medi Montaseri, [EMAIL PROTECTED], 408-450-7114 Prepass Inc, IT/Operations, Software Eng. ===
Environment variables and mod_perl
I'm working on a project that is highly configurable via environment variables. I'd like a way to get those environment variables into my mod_perl processes so that the mod_perl portion of this project can be configured the same way as the non mod_perl portions. I know that I can use PerlSetEnv and PerlPassEnv. I've used these with my current configuration and they work. The problem is this: I'd like a method to do this flexibly so that when one of my team created a new configuration environment variable, they don't need to change two files, the environment setup shell script and the httpd.conf file! All the environment variables begin with the name of our company in upper case letters, followed by an underscore character. This code prints them all out just perfectly outside of mod_perl: [tmornini@millenium conf]$ perl for my $env ( grep /^EWINGZ_/,keys %ENV ) { print $env\n; } EWINGZ_DBI_USERNAME EWINGZ_ERROR_DB EWINGZ_CODE_BASE EWINGZ_ASSERT_ASSERTIONS EWINGZ_LOG_FILE EWINGZ_LOG_BASE EWINGZ_LOG_SPREAD_GROUP EWINGZ_HOST_NAME EWINGZ_OBJECT_WO EWINGZ_LOG_UPPER_LEVEL EWINGZ_SPREAD_NAME EWINGZ_LOG_OBJECT EWINGZ_DBI_PASSWORD EWINGZ_LOG_LOWER_LEVEL EWINGZ_DBI_DATASOURCE EWINGZ_OBJECT_PR EWINGZ_OBJECT_RO EWINGZ_OBJECT_RW However, this code doesn't work so well in a Perl section in httpd.conf: Perl open FH,'/tmp/env.txt'; for my $env ( grep /^EWINGZ_/,keys %ENV ) { push @PerlPassEnv,$env; print FH $env\n; } print FH All done\n; close FH; /Perl After startup, 1) The environment variables are NOT passed and 2) /tmp/env.txt contains a single line: All done which means that at startup, these environment variables aren't available to Perl sections, either. This does jive with page 423 of the Eagle book. Stas' excellent Guide is somewhat confusing on this subject: http://perl.apache.org/guide/config.html To pass all environment variables to the children with a single configuration directive, rather than listing each one via PassEnv or PerlPassEnv, a Perl section could read in a file and: But this won't work for the same reason as above, namely, the environment variables are visible at that time, and I don't want to write a Perl script to parse a sh script! :-) Also, I think that pushing an arrayref into @PerlPassEnv doesn't seem to make sense since PerlPassEnv only takes a single argument. Looks like this is an error that the line should read: push @PerlSetEnv, [ $key = $val ]; Or have I been smoking again? :-) How can I get around this? Thanks for everyone's time and attention! Configuration: Server Version: Apache/1.3.20 (Unix) mod_perl/1.26 Server Built: Aug 28 2001 22:53:29 mod_perl.c, mod_log_spread.c, mod_access.c, mod_rewrite.c, mod_info.c, mod_status.c, mod_mime.c, http_core.c Linux version 2.4.2-2 ([EMAIL PROTECTED]) (gcc version 2.96 2731 (Red Hat Linux 7.1 2.96-79)) #1 Sun Apr 8 20:41:30 EDT 2001 -- Tom Mornini -- eWingz Systems, Inc. -- ICQ 113526784
[PATCH] $r-print won't print reference to PVIV or PVMG
There's a bug in the write_client routine where it won't print a reference to a scalar that has been upgraded from a PV. A string comparison will usually trigger an upgrade to PVIV. Additionally, with PerlTaintCheck on, a tainted scalar will be a PVMG, because the tainted flag is magic. At first I thought the latter could be intentional behavior, but passing the string itself instead of a reference was allowed, so it appears to be just an oversight. The attached patch fixes both of these cases. -- Stephen Clouse [EMAIL PROTECTED] Senior Programmer, IQ Coordinator Project Lead The IQ Group, Inc. http://www.theiqgroup.com/ diff -ru mod_perl-1.26.orig/src/modules/perl/Apache.xs mod_perl-1.26/src/modules/perl/Apache.xs --- mod_perl-1.26.orig/src/modules/perl/Apache.xs Fri Jul 6 15:15:04 2001 +++ mod_perl-1.26/src/modules/perl/Apache.xsTue Aug 28 20:47:37 2001 @@ -1171,7 +1171,7 @@ for(i = 1; i = items - 1; i++) { int sent = 0; -SV *sv = SvROK(ST(i)) (SvTYPE(SvRV(ST(i))) == SVt_PV) ? +SV *sv = SvROK(ST(i)) (SvTYPE(SvRV(ST(i))) == SVt_PV || +SvTYPE(SvRV(ST(i))) == SVt_PVIV || SvTYPE(SvRV(ST(i))) == SVt_PVMG) ? (SV*)SvRV(ST(i)) : ST(i); buffer = SvPV(sv, len); #ifdef APACHE_SSL PGP signature
Re: Upgrading modperl
On Tue, 28 Aug 2001, Castellon, Francisco wrote: Hi folks: What i am running : Win98, Apache 1.3.20, mod_perl 1.25, Apache::ASP 2.17, ActivePerl 5.0.1 (build 626). I want to upgrade to mod_perl 1.26 from version 1.25. What do i have to do? But also i have installed a few other apache packages that rely on mod_perl to work, like apache::asp. Would upgrading version ruin my current configuration forcing me to reinstall every other apache package that relies on mod_perl? or is it just a simple matter of running the ppm installer for mod perl? Pure perl Apache modules are probably fine with the upgraded mod_perl, which should be installable by ppm. XS-based modules though, like Embperl, AxKit, or libapreq, may require upgrades - those modules that are available at http://theoryx5.uwinnipeg.ca/ppmpackages/ are compiled against the latest mod_perl/Apache versions. Also, you can in principle run into compatibility problems between different mod_perl and Apache versions, but since you're running Apache 1.3.20 you should be fine, as this was the version the mod_perl-1.26 ppm package was compiled against. best regards, randy kobes
Re: Apache::DBI Oracle LOB problem
This problem was fixed by upgrading Oracle to 8.1.7 -Steve Robert Landrum wrote: At 2:15 AM +0100 8/2/01, Tim Bunce wrote: On Mon, Jul 30, 2001 at 04:57:09PM -0400, Steven Schmidt wrote: The following problem came up in porting EnsEMBL to Oracle: Level 9 DBI trace: OCIStmtExecute(62c0ec,6363d0,62c310,0,0,0,0,0)=SUCCESS OCIAttrGet(6363d0,4,ffbeebea,0,10,62c310)=SUCCESS dbd_st_execute SELECT returned (SUCCESS, rpc0, fn4, out0) - execute= '0E0' at /usr/local/apache/perl/foo.pl line 34 fetchrow_array DISPATCH (DBI::st=HASH(0x381d1c) rc1/1 @1 g1 a0) at /usr/local/apache/perl/foo.pl line 35 - fetchrow_array for DBD::Oracle::st (DBI::st=HASH(0x381d1c)~0x384ecc) dbd_st_fetch 4 fields... OCIStmtFetch(6363d0,62c310,1,2,0)=SUCCESS dbih_setup_fbav for 4 fields = 0x384c8c dbd_st_fetch 4 fields SUCCESS 0 (rc=0): '484' OCILobGetLength(62c0ec,62c310,62a4d4,ffbee9dc)=SUCCESS OCILobRead(62c0ec,62c310,62a4d4,ffbee9d8,1,782808,136351,0,0,0,1)=STIL L_EXECUTING That's almost certainly an Oracle bug. DBD::Oracle doesn't enable non-blocking mode of the OCI so, as far as I know, the OCI should never return STILL_EXECUTING. I'm sure I've seen this before... On a really old version of DBD::Oracle. One of my selects was failing on a string greater than 140k... It was under linux, RH 5.1, DBD::Oracle 0.96, DBI 1.00. I can't remember exactly what error I got, but upgrading DBD::Oracle seemed to fix the problem. Rob Talk to Oracle about it. No need to mention DBD::Oracle... just send them the trace after removing lines that don't match /\bOCI\w+\(/ :-) Tim. -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX. -- Steven Schmidt snp.cshl.org www.gramene.org Cold Spring Harbor Laboratory 516-367-6977