Re: mod_perl_traps my($var) = '';
my ($var) = (''); Vasily Petrushin +7 (095) 2508363 http://www.interfax.ru mailto:[EMAIL PROTECTED]
Can anyone help please
Hi everyone, I have to make the tracking of users who follow links to external sites possible, preferably indicating in specific logfiles when a new browser is opened for linking to external sites. We have tried proxy solutions, modifying Apache core modules and are considering scanning and parsing our Html on the fly. I understand that uri.c could be modified or changes could be made to the .htaccess file. The problem is it has to be fast and transparant, does anyone have any ideas??? Thanks in advance Steve Smith
modperl book chapter 7 - correction
I don't know if anyone has mentioned this before (it is still wrong on www.modperl.com), but as far as I can see the 'Apache::DefaultTrans' example in chapter7 of the modperl book contains an error, the line: if($uri !~ m:^/: or index($uri, '*')) { should really be: if($uri !~ m:^/: or index($uri, '*') != -1) { because index returns -1 if the substring does not exist, and -1 evaluates as true. Kees Vonk Internet Programmer 7249 27705 __ The views expressed in this email are not necessarily the views of Transco plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. This e-mail, and any attachments are strictly confidential and intended for the addressee(s) only. The content may also contain legal, professional or other privileged information. If you are not the intended recipient, could you please notify the sender immediately and then delete the e-mail and any attachments, you should not disclose, copy or take any action in reliance of this transmission. Unless expressly stated to the contrary, no contracts may be concluded on behalf of Transco plc by means of e-mail communication. You may report the matter by calling us on +44 (0)1455 230999. You should not copy, forward or otherwise disclose the contents of this e-mail or any of its attachments without express consent. Please ensure you have adequate virus protection before you open or detach any documents from this transmission. Transco plc does not accept any liability for viruses. Transco plc is part of Lattice Group Transco plc is registered in England: Company number: 2006000 Registered Office: 130 Jermyn Street, London, SW1Y 4UR http://www.transco.uk.com
[DIGEST] mod_perl digest 02/07/01
-- mod_perl digest February 11, 2001 - February 17, 2001 -- Recent happenings in the mod_perl world... Features o mod_perl status o module announcements o mailing list highlights o links mod_perl status o mod_perl - stable: 1.25 (released January 29, 2001) [1] - development: 1.25_01-dev [2] o Apache - stable: 1.3.17 (released January 29, 2001) [3] - development: 1.3.18-dev [4] o Perl - stable: 5.6 (released March 23, 2000) [5] - development: 5.7 [6] module announcements o HTML::Embperl 1.3.1 - a module for embedding Perl code in HTML pages that includes building pages/sites out of small reusable objects/components and session handling [7] o Apache::Toolkit (beta) - a mod_perl / Apache interface to Template::Toolkit [8] o AxKit 1.3 - XML Application Server for Apache. It provides on-the-fly conversion from XML to any format, such as HTML, WAP or text using either W3C standard techniques, or flexible custom code. [9] mailing list highlights o A few non-mod_perl modules were announced this week on the list: Cache::Cache 0.01 - successor to File::Cache and IPC::Cache [10] lingerd 0.93 - daemon that manages closing sockets for Apache [11] o $r-path_info seems to be gaining lots of attention of late. Here is a thread that examines the difference between calling it when the URI translates to a real file versus a virtual one. [12] o Long thread of the week goes to trying to integrate cron-like functionality within Apache [13] o Apache::LogSTDERR is looking to a maintainer [14] o The O'Reilly Network is looking for article authors [15] [16] links o The Apache/Perl Integration Project [17] o mod_perl documentation [18] o mod_perl modules on CPAN [19] o mod_perl homepage [20] o mod_perl news and advocacy [21] o mod_perl list archives [22] [23] 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/ [4] http://dev.apache.org/from-cvs/apache-1.3/ [5] http://www.perl.com/pub/language/info/software.html#stable [6] http://www.perl.com/pub/language/info/software.html#devel [7] http://forum.swarthmore.edu/epigone/modperl/grunswundoi [8] http://take23.org/news/2001/02/16/apacheTemplate.xml [9] http://forum.swarthmore.edu/epigone/modperl/jolbunyang [10] http://forum.swarthmore.edu/epigone/modperl/flouchypou [11] http://forum.swarthmore.edu/epigone/modperl/zorprayplil [12] http://forum.swarthmore.edu/epigone/modperl/stixfrandshul [13] http://forum.swarthmore.edu/epigone/modperl/swydwozhoo [14] http://marc.theaimsgroup.com/?l=apache-modperl-devm=98219639413337w=2 [15] http://forum.swarthmore.edu/epigone/modperl/breejexswee [16] http://forum.swarthmore.edu/epigone/modperl/chuncrumrerd [17] http://perl.apache.org [18] http://perl.apache.org/#docs [19] http://www.cpan.org/modules/by-module/Apache/ [20] http://www.modperl.com [21] http://www.take23.org [22] http://forum.swarthmore.edu/epigone/modperl/ [23] http://marc.theaimsgroup.com/?l=apache-modperlr=1w=2
RE: [RESEND] seg fault with Apache::URI ... weird
-Original Message- From: Jeffrey W. Baker [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 08, 2001 4:47 PM To: Nick Tonkin Cc: [EMAIL PROTECTED] Subject: Re: [RESEND] seg fault with Apache::URI ... weird [snip] just to put everyone on the same page, looks like this is now fixed in 1.3.19-dev? --Geoff I've debugged the problem, but have no solution: my $uri = Apache::URI-parse($r, $r-uri); This calls ap_parse_uri_components(), which is responsible for setting the scheme, hostname, user, password, port, path, etc. But, the scheme is not getting set, because the request line only contains "/path" or such. $uri-hostname($r-get_server_name); $uri-port($r-get_server_port); These work fine. print $uri-unparse; This calls ap_unparse_uri_components(). If there is a hostname but no scheme, ap_unparse_uri_components() will pass a null argument to strcasecmp, which will cause an invalid memory access and SIGSEGV. You can work around the problem by including $uri-scheme('http'); with the other accessor methods. In the long run this is probably a bug in Apache. If you read src/main/util_uri.c in Apache, you can see why commenting out one accessor avoids the crash. Regards, Jeffrey Baker
Re: mod_perl_traps my($var) = '';
[EMAIL PROTECTED] (Helios de Creisquer) wrote: I used at beginning of script: ... my($var) = ''; ... I know this is a little dirty... everyway, It seems that when mod_perl encouter a 'my' statement, it doesn't evaluate it again next time the script is executed. [EMAIL PROTECTED] (Vasily Petrushin) wrote: my ($var) = (''); That's not the problem. See http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S . It's a bit long, but thorough. Especially see "The Remedy" section. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: Can anyone help please
More details please. Are you referring to an intranet where your users are inside and you want to track them (cuz you talk about being able to control their proxy?) or are you talking about some other scenario? At 10:24 AM 2/20/01 +, Smith, Stephen (ELS) wrote: Hi everyone, I have to make the tracking of users who follow links to external sites possible, preferably indicating in specific logfiles when a new browser is opened for linking to external sites. We have tried proxy solutions, modifying Apache core modules and are considering scanning and parsing our Html on the fly. I understand that uri.c could be modified or changes could be made to the .htaccess file. The problem is it has to be fast and transparant, does anyone have any ideas??? Thanks in advance Steve Smith __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/
Escaped '/' (%2F) causes path_info to fail.
I have posted this problem before, but I have managed to narrow it down a lot: when I have a %2F (escaped slash) in my path_info apache returns a 404 File Not Found error, any other escaped characters seem to be alright I have no idea whether this is a problem with apache, modperl or mason. Can anyone reproduce or explain this behaviour. I am using apache 1.3.17, modperl 1.25 on HPUX 10.20. Please can anyone help me with this, it is causing real problems. Kees Vonk __ The views expressed in this email are not necessarily the views of Transco plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. This e-mail, and any attachments are strictly confidential and intended for the addressee(s) only. The content may also contain legal, professional or other privileged information. If you are not the intended recipient, could you please notify the sender immediately and then delete the e-mail and any attachments, you should not disclose, copy or take any action in reliance of this transmission. Unless expressly stated to the contrary, no contracts may be concluded on behalf of Transco plc by means of e-mail communication. You may report the matter by calling us on +44 (0)1455 230999. You should not copy, forward or otherwise disclose the contents of this e-mail or any of its attachments without express consent. Please ensure you have adequate virus protection before you open or detach any documents from this transmission. Transco plc does not accept any liability for viruses. Transco plc is part of Lattice Group Transco plc is registered in England: Company number: 2006000 Registered Office: 130 Jermyn Street, London, SW1Y 4UR http://www.transco.uk.com
[admin] (was RE: Can anyone help please)
On Tue, 20 Feb 2001, Smith, Stephen (ELS) wrote: Gunther, The scenario is we have a corporate website which allow freelance maintainers to product branded areas, as those arease are not administered our apache server must modify their html pages on the fly and open a new browser window whilst logging to a distinct log file. More details please. Are you referring to an intranet where your users are inside and you want to track them (cuz you talk about being able to control their proxy?) or are you talking about some other scenario? ---8- admin -8-- admin --8--- Folks, please try to cite emails properly! The way some of you handle email replies really sucks. This particular email I reply to is a good example of how you shouldn't do it. We ask you to do that for two reasons: 1. help us to help you (many of us skip badly written emails) 2. for email archives to be usefull. (it's impossible to understand who has replied to whom and why when the quoting is done improperly) Here is a nice and short write-up on how to do the Right Thing (tm): http://www.email.about.com/internet/email/library/weekly/aa011000a.htm Thank you! ---8- admin -8-- admin --8--- _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
number of pgsql childrens on persistant DBI connection
Hi all, on my DB server I have 245 "idle" postmasters process for 130 httpd persistant DB connections alive. can anyone give me a clue how to manage this number of unused/idleschildren and how to have them quickerly deallocated ? this way, I jumptoo quick on 'too much connection'... Emmanuel -- EDENJOB / APR-Job Email: [EMAIL PROTECTED]Home:www.apr-job.com Phone: +33 1 47 81 02 41 Tatoo: +33 6 57 60 42 17 Fax: +33 1 41 92 91 54 eFAX: +44 0870-122-6748 ** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither EDENJOB/APR-JOB or affiliates shall be liable for the message if altered, changed or falsified. **
Re: number of pgsql childrens on persistant DBI connection
On Tue, 20 Feb 2001, Emmanuel Pierre wrote: Hi all, on my DB server I have 245 "idle" postmasters process for 130 httpd persistant DB connections alive. can anyone give me a clue how to manage this number of unused/idleschildren and how to have them quickerly deallocated ? this way, I jumptoo quick on 'too much connection'... Any chance that you misuse Apache::DBI? http://perl.apache.org/guide/databases.html#When_should_this_module_be_used_ Emmanuel -- EDENJOB / APR-Job Email: [EMAIL PROTECTED]Home:www.apr-job.com Phone: +33 1 47 81 02 41 Tatoo: +33 6 57 60 42 17 Fax: +33 1 41 92 91 54 eFAX: +44 0870-122-6748 ** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither EDENJOB/APR-JOB or affiliates shall be liable for the message if altered, changed or falsified. ** _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: number of pgsql childrens on persistant DBI connection
Wow! Are you sure no one else is going against your database using persistent connections? How many database handles are you using in your mod_perl apps? Each Apache child process will require one persistent connection to your database for each different database handle. If you have a database server that contains multiple databases, and you're accessing 2 different databases on the same server with your mod_perl/DBI/Apache-DBI apps, you're going to have double the number of persistent connections to your databases then you're going to have child processes. Additionally, if you use one database handle for normal interaction, and another database handle for transactions [to prevent committing a transaction across tables until all have been updated] you're going to end up with 1 persistent connection to your postgresql database for each DBI database handle, even though they are accessing the same database. I think... :) Emmanuel Pierre wrote: Hi all, on my DB server I have 245 "idle" postmasters process for 130 httpd persistant DB connections alive. can anyone give me a clue how to manage this number of unused/idleschildren and how to have them quickerly deallocated ? this way, I jumptoo quick on 'too much connection'... Emmanuel -- EDENJOB / APR-Job Email: [EMAIL PROTECTED]Home:www.apr-job.com Phone: +33 1 47 81 02 41 Tatoo: +33 6 57 60 42 17 Fax: +33 1 41 92 91 54 eFAX: +44 0870-122-6748 ** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither EDENJOB/APR-JOB or affiliates shall be liable for the message if altered, changed or falsified. ** -- ***NOTE*** This entire message is confidential, and protected by copyright. If you are not the intended recipient, you are hereby notified that any review, dissemination or archiving of this message is strictly prohibited. ** www.RentZone.org
RE: Apache::DBI::connect problem, please help
From: Geoffrey Young [mailto:[EMAIL PROTECTED]] you need both, DBI and Apache::DBI, with DBI loaded first... I tried this, but I still get the same error. see the Apache::DBI manpage for more detail That man page is the same as the DBI manpage- it doesn't include any modperl specific information. -Original Message- From: Brad Howerter To: '[EMAIL PROTECTED]' Sent: 2/19/01 6:54 PM Subject: Apache::DBI::connect problem, please help I'm getting this error: [error] Can't locate object method "connect" via package "Apache::DBI::connect" at /usr/local/lib/perl5/site_perl/5.6.0/i386-dynixptx/DBI.pm line 408. One way I can avoid the error is to change startup.pl to use DBI() instead of use Apache::DBI(). Why does that fix it? And does it hurt anything if I don't use Apache::DBI()? What's that for, anyway? Is Apache/DBI.pm supposed to be the same as the other one in the perl library? (It is) my startup.pl has this in it: #!/usr/bin/perl use strict; $ENV{MOD_PERL} or die "Not running under mod_perl!"; use Apache::Registry; use Apache::DBI (); # Tell me more about warnings use Carp; $SIG{__WARN__} = \Carp::cluck; use CGI qw(-compile :all); 1; and my test program is this: #!/usr/local/bin/perl use strict; use Carp; $SIG{__WARN__} = \Carp::cluck; use DBI; use DBD::Oracle; use CGI (); my $cgi = new CGI; print $cgi-header; my $db = DBI-connect('', 'scott', 'tiger', { } ) or die DBI::errstr; print "Connected!\n";
RE: Apache::DBI::connect problem, please help
From: Geoffrey Young [mailto:[EMAIL PROTECTED]] you need both, DBI and Apache::DBI, with DBI loaded first... I tried this, but I still get the same error. sorry, I gave you bad information - Apache::DBI needs to be loaded first... it was late :) That's okay- I've tried it both ways, and I get the same result. use Apache::DBI; use DBI; see the Apache::DBI manpage for more detail That man page is the same as the DBI manpage- it doesn't include any modperl specific information. um, not so... man Apache::DBI and man DBI should definitely yield different results. So Apache/DBI.pm must be installed incorrectly on my system. It's supposed to be different from the DBI.pm?
RE: Apache::DBI::connect problem, please help
-Original Message- From: Brad Howerter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 12:42 PM To: ''[EMAIL PROTECTED]' ' Subject: RE: Apache::DBI::connect problem, please help From: Geoffrey Young [mailto:[EMAIL PROTECTED]] you need both, DBI and Apache::DBI, with DBI loaded first... I tried this, but I still get the same error. sorry, I gave you bad information - Apache::DBI needs to be loaded first... it was late :) use Apache::DBI; use DBI; see the Apache::DBI manpage for more detail That man page is the same as the DBI manpage- it doesn't include any modperl specific information. um, not so... man Apache::DBI and man DBI should definitely yield different results. HTH --Geoff
RE: Apache::DBI::connect problem, please help
-Original Message- From: Brad Howerter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 12:57 PM To: '[EMAIL PROTECTED]' Subject: RE: Apache::DBI::connect problem, please help [snip] So Apache/DBI.pm must be installed incorrectly on my system. It's supposed to be different from the DBI.pm? yup, you need both. DBI is, well, DBI. Apache::DBI is a persistent framework under mod_perl that uses DBI. HTH --Geoff
RE: Apache-read timed out
I was just wondering if this problem could be because of CGI.pm scripts , i am running some plain CGI scripts and mod perl scripts,in some of the scripts i have the traditional read function which reads from STDIN (perl 'read' function) . Pls help ... thanks, Sachin Date: Thu, 15 Feb 2001 09:13:09 -0800 (PST) From: Sachin Lakhanpal [EMAIL PROTECTED] Subject: RE: Apache-read timed out Cc: [EMAIL PROTECTED] yes i have tried all those time out parameters . :( sachin --- Geoffrey Young [EMAIL PROTECTED] wrote: -Original Message- From: Deja User [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 7:36 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Apache-read timed out Hello , I am getting "Apache-read timed out messages in my error_log,now i have been looking at this problem for a while now before posting it for help, whats happening is if i test my application from within the network , because the connection being very fast i am not having any problems , but when i try to do the same thing from the external network over a dial up line i get this error message in the error logs and the script gets killed What we are doing is we are uploading large amts of data using HTTP POSTS ,so at the server end i am using the Apache-read function to get the body of the post. did you try playing with $r-reset_timeout and/or the Apache TimeOut directive? HTH --Geoff __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ --== Sent via Deja.com ==-- http://www.deja.com/
Odd Caching Bug
Hello, One of the developers I currently am working with has found an odd bug that can be replicated on several workstations. First my configuration : Apache 1.3.17 mod_perl 1.25 Mason (Ancient) Apache::DBI .88 Postgres 7 MaxRequestsPerChild 1 KeepAlive on We have two components that contain the following code. One of which changes a session variable (datestyle to 'ISO')on the postgres database. Theoretically the two components should return different results based on the specific datestyle settings ('ISO' and default). This only occurs when two browsers are opened independently that do not share the same session. When using ctrl-n on a windows client to open a new window it appears that they share session information and possibly the same tcp/ip connection(?). When reloading the components in the two windows eventually they both return the 'ISO' format date. After pausing for several minutes and reloading the component that DOES NOT explicitly set the 'ISO' format variable, it correctly returns the default date format. --COMPONENT 1-- %perl_init my $dbh = Edventions::Utilities-new-getDbHandle; ## Uses Apache::DBI to connect my $sql = q( select now() as today ); my $sth = $dbh-prepare( $sql ); $sth-execute; my $now = $sth-fetch-[0]; /%perl_init h1% $now % --COMPONENT 2-- %perl_init my $dbh = Utilities-new-getDatabaseHandle; ## Uses Apache::DBI to connect my $sql = q( set datestyle to 'ISO'; select now() as today ); my $sth = $dbh-prepare( $sql ); $sth-execute; my $now = $sth-fetch-[0]; /%perl_init h1% $now % Now when the apache directive KeepAlive is set to 'off' this problem does not occur. I am trying to figure out where the caching is occurring or if the database handle is not getting properly destroyed for each request. Any suggestions as to why this is occurring would be greatly appreciated. Thanks,
htaccess files and modules
I am having difficulty reading configuration commands from a .htaccess file. I've modified Apache::RefererBlock so that it no longer shows a forbidden error, but rather redirects a default URL. I need this to apply to specific directories, but do not want the hassle of having to modify the configuration for every directory. My goal is to place the configuration information into the .htaccess files within said directories. However, when I do this, I get the following error: /www/test/.htaccess: RefBlockMimeTypes not allowed here I'm not 100% sure how Apache::ModuleConfig works, but I'm guessing that it simply iterates through all the configuration parameters and checks to see if a sub by that name exists in the caller package. If so, it calls that sub. Perhaps this is not the correct module to use. I've read through the Eagle book and have found obscure references to DIR_MERGE and DIR_CREATE, but I don't understand the purposes behind these entirly. I've also read about Apache::CmdParms, but I don't know how that differs from Apache::ModuleConfig. If someone could point me to a doc explaining how to permit custom config params in .htaccess files, I would greatly appreciate it. Thanks, Robert Landrum -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
RE: htaccess files and modules
Apache::RefererBlock is forbidding all of its configuration directive from being in .htaccess files with this: req_override = 'RSRC_CONF' take a look at Makefile.PL to see it. you will want to change this to something that enables you to call it from .htaccess files, like ACCESS_CONF. Keep in mind, though, that you'll probably have to add DIR_CREATE and DIR_MERGE sections as well so that things will merge properly if you plan on placing them within directory-esque directives. Apache::Dispatch has examples of all these to use as a guide, if it helps... HTH --Geoff -Original Message- From: Robert Landrum To: [EMAIL PROTECTED] Sent: 2/20/01 7:05 PM Subject: htaccess files and modules I am having difficulty reading configuration commands from a .htaccess file. I've modified Apache::RefererBlock so that it no longer shows a forbidden error, but rather redirects a default URL. I need this to apply to specific directories, but do not want the hassle of having to modify the configuration for every directory. My goal is to place the configuration information into the .htaccess files within said directories. However, when I do this, I get the following error: /www/test/.htaccess: RefBlockMimeTypes not allowed here I'm not 100% sure how Apache::ModuleConfig works, but I'm guessing that it simply iterates through all the configuration parameters and checks to see if a sub by that name exists in the caller package. If so, it calls that sub. Perhaps this is not the correct module to use. I've read through the Eagle book and have found obscure references to DIR_MERGE and DIR_CREATE, but I don't understand the purposes behind these entirly. I've also read about Apache::CmdParms, but I don't know how that differs from Apache::ModuleConfig. If someone could point me to a doc explaining how to permit custom config params in .htaccess files, I would greatly appreciate it. Thanks, Robert Landrum -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
Persistent connection ?
Hi all , I have never done such a thing before , so would appreciate if you people could help me out . So i have a client application wanting to upload chunks of data to the webserver . Now the way i want this to happen is to have the client open a connection to the webserver ,send the headers do the initial authentication both ways and then start sending chunks of data ,after receiving each chunk of data the webserver (mod perl script) would process the data and send an acknowledgement to the client and then the client continues with the second upload and so on without the client closing the connection . The webserver is parsing the headers and using the rewrite rules to decide which script to run on the fly when the request is made , so in the above scenario this information would be sent just once before the upload of the first chunk of data ,so in short the script should somehow remain in the apache child to accept the next set of data . Could you comment on this ? thanks, Sachin --== Sent via Deja.com ==-- http://www.deja.com/
Hanging processes (all of a sudden!)
Hi all, I've run into a strange problem with mod_perl over the weekend. All of a sudden, mod_perl started losing scope on it's connections to MySQL. I'd eventually run out of connections to the MySQL server (currently set up to limit to 200). This didn't make sense to me, since previously the number of database connections was never more than the number of MaxClients. With 40 httpd processes running, there were 100+ active connections to the SQL server. Killing httpd removed the connections, so there were definately multiple connections per child. The only thing that had changed was me rebooting the SQL server, which hadn't been rebooted in over six months. Since we're using SQL and NFS from this box to the machine in question, I figured this might have had some strange impact. Since then the load has skyrocketed from an average of 1-2 to over 20-30. Of course at that load it eventually dies. Here's a graph of the load average on this box: http://www3.igl.net/load/load.html (SMP P2 450mhx, 512MB ram, 2.0.36 kernel). [I know, I know - upgrade kernel - remotely hosted so it's a pain to do a major update]. I was running mod_perl v1.22, so I went and upgraded. Getting that up and running with the latest Apache, using Apache::DBI has solved the problem of the ridiculously large SQL connections, but now I'm having problems with hanging processes. Apparently when a child process doesn't finish properly it is still running on and on in memory. Apache reports it's state as W, but top shows it running and gobbling up resources. I poured over the mailing list archives and implemented some of the SIG handling recommendations. I can reproduce the effect by hitting stop in my browser, so I thought I had found a good solution. Here's what I am doing now (just relevent info) in httpd.conf: MaxClients 40 PerlFixupHandler Apache::SIG PerlModule Apache::DBI In each mod_perl script I am doing: # failsafe to prevent broken children require "alarm.pl"; alarm.pl consists of: $SIG{ALRM} = sub { die "$0: $$ Process Timed Out" }; $SIG{PIPE} = sub { die "$0: $$ Cancelled via SIGPIPE" }; $SIG{TERM} = sub { die "$0: $$ Cancelled via SIGTERM" }; alarm 10; I've written a test script that I can reproduce the hanging process problem with, and the above method seems to kill it. However, in real world usage I'm still seeing scripts hang! I can't for the life of me figure out why. I've been using mod_perl for well over a year and a half now, it's running on it's own port and only serves mod_perl requests. The weirdness of this is the sudden onset of the problem, when no scripts or configuration had been changed on the box hosting it. I thought perhaps it could be a slowdown on the SQL side, but running test queries delivers FASTER benchmarks than a few months ago. I even upgraded MySQL, DBI, and DBM::Mysql to the latest stable releases to be safe. Traffic overall on the site is actually DOWN from several months ago. The load is definately being caused by hanging processes. Any advice or pointers? I've been searching for the last three days for any scraps of information I can find, but I'm still running into a wall here. Thanks, Jeremy
Session tracking with URLs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, two questions: 1. I was thinking of doing session tracking first by cookies (I have a system which works well), but some people don't like cookies/don't support cookies/have broken cookies. I was thinking of running a mod_perl handler on the output which does a little regexp game of adding a session variable to the end of the URLs and forms. Has anyone done something like this? Is this a stupid idea? 2. How do I deal with browsers which do not return a referer header? Some parts of my web app depend heavily on it (goto page, page requires URL, sends to login page which captures referer of page where the user wants to go, logs in user, sends user back to the page seamlessly). Thanks for your help Yann - -- - Yann Ramin [EMAIL PROTECTED] Atrus Trivalie Productions www.redshift.com/~yramin AIM oddatrus Marina, CA http://profiles.yahoo.com/theatrus IRM Developer Network Toaster Developer SNTS Developer KLevel Developer Electronics Hobbyistperson who loves toys When smashing monuments, save the pedstals -- they always come in handy. -- Stanislaw J. Lem, "Unkempt Thoughts" "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next - -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD4DBQE6kx/Px6171htvP6YRAsikAJitY0asWUc5rVonHnKyb/j+DD1qAKCGdSli dBxEuCkDtCthfUVr0CSRZg== =1bU+ -END PGP SIGNATURE-
Apache/mod_perl/Win2K gpfault finally resolved?
Folks, any of you in a position to grab the current Apache tree from CVS and build Apache plus mod_perl, and see if the gpfault is gone, here is the 'unpatch' for John Sterling's quick hack: Index: mod_perl.c === RCS file: /home/cvspublic/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.134 diff -u -r1.134 mod_perl.c --- mod_perl.c 2000/12/20 06:39:48 1.134 +++ mod_perl.c 2001/02/21 03:14:34 @@ -508,19 +508,6 @@ static void mp_dso_unload(void *data) { array_header *librefs; - -#ifdef WIN32 -// This is here to stop a crash when bringing down -// a service. Apparently the dso is unloaded too early. -// This if statement tests to see if we are running as a -// service. apache does the same -// see apache's isProcessService() in service.c -if (AllocConsole()) { -FreeConsole(); -return; -} -#endif - librefs = xs_dl_librefs((pool *)data); perl_shutdown(NULL, NULL); unload_xs_so(librefs); I would sure like to know our headaches are gone on Win2000 - so please try this out and provide feedback if it does or doesn't solve that earlier problem. Bill
Re: number of pgsql childrens on persistant DBI connection
Emmanuel Pierre wrote: Hi all, on my DB server I have 245 "idle" postmasters process for 130 httpd persistant DB connections alive. make sure you use the same connect attributes each time you invokes DBI-connect(). eg, a connect() with {RaiseError=1} and another connect with {RaiseError=1,Taint=1} gives two different persistent $dbh. To make this simpler, you'd better create a global $dbh by connect_on_init(),and use it anytime you need a $dbh. rgds, Edwin. can anyone give me a clue how to manage this number of unused/idleschildren and how to have them quickerly deallocated ? this way, I jumptoo quick on 'too much connection'... Emmanuel -- EDENJOB / APR-Job Email: [EMAIL PROTECTED]Home:www.apr-job.com Phone: +33 1 47 81 02 41 Tatoo: +33 6 57 60 42 17 Fax: +33 1 41 92 91 54 eFAX: +44 0870-122-6748 ** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither EDENJOB/APR-JOB or affiliates shall be liable for the message if altered, changed or falsified. **
UPDATE: Hanging processes (all of a sudden!)
Hello all, Just to followup on myself...I did some more experiments and determined that putting the alarm routines in a library wasn't really working right. It would work correctly on the first request per child but after that failed. I ended up with: # failsafe to prevent broken children $SIG{ALRM} = sub { die "$0: $$ Process Timed Out" }; $SIG{PIPE} = sub { die "$0: $$ Cancelled via SIGPIPE" }; $SIG{TERM} = sub { die "$0: $$ Cancelled via SIGTERM" }; alarm 10; This is at the beginning of all my scripts using mod_perl. I'm tweaking the timeout. Without using the alarm signal things still get nasty, though. Load on the box is back down to 1...However the timeout issue is a little nasty. Users on slow connects are getting timed out rather than the script finishing. I'm trying to determine where the hangs are happening so I can reset the alarm timer in the script. I still can't quite figure out why they are hanging in the first place, I know it has to do with the clients disconnecting from the script but I assumed that SIGPIPE would catch them. It isn't doing that in all cases, I guess it depends where the disconnect occurs in the script. I hope this is helpful to others, but I still am looking for more answers to this! Thanks, Jeremy -Original Message- From: Jeremy Rusnak [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 6:11 PM To: [EMAIL PROTECTED] Subject: Hanging processes (all of a sudden!) Hi all, I've run into a strange problem with mod_perl over the weekend. All of a sudden, mod_perl started losing scope on it's connections to MySQL. I'd eventually run out of connections to the MySQL server (currently set up to limit to 200). This didn't make sense to me, since previously the number of database connections was never more than the number of MaxClients. With 40 httpd processes running, there were 100+ active connections to the SQL server. Killing httpd removed the connections, so there were definately multiple connections per child. The only thing that had changed was me rebooting the SQL server, which hadn't been rebooted in over six months. Since we're using SQL and NFS from this box to the machine in question, I figured this might have had some strange impact. Since then the load has skyrocketed from an average of 1-2 to over 20-30. Of course at that load it eventually dies. Here's a graph of the load average on this box: http://www3.igl.net/load/load.html (SMP P2 450mhx, 512MB ram, 2.0.36 kernel). [I know, I know - upgrade kernel - remotely hosted so it's a pain to do a major update]. I was running mod_perl v1.22, so I went and upgraded. Getting that up and running with the latest Apache, using Apache::DBI has solved the problem of the ridiculously large SQL connections, but now I'm having problems with hanging processes. Apparently when a child process doesn't finish properly it is still running on and on in memory. Apache reports it's state as W, but top shows it running and gobbling up resources. I poured over the mailing list archives and implemented some of the SIG handling recommendations. I can reproduce the effect by hitting stop in my browser, so I thought I had found a good solution. Here's what I am doing now (just relevent info) in httpd.conf: MaxClients 40 PerlFixupHandler Apache::SIG PerlModule Apache::DBI In each mod_perl script I am doing: # failsafe to prevent broken children require "alarm.pl"; alarm.pl consists of: $SIG{ALRM} = sub { die "$0: $$ Process Timed Out" }; $SIG{PIPE} = sub { die "$0: $$ Cancelled via SIGPIPE" }; $SIG{TERM} = sub { die "$0: $$ Cancelled via SIGTERM" }; alarm 10; I've written a test script that I can reproduce the hanging process problem with, and the above method seems to kill it. However, in real world usage I'm still seeing scripts hang! I can't for the life of me figure out why. I've been using mod_perl for well over a year and a half now, it's running on it's own port and only serves mod_perl requests. The weirdness of this is the sudden onset of the problem, when no scripts or configuration had been changed on the box hosting it. I thought perhaps it could be a slowdown on the SQL side, but running test queries delivers FASTER benchmarks than a few months ago. I even upgraded MySQL, DBI, and DBM::Mysql to the latest stable releases to be safe. Traffic overall on the site is actually DOWN from several months ago. The load is definately being caused by hanging processes. Any advice or pointers? I've been searching for the last three days for any scraps of information I can find, but I'm still running into a wall here. Thanks, Jeremy
Re: Can anyone help please
The easiest, fastest, and most transparent that I can think of is to just create a jump script/module/etc that you link to. something like http://servername/jump/ then you write your setup so that any link gets added on to the end of that making a link to www.newsite.com/folder/document.html into http://servername/jump/www.newsite.com/folder/document.html then you can parse outgoing files and anytime you find a href='http://...' you just replace http:// with http://servername/jump/ log it however you need to On Tue, 20 Feb 2001, Smith, Stephen (ELS) wrote: Hi everyone, I have to make the tracking of users who follow links to external sites possible, preferably indicating in specific logfiles when a new browser is opened for linking to external sites. We have tried proxy solutions, modifying Apache core modules and are considering scanning and parsing our Html on the fly. I understand that uri.c could be modified or changes could be made to the .htaccess file. The problem is it has to be fast and transparant, does anyone have any ideas???
Re:[Mason] Escaped '/' (%2F) causes path_info to fail.
The apache error log does not show the filename that caused the 404. This surprised me as well, I even installed Apache::LogSTDERR, but that doesn't produce any output either. Kees Vonk [EMAIL PROTECTED] 20/02/01 19:35 To: [EMAIL PROTECTED] @ gateway cc: Subject: Re:[Mason] Escaped '/' (%2F) causes path_info to fail. At 3:40 PM + 2/20/2001, [EMAIL PROTECTED] wrote: I have posted this problem before, but I have managed to narrow it down a lot: when I have a %2F (escaped slash) in my path_info apache returns a 404 File Not Found error, any other escaped characters seem to be alright I have no idea whether this is a problem with apache, modperl or mason. Can anyone reproduce or explain this behaviour. I am using apache 1.3.17, modperl 1.25 on HPUX 10.20. Please can anyone help me with this, it is causing real problems. Does the Apache error log list the filename that caused the 404? Is the slash still escaped in the log or has it been unescaped? Benjamin Turner -- Benjamin John Turner | [EMAIL PROTECTED] http://www.usfca.edu/turner/ | [EMAIL PROTECTED] __ The views expressed in this email are not necessarily the views of Transco plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. This e-mail, and any attachments are strictly confidential and intended for the addressee(s) only. The content may also contain legal, professional or other privileged information. If you are not the intended recipient, could you please notify the sender immediately and then delete the e-mail and any attachments, you should not disclose, copy or take any action in reliance of this transmission. Unless expressly stated to the contrary, no contracts may be concluded on behalf of Transco plc by means of e-mail communication. You may report the matter by calling us on +44 (0)1455 230999. You should not copy, forward or otherwise disclose the contents of this e-mail or any of its attachments without express consent. Please ensure you have adequate virus protection before you open or detach any documents from this transmission. Transco plc does not accept any liability for viruses. Transco plc is part of Lattice Group Transco plc is registered in England: Company number: 2006000 Registered Office: 130 Jermyn Street, London, SW1Y 4UR http://www.transco.uk.com
cvs commit: modperl-site isp.html
sbekman 01/02/20 17:47:42 Modified:.isp.html Log: another mod_perl ISP Revision ChangesPath 1.17 +4 -0 modperl-site/isp.html Index: isp.html === RCS file: /home/cvs/modperl-site/isp.html,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- isp.html 2000/12/18 20:02:57 1.16 +++ isp.html 2001/02/21 01:47:42 1.17 @@ -72,6 +72,10 @@ h3USA/h3 +a +href="http://hostpro.com/hosting/shared/unix_products.html"HostPro/a, +a few data centers around USA. + a href="mailto:[EMAIL PROTECTED]"BC Publishing, Inc/aColumbus, Ohiobr a href="http://www.kattare.com/"Kattare Internet Services/a, Corvallis, Oregon (a href="mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]/a) - MySQL, PHP, mod_perl based ASPbr