[ANNOUNCE] mod_perl-2.0.4
Finally, it's here and it works with Perl 5.10! http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz.asc (pgp sig) The package is also available on CPAN: file: $CPAN/authors/id/G/GO/GOZER/mod_perl-2.0.4.tar.gz size: 3727717 bytes md5: 1a05625ae6843085f985f5da8214502a sha1: 65299a16ec414a690a48a2bbe63acaa3c6bb897b Changes since 2.0.3: Fix $r->location corruption under certain conditions [Gozer] Fix a crash when spawning Perl threads under Perl 5.10 [Gozer] Fix erratic behaviour when filters were used with Perl 5.10 [Gozer] Fix problems with redefinitions of perl_free as free and perl_malloc as malloc on Win32, as described at http://marc.info/?l=apache-modperl&m=119896407510526&w=2 [Tom Donovan] Fix a crash when running a sub-request from within a filter where mod_perl was not the content handler. [Gozer] Refactor tests to use keepalives instead of same_interp [Gozer, Phred] Apache2::Reload has been moved to an externally maintained CPAN distribution [Fred Moyer <[EMAIL PROTECTED]>] PerlCleanupHandler are now registered with a subpool of $r->pool, instead of $r->pool itself, ensuring they run _before_ any other $r->pool cleanups [Torsten Foertsch] Fix a bug that would prevent pnotes from being cleaned up properly at the end of the request [Torsten Foertsch] On Win32, embed the manifest file, if present, in mod_perl.so, so as to work with VC 8 [Steve Hay, Randy Kobes] Expose apr_thread_rwlock_t with the APR::ThreadRWLock module [Torsten Foertsch] Don't waste an extra interpreter anymore under threaded MPMs when using a modperl handler [Torsten Foertsch] Fix a bug that could cause a crash when using $r->push_handlers() multiple times for a phase that has no configured handlers [Torsten Foertsch] Catch up with some httpd API changes 2.2.4: The full server version information is now included in the error log at startup as well as server status reports, irrespective of the setting of the ServerTokens directive. ap_get_server_version() is now deprecated, and is replaced by ap_get_server_banner() and ap_get_server_description(). [Jeff Trawick] 2.3.0: ap_get_server_version() has been removed. Third-party modules must now use ap_get_server_banner() or ap_get_server_description(). [Gozer] fixed Apache2::compat Apache2::ServerUtil::server_root() resolution issues [Joshua Hoblitt] *) SECURITY: CVE-2007-1349 (cve.mitre.org) fix unescaped variable interprolation in regular expression [Randal L. Schwartz <[EMAIL PROTECTED]>, Fred Moyer <[EMAIL PROTECTED]>] Make $r->the_request() writeable [Fred Moyer <[EMAIL PROTECTED]>] fix ModPerl::RegistryCooker::read_script to handle all possible errors, previously there was a case where Apache2::Const::OK was returned on an error. [Eivind Eklund <[EMAIL PROTECTED]>] a minor compilation warning resolved in modperl_handler_new_from_sv [Stas] a minor compilation warning resolved in modperl_gtop_size_string [Stas] Prevent direct use of _deprecated_ Apache2::ReadConfig in sections with httpd Alias directives from incorrectly generating 'The Alias directive in x at line y will probably never match' messages. [Philip M. Gollucci <[EMAIL PROTECTED]>] Prevent Apache2::PerSections::symdump() from returning invalid httpd.conf snippets like 'Alias undef' [Philip M. Gollucci <[EMAIL PROTECTED]>] Require B-Size 0.9 for Apache2::Status which fixes Can't call method "script_name" on an undefined value [Philip M. Gollucci <[EMAIL PROTECTED]>] -march=pentium4 or anything with an = in it in CCFLAGS or @ARGV that gets passed to xs/APR/APR/Makefile.PL broke the @ARGV parsing. I.E. FreeBSD port builds when users had CPUTYPE set in /etc/make.conf. [Philip M. Gollucci <[EMAIL PROTECTED]>] Fixes to get bleed-ithread (5.9.5+) to comile again. [Philip M. Gollucci <[EMAIL PROTECTED]>] -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/ signature.asc Description: OpenPGP digital signature
Re: reinitializing Perl's notion of $$ in mod_perl
On 17 Apr 2008, at 07:46, Philippe M. Chiasson wrote: Mark Blackman wrote: On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlChildInitHandler handler is called. Good, so it is clearly a bug then. Right, so that's appropriate as a long term fix. I'll note that on a very similar version of mod_perl/perl/apache on a linux box, this problem doesn't crop up as though the hook calling order works out differently there. I couldn't for the life of me follow any details of the ap_hook_* stuff. I'm not quite sure what the positive result here suggests. Is that patch appropriate as a long term fix? Should it be part of 2.0.4? It'll be part of 2.0.5, since 2.0.4 has just been released. durn. what timing. Any chance you could turn this bug into a patch to the test suite ? uhh. perhaps. I wonder how easy it will be to replicate on other platforms. - Mark -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm) \.org/
HTTP request using mod_perl - permission denied on localhost
Hi all, I have a mod_perl script which works at PerlTransHandler level, and translates the virtual host requested to the real system path where site's pages are stored. To do this translation, I tried two solutions: - ask to a db - ask to a php script on another apache which makes the traslation. But the second solution doesn't work in every situation: if the second apache is on the same system but different port, it doesn't work and I find on the error_log 500 Can't connect to 192.168.2.110:8080 (connect: Permission denied) (also if I use a different Ip, using an alias for the network interface) Otherwise, if it is on another system, it works. Does anyone know why it happens? Is it a limitation of apache/mod_perl? Thanks and regards Valerio
Re: HTTP request using mod_perl - permission denied on localhost
Hi all, I solved the problem: it is not a problem of mod_perl, or perl, or linux... it is a problem of Fedora and SELinux, which prevents a cgi to open a socket on the same system... Valerio 2008/4/17, Valerio <[EMAIL PROTECTED]>: > Hi all, > > I have a mod_perl script which works at PerlTransHandler level, and > translates the virtual host requested to the real system path where > site's pages are stored. > To do this translation, I tried two solutions: > - ask to a db > - ask to a php script on another apache which makes the traslation. > > But the second solution doesn't work in every situation: > if the second apache is on the same system but different port, it > doesn't work and I find on the error_log > > 500 Can't connect to 192.168.2.110:8080 (connect: Permission denied) > > (also if I use a different Ip, using an alias for the network interface) > > Otherwise, if it is on another system, it works. > > Does anyone know why it happens? > Is it a limitation of apache/mod_perl? > > Thanks and regards > > > Valerio >
Re: [ANNOUNCE] mod_perl-2.0.4
Alas, I have bad news to report: Tech stack: Windows 2003 Server Apache 2.2.4 Perl 5.10.0 mod_perl 2.0.4 from 10xx/ path Observations: 1. mod_perl is able to start 2. mod_perl is unable to survive an Apache restart signal 3. (relavant) error log available below: [Thu Apr 17 23:39:34 2008] [notice] Parent: Received restart signal -- Restarting the server. [Thu Apr 17 23:39:34 2008] [notice] Child 4532: Exit event signaled. Child process is ending. [Thu Apr 17 23:39:34 2008] [notice] Apache/2.2.8 (Win32) mod_perl/2.0.4-dev Perl/v5.10.0 configured -- resuming normal operations [Thu Apr 17 23:39:34 2008] [notice] Server built: Jan 18 2008 00:37:19 [Thu Apr 17 23:39:34 2008] [crit] (22)Invalid argument: Parent: Failed to create the child process. [Thu Apr 17 23:39:34 2008] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. [Thu Apr 17 23:39:34 2008] [notice] Parent: Forcing termination of child process 36 [Thu Apr 17 23:39:35 2008] [notice] Child 4532: Released the start mutex [Thu Apr 17 23:39:36 2008] [notice] Child 4532: All worker threads have exited. [Thu Apr 17 23:39:36 2008] [notice] Child 4532: Child process is exiting Philippe M. Chiasson wrote: Finally, it's here and it works with Perl 5.10!
Re: WELCOME to modperl@perl.apache.org
Hi, At http://perl.apache.org/docs/2.0/user/config/custom.html#C_SERVER_CREATE_it should be noted about this function (and also about DIR_CREATE) that it will be called if there is at least one custom directive present in httpd.conf. So setting so called 'system defaults' is not possible this way because if you do not have at least one directive in your httpd.conf, then the server configuration object will not get initialised. For example if I have this in MyParams.pm: sub SERVER_CREATE { my ($class, $parms) = @_; return bless { 'name' => __PACKAGE__, 'MyParam1' => '2', 'MyParam2' => '4', }, $class; } and in my httpd.conf I want to get server defaults by commenting out some MyParam values like PerlLoadModule MyParams #MyParam1 1 #MyParam2 0 then if in my code I try to access the server configuration object like this my $srv_cfg = Apache2::Module::get_config('MyParams', Apache2::ServerUtil->server); I get undef. Is this a bug or a feature? The documentation suggests that it will be called all the time and event suggests to use it to preset some values here if necessary. Regards, Zsolt Kecskemeti
Re: Session handling
On Thursday 17 April 2008 01:04:14 Tracy12 wrote: > for session handling we use CGI:Session cpan distribution, > > we do use local file for cookie storage, eventhough the session time out is > 30, sometimes the set information in the > session get lost before that, has anybody experience this before. That sounds like you are using a cache file and your cache is filling up. > We do have a cron job to clear the session data, Is there any solution for > this behavior? What exactly the possible reason for such a thing. The nature of a cache is that it will drop older data to make room for newer. So your solutions are to make a larger cache file (you may have to experiment to work out what size you need), or to switch to some other session storage mechanism that has different properties.
Forking a process [in Practical mod_perl book]
Hi all, I'm trying to fork a long-running process which I do not want to wait for. I was getting a lot of "ssh " processes, so I did some googling and found this from the aforementioned O'reilly book: http://www.perl.com/lpt/a/701 And sure enough, there's a section on "Avoiding Zombie Processes". In this section's example code, the authors have added these two lines to the top: - my $r = shift; $r->send_http_header('text/plain'); - which did not exist in the previous examples. I don't quite understand why setting the HTTP header has any relevance to zombie processes. Apologies if I missed it somewhere on this page, but could anyone shed some light on why these two lines are important enough to remain in all future examples on this topic? Thank you! Ray
Re: [ANNOUNCE] mod_perl-2.0.4
Hi Philippe, Software: Linux 2.6.15-gentoo-r1 perl v5.8.8 (perl -V see below) mod_perl-2.0.4 1) apache 2.0.63 => works without problems (so far testet) 2) apache 2.2.6 + 2.2.8 => at server start.=> .. /usr/local/apache2/bin/apachectl: line 78: 14924 Segmentation fault $HTTPD $ARGV make test => ... server has died with status 255 (please examine t/logs/error_log) t/logs/error_log is empty. what else can i provide to track it down? Helmut perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.15-gentoo-r1, archname=i686-linux-thread-multi uname='linux blossenau 2.6.15-gentoo-r1 #3 smp tue apr 15 07:32:50 cest 2008 i686 intel(r) pentium(r) d cpu 2.80ghz genuineintel gnulinux ' config_args='-des -Darchname=i686-linux-thread -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-O2 -march=prescott -fomit-frame-pointer -pipe -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/i686-linux-thread-multi 5.8.2 5.8.2/i686-linux-thread-multi 5.8.4 5.8.4/i686-linux-thread-multi 5.8.5 5.8.5/i686-linux-thread-multi 5.8.6 5.8.6/i686-linux-thread-multi 5.8.7 5.8.7/i686-linux-thread-multi -Dcf_by=Gentoo -Ud_csh -Dusenm -Dusethreads -Di_ndbm -Di_gdbm -Di_db' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='i686-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -march=prescott -fomit-frame-pointer -pipe', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement' ccversion='', gccversion='4.1.2 (Gentoo 4.1.2 p1.1)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='i686-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lpthread -lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.6.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Apr 16 2008 10:01:53 @INC: /etc/perl /usr/lib/perl5/vendor_perl/5.8.8/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/5.8.8/i686-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/local/lib/site_perl Philippe M. Chiasson schrieb: Finally, it's here and it works with Perl 5.10! http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz.asc (pgp sig) The package is also available on CPAN: file: $CPAN/authors/id/G/GO/GOZER/mod_perl-2.0.4.tar.gz size: 3727717 bytes md5: 1a05625ae6843085f985f5da8214502a sha1: 65299a16ec414a690a48a2bbe63acaa3c6bb897b Changes since 2.0.3: Fix $r->location corruption under certain conditions [Gozer] Fix a crash when spawning Perl threads under Perl 5.10 [Gozer] Fix erratic behaviour when filters were used with Perl 5.10 [Gozer] Fix problems with redefinitions of perl_free as free and perl_malloc as malloc on Win32, as described at http://marc.info/?l=apache-modperl&m=119896407510526&w=2 [Tom Donovan] Fix a crash when running a sub-request from within a filter where mod_perl was not the content handler. [Gozer] Refactor tests to use keepalives instead of same_interp [Gozer, Phred] Apache2::Reload has been moved to an externally maintained CPAN distribution [Fred Moyer <[EMAIL PROTECTED]>] PerlCleanupHandler are now registered with a subpool of $r->pool, instead of $r->pool itself, ensuring they run _before_ any other $r->pool cleanups [Torsten Foertsch]
Re: Forking a process [in Practical mod_perl book]
Hi all, Raymond Wan wrote: - my $r = shift; $r->send_http_header('text/plain'); - Sorry for the trouble but while googling for the problem, I came by the reason: "send the output of system() to the client": http://www.mail-archive.com/[EMAIL PROTECTED]/msg36062.html I also realized that the solution for modperl1 differs for modperl2 and the above snippet seems relevant to MP1... Thanks! Ray
Re: [ANNOUNCE] mod_perl-2.0.4
I think we knew that (or am I getting mixed up with the mp1 RC?) and it was supposed to be a known issue... Issac Foo JH wrote: Alas, I have bad news to report: Tech stack: Windows 2003 Server Apache 2.2.4 Perl 5.10.0 mod_perl 2.0.4 from 10xx/ path Observations: 1. mod_perl is able to start 2. mod_perl is unable to survive an Apache restart signal 3. (relavant) error log available below: [Thu Apr 17 23:39:34 2008] [notice] Parent: Received restart signal -- Restarting the server. [Thu Apr 17 23:39:34 2008] [notice] Child 4532: Exit event signaled. Child process is ending. [Thu Apr 17 23:39:34 2008] [notice] Apache/2.2.8 (Win32) mod_perl/2.0.4-dev Perl/v5.10.0 configured -- resuming normal operations [Thu Apr 17 23:39:34 2008] [notice] Server built: Jan 18 2008 00:37:19 [Thu Apr 17 23:39:34 2008] [crit] (22)Invalid argument: Parent: Failed to create the child process. [Thu Apr 17 23:39:34 2008] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. [Thu Apr 17 23:39:34 2008] [notice] Parent: Forcing termination of child process 36 [Thu Apr 17 23:39:35 2008] [notice] Child 4532: Released the start mutex [Thu Apr 17 23:39:36 2008] [notice] Child 4532: All worker threads have exited. [Thu Apr 17 23:39:36 2008] [notice] Child 4532: Child process is exiting Philippe M. Chiasson wrote: Finally, it's here and it works with Perl 5.10!
Re: Session handling
We do run a cron job to clean up the cache, Anyhow even it contains old data, they are basically expired, I can't understand how that gonna cause this issue, To my understanding we clean up the cache primarily because it is just filling up the hard disk, Other thing is I did not mention any cache file sie as such pls see the following code, In my Authentication handler overall what it does is once authenticated it does put the validated user in the session and try to use that value thereafter for subsequent requests. Following I extracted from my Auth hanlder to hightlight the places I do use the CGI:Session commands, Other mod_perl statements are left out # TMP_SESSION_FOLDER is the local folder to hold cookies defined else where my $session = new CGI::Session() or die CGI::Session->errstr; #as the new command looks after the expired cookies and also the existence, no any if conditions done but following #executes in each request $session = new CGI::Session(undef, undef, {Directory=> $TMP_SESSION_FOLDER}); # expire the session and also the remote_user_for_library parameter #SESSION_TIME_OUT is the timeout value(30m) and SESSION_USER_PARAM is the parameter name for authenticated user $session->expire($SESSION_TIME_OUT); $session->expire($SESSION_USER_PARAM, $SESSION_TIME_OUT); # retrieve remote_user from the session $retrieved_user = $session->param($SESSION_USER_PARAM); #if retrieved_user is not empty this is users subsequent request If it is the first time access it validates the user and put it to the session as follows. $user carries the value of the authenticated user $session->param($SESSION_USER_PARAM, $user); Here the issue is eventhough the session timeout is 30m, $session->param($SESSION_USER_PARAM, $user); return empty string before the 30m Hope this information is enough for some one to make a comment Malcolm J Harwood-3 wrote: > > On Thursday 17 April 2008 01:04:14 Tracy12 wrote: > >> for session handling we use CGI:Session cpan distribution, >> >> we do use local file for cookie storage, eventhough the session time out >> is >> 30, sometimes the set information in the >> session get lost before that, has anybody experience this before. > > That sounds like you are using a cache file and your cache is filling up. > >> We do have a cron job to clear the session data, Is there any solution >> for >> this behavior? What exactly the possible reason for such a thing. > > The nature of a cache is that it will drop older data to make room for > newer. > So your solutions are to make a larger cache file (you may have to > experiment > to work out what size you need), or to switch to some other session > storage > mechanism that has different properties. > > > -- View this message in context: http://www.nabble.com/Session-handling-tp16738934p16758221.html Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: [ANNOUNCE] mod_perl-2.0.4
I don't know if it's known, but 2.2.4 is a relatively stable version in conjunction with AP5.8 + mp2. I guess this means I can't move into 5.10 yet. Issac Goldstand wrote: I think we knew that (or am I getting mixed up with the mp1 RC?) and it was supposed to be a known issue... Issac Foo JH wrote: Alas, I have bad news to report: Tech stack: Windows 2003 Server Apache 2.2.4 Perl 5.10.0 mod_perl 2.0.4 from 10xx/ path Observations: 1. mod_perl is able to start 2. mod_perl is unable to survive an Apache restart signal 3. (relavant) error log available below: [Thu Apr 17 23:39:34 2008] [notice] Parent: Received restart signal -- Restarting the server. [Thu Apr 17 23:39:34 2008] [notice] Child 4532: Exit event signaled. Child process is ending. [Thu Apr 17 23:39:34 2008] [notice] Apache/2.2.8 (Win32) mod_perl/2.0.4-dev Perl/v5.10.0 configured -- resuming normal operations [Thu Apr 17 23:39:34 2008] [notice] Server built: Jan 18 2008 00:37:19 [Thu Apr 17 23:39:34 2008] [crit] (22)Invalid argument: Parent: Failed to create the child process. [Thu Apr 17 23:39:34 2008] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting. [Thu Apr 17 23:39:34 2008] [notice] Parent: Forcing termination of child process 36 [Thu Apr 17 23:39:35 2008] [notice] Child 4532: Released the start mutex [Thu Apr 17 23:39:36 2008] [notice] Child 4532: All worker threads have exited. [Thu Apr 17 23:39:36 2008] [notice] Child 4532: Child process is exiting Philippe M. Chiasson wrote: Finally, it's here and it works with Perl 5.10!