Re: Apache 2.2.6 and mod_perl 2.0.3
On Wed, 3 Oct 2007, Tracy E Schreiber wrote: Hi, I believe that mod_perl 2.0.3 is not compatible with Apache 2.2.6. Starting Apache gives this error: httpd.exe: Syntax error on line 31 of D:/Apache/conf/httpd.conf: Cannot load D:/Apache/modules/mod_perl.so into server: The specified module could not be found. This worked fine under 2.2.4, so the configuration is not the problem. The mod_perl.so was retrived using ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd. Any one able to get mod_perl.so to work with Apache 2.2.6 Thanks, Tracy For Apache/2.2.x, you want the mod_perl ppm package, not mod_perl-2.0; see http://perl.apache.org/docs/2.0/os/win32/install.html#PPM_Packages for details. Having said that, I'd also suggest holding off using 2.2.6, as others have suggested - stick with 2.2.4 for the time being. Note that the 2.2.5 package from ApacheLounge is not an official ASF release, and the 2.2.6 from the same location contains hacks that won't be in the next official ASF release that addresses certain Win32 problems. See http://marc.info/?t=11913767701r=1w=2 for a discussion of this and related issues. -- best regards, Randy Kobes
Re: Apache 2.2.6 and mod_perl 2.0.3
Why don't you read about what's new in 2.2: http://httpd.apache.org/docs/2.2/new_features_2_2.html Jeff Pang wrote: Hello, Does apache2.2+mp2 have much advantage than apache2.0+mp2? 2007/10/4, Foo JH [EMAIL PROTECTED]: You may want to hold back on 2.2.6. Use either 2.2.4 from ASF or 2.2.5 from ApacheLounge. Tracy E Schreiber wrote: Hi, I believe that mod_perl 2.0.3 is not compatible with Apache 2.2.6. Starting Apache gives this error: httpd.exe: Syntax error on line 31 of D:/Apache/conf/httpd.conf: Cannot load D:/Apache/modules/mod_perl.so into server: The specified module could not be found. This worked fine under 2.2.4, so the configuration is not the problem. The mod_perl.so was retrived using ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd. Any one able to get mod_perl.so to work with Apache 2.2.6 Thanks, Tracy
Turning off caching
I've got an existing cgi project that I was hoping to get some performance improvements from mod_perl. Everything was going great until I ran into a caching issue. The script repeatedly performs the last action given regardless of the paramaters passed in. I've seen this: $r-nocache(1); But, how can I use it in my startup.pl or in my httpd.conf? If I can't do it in the startup.pl, or the conf file, I would welcome any other recommendations. This is my virtual host setup: VirtualHost *:80 ServerName mysite.com DocumentRoot X:/htdocs/sites/mysite_dev ScriptAlias /cgi-bin/admin/ X:/htdocs/sites/mysite_dev/cgi-bin/admin/ ErrorLog logs/rt-error.log Directory X:/htdocs/sites/mysite_dev Options +ExecCGI Order allow,deny Allow from all Files ~ \.(cgi)$ SetHandler perl-script PerlHandler ModPerl::Registry PerlSendHeader On /Files /Directory /VirtualHost I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003 server. Thanks, Ian T.
RE: Turning off caching
You can't use it in startup.pl or httpd.conf, but you could create a PerlInitHandler that runs for the whole site (or part of it) and use it in there. At least that's another option. Adam -Original Message- From: Geoffrey Young [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 9:47 AM To: Ian G. Tyndall Cc: modperl@perl.apache.org Subject: Re: Turning off caching Ian G. Tyndall wrote: I've got an existing cgi project that I was hoping to get some performance improvements from mod_perl. Everything was going great until I ran into a caching issue. The script repeatedly performs the last action given regardless of the paramaters passed in. I've seen this: $r-nocache(1); But, how can I use it in my startup.pl or in my httpd.conf? you can't - the $r means it's a per-request thing, not a lifetime-of-the-server thing If I can't do it in the startup.pl, or the conf file, I would welcome any other recommendations. see mod_expires: http://httpd.apache.org/docs/2.0/mod/mod_expires.html HTH --Geoff
Re: mod_perl success stories on ZDNet
Boysenberry Payne wrote: If I have my own success story how would I go about adding it to the list? I think you can just email your success story to the list. then someone with sufficient karma can add the email into http://svn.apache.org/repos/asf/perl/modperl/docs/trunk/src/outstanding/success_stories/ twiddle a few bits, and it will get integrated into the site. --Geoff
RE: Turning off caching
Thanks for the quick responses! For argument sake, I went ahead and added the following to the top of one of the problem scripts: my $r = shift; $r-no_cache(1); And it didn't fix it. Geoffrey: I tried the mod_expires with : access 1 seconds That didn't work either... thanks though. Adam: I'm looking into that perlinithandler right now, thanks for the recommendation. -Original Message- From: Adam Prime x443 [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 10:07 AM To: Geoffrey Young; Ian G. Tyndall Cc: modperl@perl.apache.org Subject: RE: Turning off caching You can't use it in startup.pl or httpd.conf, but you could create a PerlInitHandler that runs for the whole site (or part of it) and use it in there. At least that's another option. Adam -Original Message- From: Geoffrey Young [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 9:47 AM To: Ian G. Tyndall Cc: modperl@perl.apache.org Subject: Re: Turning off caching Ian G. Tyndall wrote: I've got an existing cgi project that I was hoping to get some performance improvements from mod_perl. Everything was going great until I ran into a caching issue. The script repeatedly performs the last action given regardless of the paramaters passed in. I've seen this: $r-nocache(1); But, how can I use it in my startup.pl or in my httpd.conf? you can't - the $r means it's a per-request thing, not a lifetime-of-the-server thing If I can't do it in the startup.pl, or the conf file, I would welcome any other recommendations. see mod_expires: http://httpd.apache.org/docs/2.0/mod/mod_expires.html HTH --Geoff
RE: Turning off caching
Sorry if this has been mentioned before or I'm teaching you to suck eggs, but if you are running an old CGI script in mod_perl you need to not scope with 'my'. See http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___ _Scoped_Variable_in_Nested_Subroutines This is not a global rule: do not use 'my' for any variables. You should still use 'my' for most variables. What you must be careful NOT to do is to avoid using 'my' variables in a subroutine where it has not been declared. For instance: - sub foo { my $this_is_ok; return $this_is_ok; } - - my $this_is_not_ok; sub bar { $this_is_not_ok++; } - That is because this last example, when used in Registry, becomes this: - $myscript = sub { my $this_is_not_ok; sub bar { $this_is_not_ok++; } } - which creates a closure, with its own private copy of $this_is_not_ok - you will see Variable will not remain shared warnings in your logs (assuming you have strict or warnings turned on - I forget which) HTH Clint
Re: Best version of Apache for Win32 deployment
From: William A. Rowe, Jr. [EMAIL PROTECTED] Octavian Rasnita wrote: Well, I've uninstalled VS6 and VS.net, but this message still appears, so I have no where to go in Tools/Options/... You didn't bother to finish reading; http://httpd.apache.org/dev/debugging.html Which tells you how to enable/override drwtsn32 as your default error handler (-i flag I think, offhand). Yes I've enabled DrWatson and I put the files with symbols in Apache directory, however I can't find something that could help me in the DrWatson log file. Octavian
RE: Turning off caching
For argument sake, I went ahead and added the following to the top of one of the problem scripts: my $r = shift; $r-no_cache(1); And it didn't fix it. Sorry if this has been mentioned before or I'm teaching you to suck eggs, but if you are running an old CGI script in mod_perl you need to not scope with 'my'. See http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___ _Scoped_Variable_in_Nested_Subroutines HTH Iain.
Re: Turning off caching
On 10/4/07, Ian G. Tyndall [EMAIL PROTECTED] wrote: I've got an existing cgi project that I was hoping to get some performance improvements from mod_perl. Everything was going great until I ran into a caching issue. The script repeatedly performs the last action given regardless of the paramaters passed in. This is not a caching issue. It's a scoping bug in your CGI code. You're doing something with a CGI.pm object or similar that puts it in a persistent variable. If you show us some code, we can probably point out the issue, but it's generally either a global variable or a situation where you call a sub that uses lexical variables declared in a wider scope. - Perrin
Re: Turning off caching
Ian G. Tyndall wrote: Thanks for the quick responses! For argument sake, I went ahead and added the following to the top of one of the problem scripts: my $r = shift; $r-no_cache(1); And it didn't fix it. if that didn't work then you might be experiencing variable sharing problems, not caching of the http sort. see http://perl.apache.org/docs/1.0/guide/porting.html#Description http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Remedies_for_Inner_Subroutines which applies to both mod_perl 1 or 2 wrt Registry.pm HTH --Geoff
RE: Turning off caching
This is not a global rule: do not use 'my' for any variables. You should still use 'my' for most variables. Exactly, a poor description by me :( Iain.
RE: Turning off caching
Thanks guys! Look like I got alot of scripts to change! -Original Message- From: iain hubbard [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 11:06 AM To: modperl@perl.apache.org Subject: RE: Turning off caching This is not a global rule: do not use 'my' for any variables. You should still use 'my' for most variables. Exactly, a poor description by me :( Iain.
Apache crashing
Oh the problems come and go so quickly! I've got one cgi script that always crashes apache. The error log gives the following message: [Thu Oct 04 11:38:29 2007] [crit] (22)Invalid argument: Parent: Failed to create the child process. [Thu Oct 04 11:38:29 2007] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. [Thu Oct 04 11:38:29 2007] [notice] Parent: Forcing termination of child process 2474288 Other scripts run fine... so what would be the best way of debugging this. I'm in the process of commenting out modules/code, but no luck so far... any recommendations? I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003 server. Thanks, Ian
Re: Apache crashing
On Thu, 4 Oct 2007, Ian G. Tyndall wrote: Oh the problems come and go so quickly! I've got one cgi script that always crashes apache. The error log gives the following message: [Thu Oct 04 11:38:29 2007] [crit] (22)Invalid argument: Parent: Failed to create the child process. [Thu Oct 04 11:38:29 2007] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. [Thu Oct 04 11:38:29 2007] [notice] Parent: Forcing termination of child process 2474288 Other scripts run fine... so what would be the best way of debugging this. I'm in the process of commenting out modules/code, but no luck so far... any recommendations? I'm using mod_perl 2.0.3, perl 5.8.8, apache 2.0.59 on a Windows 2003 server. Thanks, Ian Is this a cgi script, or a mod_perl registry script? Although the log messages are generic, similar messages appear when one tries to restart apache with mod_perl enabled - if it's a cgi script, does commenting out the loading of mod_perl.so help? As for tracking down the problem, reducing it to a minimal version will help. If you can do this, and don't see the problem, try posting it to the list here. Also, trying some of the debugging tips suggested in the thread http://marc.info/?t=11913767701r=1w=2 may help, along with installing http://www.apache.org/dist/httpd/binaries/win32/#source to help in the crash analysis. -- best regards, Randy
Re: Best version of Apache for Win32 deployment
Octavian Rasnita wrote: Yes I've enabled DrWatson and I put the files with symbols in Apache directory, however I can't find something that could help me in the DrWatson log file. Good. Don't actually interrupt the program (the example using -g {PID} to force the program to die). Your server is doing well at that on it's own :) The crash is what you want to see, you should no longer be prompted with the JustInTime debugger. The next question is what does the crash dump of the *guilty* thread look like? You are looking for the word FAULT (all caps) in the drwatson output from a crashed program to determine which thread segfaulted. Bill
[QUESTION] mod_perl2 and selfmade Modules
Hi everyone, I just configured mod_perl on for my apache2 server on debian 4. I have a perl-script index.cgi which is handled by mod_perl, by: SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI This script uses a Perl-Module in the same directory I wrote. This could be something simple as: package Test; sub test() { return hello world; } Now to the question: Will this module also gain speed the same way as the script which uses this module and is handled by mod_perl? Greets Reto
Re: [QUESTION] mod_perl2 and selfmade Modules
reto wrote: Hi everyone, I just configured mod_perl on for my apache2 server on debian 4. I have a perl-script index.cgi which is handled by mod_perl, by: SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI This script uses a Perl-Module in the same directory I wrote. This could be something simple as: package Test; sub test() { return hello world; } Now to the question: Will this module also gain speed the same way as the script which uses this module and is handled by mod_perl? The module will be preloaded just like your script, thus any speed up experienced by your script will also be experienced by the module. -- D. Hageman[EMAIL PROTECTED] Dracken Technology, Inc. http://www.dracken.com/
Re: [QUESTION] mod_perl2 and selfmade Modules
2007/10/5, D. Hageman [EMAIL PROTECTED]: The module will be preloaded just like your script, thus any speed up experienced by your script will also be experienced by the module. Hi, If you don't preload it in startup.pl or with PerlModule directive in httpd.conf,I don't think registry scripts would be preloaded by apache defaultly.Yes when first request hit the cgi script,the script would be parsed and compiled and server that request,then it will be stored in apache child.Next time if requests are coming,the same cgi script won't be re-loaded and re-parsed.This was load by needed,not preload. Hope I'm right.If not,please point it out.
Re: [QUESTION] mod_perl2 and selfmade Modules
Jeff Pang wrote: 2007/10/5, D. Hageman [EMAIL PROTECTED]: The module will be preloaded just like your script, thus any speed up experienced by your script will also be experienced by the module. Hi, If you don't preload it in startup.pl or with PerlModule directive in httpd.conf,I don't think registry scripts would be preloaded by apache defaultly.Yes when first request hit the cgi script,the script would be parsed and compiled and server that request,then it will be stored in apache child.Next time if requests are coming,the same cgi script won't be re-loaded and re-parsed.This was load by needed,not preload. Hope I'm right.If not,please point it out. The devil is in the details. You are technically right. Let me adjust what I said. s/preloaded/cached/ -- D. Hageman[EMAIL PROTECTED] Dracken Technology, Inc. http://www.dracken.com/