Content compression FAQ
Hello everyone again, This thread is supposed to improve Content Compression FAQ at http://perl.apache.org/docs/tutorials/client/compression/compression.html in order to assist Practical mod_perl as Stas suggested. Any of your questions, suggestions, concerns, and/or criticisms of FAQ would be highly appreciated over here. Basically, I'm going to rewrite the preamble, to make clear comparison of modules (a kind of table is expected), and to extend the list of practical questions targeting the interests of Apache administrators mainly. I would highly appreciate if somebody could offer a draft of short and clear explanation of features of Apache::Filter chain vs. Apache::OutputChain for those sysadmins who know nothing about them initially, but have to be able to configure them properly (with appropriate handlers) in the end. Please do not duplicate questions from the thread How practical... to over here. Currently I'm just placing formal redirections from that thread to this one. I will continue to answer all that questions here. Let's go ;-) Slava
Re: How practical is that Practical mod_perl?
From this point the discussion is switched to the thread Content compressed FAQ. See you there! Thanks, Slava - Original Message - From: Perrin Harkins [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 13, 2003 10:20 AM Subject: Re: How practical is that Practical mod_perl? On Fri, 2003-06-13 at 03:46, Slava Bizyayev wrote: Every good book about mod_perl achievements can result in better contracts for each of us and can bring aboard new talented contributors. A bad book can damage/destroy public interest and finally can kill this technology. There are many bad books about Perl and they haven't killed it. Regardless, I think what you're forgetting here is that you are complaining about a problem that is very obscure. Personally I fail to understand: Why would I hesitate to ask list for a help being ordered to write (or review) things in which I feel not quite expert? Stas asked many times for people to review the book, and some of us did. If I were writing a book and wanted to include a small example of compression, I would expect that reading the FAQ, reading the POD for the modules, and testing one of them out with whatever browsers I have handy would be enough. I would not feel the need to run an exhaustive test of every browser ever made just for a couple of pages in a huge book that is mostly about other things. To date there are no other module around with close set of properties and options... And I can not write this in my FAQ myself. Because it would be reasonably considered an impolite behavior. You can write the simple facts of the situation. The things you just mentioned on the list about Netscape 4 support are not in the FAQ. Neither is Apache::CompressClientFixup. You need to put them there, or no one will know about these issues. For example, you could add a section like this: Q: Are there any known problems with specific browsers? A: Yes, Netscape 4 has problems with compressed cascading style sheets and JavaScript files. Apache::Dynagzip handles this by detecting Netscape 4 and leaving those files uncompressed. If you are using one of the other modules, you can use Apache::CompressClientFixup to disable compression for these files. ... You get the idea. As long as you talk about specific issues and don't generally slam the other modules, no one will be upset by it. - Perrin
Re: How practical is that Practical mod_perl?
From this point the discussion is switched to the thread Content compressed FAQ. See you there! Thanks, Slava - Original Message - From: Stas Bekman [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: Perrin Harkins [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, June 14, 2003 3:11 AM Subject: Re: How practical is that Practical mod_perl? Slava, In my understanding you would better rewrite p.401-402 from the scratch for the next edition (which is not supposed to happen very soon, isn't it?). Otherwise, you will have to rewrite Apache::GzipChain appropriately. Whatever you decide, I would be more than happy to help you in that work. Just let me know. I will be waiting around. There is no need to wait for the next edition. Almost every technical book nowadays has an errata which keeps on growing, since the technology advance makes chunks of the book obsolete. We all know that and people are used to refer to the errata list which provides the updates and corrections if any. When the next edition comes, these updates normally get merged into the book. I think the simplest possible thing to do is this: Make sure that the tutorial on compression: http://perl.apache.org/docs/tutorials/client/compression/compression.html is up-to-date and everybody is happy with it. We will link to that document from the errata page, so all those interested in the compression state of art will read it before using it. When the time for a new edition comes, we will make sure that the link to the most up-to-date tutorial will be in the book. If you think that some of the compression-related material provided in the book is erroneous, I'd be more than happy to fix it, hopefully with a help of experts like yourself.please submit any corrections to [EMAIL PROTECTED] and we will put them online at http://modperlbook.org/. I think it's a time to start a new thread on how to improve: http://perl.apache.org/docs/tutorials/client/compression/compression.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: How practical is that Practical mod_perl?
From this point the discussion is switched to the thread Content compressed FAQ. See you there! Thanks, Slava - Original Message - From: Carl Brewer [EMAIL PROTECTED] To: Stas Bekman [EMAIL PROTECTED] Cc: Slava Bizyayev [EMAIL PROTECTED]; Perrin Harkins [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, June 14, 2003 9:28 AM Subject: Re: How practical is that Practical mod_perl? Stas Bekman wrote: Slava, [chomp] I think it's a time to start a new thread on how to improve: http://perl.apache.org/docs/tutorials/client/compression/compression.html For starters, apache2/mp2 coverage. As I understand it, and my logs seem to indicate, mod_deflate compresses everything thrown at it, dynamic or otherwise :)
Re: How practical is that Practical mod_perl?
From this point the discussion is switched to the thread Content compressed FAQ. See you there! Thanks, Slava - Original Message - From: David Dick [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, June 14, 2003 5:20 PM Subject: Re: How practical is that Practical mod_perl? or, as a bugfix for future versions of mod_perl compression modules, before compressing the page, the module should provide the option of adding 2048 bytes of spaces to the beginning of the page, which according to my quick calculations, gzips down to 46 bytes? only for ie6 of course. :) Slava Bizyayev wrote: gzip problem in IE6 http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496 is over since 1. M$ provides a free patch; 2. those lazy users (who usually don't care to apply patches) are not able to report problems anymore. Personally, I would recommend not to deal with deflate when possible. Thanks, Slava - Original Message - From: David Dick [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 13, 2003 6:46 AM Subject: Re: How practical is that Practical mod_perl? ok, i thought you might have been referred to problems that early versions of IE6 seemed to have with gzip, or with deflate problems in mozilla/n6. Slava Bizyayev wrote: NN-4.X sends HTTP header Accept-Encoding: gzip requesting any web content. Unfortunately NN-4.X fails to ungzip css files and JavaScript libraries. It is pretty old and well-known bug in NN-4.X. To work around this bug mod_gzip uses internal procedures for recognition of NN-4.X. The similar approach is used in mod_deflate. Apache::GzipChain does not have internal resources to work around this bug. You can find on CPAN http://search.cpan.org/author/SLAVA/Apache-CompressClientFixup-0.06/ which is supposed to serve any mod_perl compressor including Apache::GzipChain, but this handler is missed in example on p.402. # From: [EMAIL PROTECTED] # To: [EMAIL PROTECTED] # Date: Wed, 15 Jan 2003 20:05:06 +0200 # # ... Our customers still include 17% Netscape 4 users, sigh ... # Thanks, Slava - Original Message - From: David Dick [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, June 12, 2003 4:41 PM Subject: Re: How practical is that Practical mod_perl? The direct implementation of the example configuration p.402 is supposed to lead you to about 15% of unsatisfied clients recently. Can we have some more information about what in the implementation leads to the unsatisfied clients?
Re: mod_perl slower than expected?
On Friday 13 June 2003 23:00, you wrote: [ please keep it on the list ] Oops. Sorry. Used to mail lists auto-replying to the list. ^_^;; On Fri, 2003-06-13 at 03:23, Trevor Phillips wrote: I don't think so. Pretty standard Debian install, Perl 5.6.1... And you compiled both mod_perl and FastCGI yourself? No, they're the Debian binary packages. Would it make a difference, if they're using the same compile of Perl itself? The speed problem is not a connect time problem - it's actual run-time of the Perl code. I'm trying to narrow down what the problem is; I have a simple EDO script which is basically a bunch of nested iterations incrementing a counter. It contains no DB activity (just to show this isn't a DBI issue). I also ran it with the vanilla CGI version of the EDO parser, with the same result - everything is faster than running it under mod_perl. I've tried it on several different systems. Interestingly, the slow-down has occurred on all systems, with the exception being a Sun Sparc Ultra-5. All systems are running Debian, with a variety of Apache configs. There's also a mix of dual and single CPU, and a mix of Intel AMD CPUs. The only common thing between all the systems with the problem is they're using the i686 Debian package for mod_perl. I'll continue trying different configs, and will also try recompiling mod_perl myself... That's preloaded for some other modules. EDO uses Apache::Registry. (Which is another possible point of suspicion, although it's not used much... And Apache::Registry is supposed to be faster than CGI (which the FastCGI version uses) too...) Apache::Registry is faster than a CGI script. The CGI.pm module does something totally different, i.e. parsing params. CGI::Simple implements the same interface and is a drop-in replacement, so it might be worth a try. Oops! Sorry! I meant Apache::Request. I've never used Apache::Registry before. ^_^ Personally, I'd love to see a blend: Where I can have a light-weight mod_perl style interface in all daemons, which can interface to a possibly more limited number of FastCGIs. Gain the power of mod_perl, with the resource control of FastCGIs. You can do that with mod_perl 2, by setting up the number of perl interpreters you want to have available for each script. See http://perl.apache.org/docs/2.0/user/intro/overview.html#Threads_Support Yes, I've heard many good things about Apache 2 mod_perl 2, as well as many reasons not to shift everything to it yet. I look forward to the time it and I are ready to migrate. ^_^ -- . Trevor Phillips - http://jurai.murdoch.edu.au/ . : Web Technical Administrator - [EMAIL PROTECTED] : | IT Services- Murdoch University | | On nights such as this, evil deeds are done. And good deeds, of / | course. But mostly evil, on the whole. / \ -- (Terry Pratchett, Wyrd Sisters) /
Re: Current directory
Hi! On Tue, Jun 17, 2003 at 02:19:49AM +0200, Oskar wrote: when I am executing perl script on Apache it seems that the current directory is not the directory where the script is located but the directory c:\program files\apache group\apache. I need current dir to be the script dir since i have some pm in the script directories. I have apache 1.3.27 and mod_perl 1. See: http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}
mp2: right place to unescape HTML?
I'm using Stas's read_post() call from the test directory in mp1.99-10-dev, and am using it to grab POST data of the form of an email address .. this is giving me this : read_post returned : username=carl%40somewherepassword=foo Escaped the @ ... of course. I'm curios, where's the best place to unescape it? Should I do it in the read_post function, or afterwards? Recommendations? thanks Carl
Howto: non-LFS Apache 1.3.27 w/ LFS Perl 5.8.0 (using mod_perl)
All Sorry if this question goes out to the wrong discussion group, but I've been told if anyone could answer this then it'll be someone on this forum :) Ok, here goes... We use Perl 5.6.x and Perl 5.8.0 with LFS. We also use mod_perl 1.27 with LFS and Apache 1.3.27 (with LFS). To make a long story short...we are running into issues with vendors like IBM and Oracle where they don't want to re-compile their code (i.e. mod_ossos) with LFS. So, we need to run a non-LFS build of Apache 1.3.27. The only way (to our knowledge) we can do this is by re-compiling Perl 5.8.0 without LFS, which means that we have to support two versions of Perl / CPAN / etc...not likely in our current situation. Someone just told me that we can use Apache (Non-LFS) with Perl (LFS) using mod_perl (PERL_USELARGEFILES=0, set in Makefile.PL)? This I know Doug MacEachern did not support in earlier versions of mod_perl. BTW. We just-compiled it and it seems to work, HOWEVER I'm concerned about Segmentation Faults (this is common when using LFS modules with a non-LFS Apache build). For some reason we don't get these errors when using mod_perl /LFS with non-LFS Apache. How is this possible? Here is our mod_perl build script: ... # run the following from the mod_perl source directory $perl_base/bin/perl Makefile.PL \ INSTALLDIRS=perl PREFIX=$prefix \ USE_APXS=1 WITH_APXS=$apache_base/bin/apxs \ EVERYTHING=1 make ... Regards, Jaco Greyling Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
non-LFS Apache 1.3.27 w/ LFS Perl 5.8.0 (using mod_perl)
All Sorry if this question goes out to the wrong discussion group, but I've been told if anyone could answer this then it'll be someone on this forum :) Ok, here goes... We use Perl 5.6.x and Perl 5.8.0 with LFS. We also use mod_perl 1.27 with LFS and Apache 1.3.27 (with LFS). To make a long story short...we are running into issues with vendors like IBM and Oracle where they don't want to re-compile their code (i.e. mod_ossos) with LFS. So, we need to run a non-LFS build of Apache 1.3.27. The only way (to our knowledge) we can do this is by re-compiling Perl 5.8.0 without LFS, which means that we have to support two versions of Perl / CPAN / etc...not likely in our current situation. Someone just told me that we can use Apache (Non-LFS) with Perl (LFS) using mod_perl (PERL_USELARGEFILES=0, set in Makefile.PL)? This I know Doug MacEachern did not support in earlier versions of mod_perl. BTW. We just-compiled it and it seems to work, HOWEVER I'm concerned about Segmentation Faults (this is common when using LFS modules with a non-LFS Apache build). For some reason we don't get these errors when using mod_perl /LFS with non-LFS Apache. How is this possible? Here is our mod_perl build script: ... # run the following from the mod_perl source directory $perl_base/bin/perl Makefile.PL \ INSTALLDIRS=perl PREFIX=$prefix \ USE_APXS=1 WITH_APXS=$apache_base/bin/apxs \ EVERYTHING=1 ... Regards, Jaco Greyling Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
Re: Current directory
I already read that article before posted the message here but it does not solve the problem: I am running more than one web so the adding of each particular directory seems to me little bit dumb. Also i dont see the reason why the current dir should be changed to the dir different from the script dir. Any other suggestion to solve it? Oskar - Original Message - From: Thomas Klausner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 9:41 AM Subject: Re: Current directory Hi! On Tue, Jun 17, 2003 at 02:19:49AM +0200, Oskar wrote: when I am executing perl script on Apache it seems that the current directory is not the directory where the script is located but the directory c:\program files\apache group\apache. I need current dir to be the script dir since i have some pm in the script directories. I have apache 1.3.27 and mod_perl 1. See: http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}
new libapreq-1.2 release candidate 2 available
A new release candidate #2 for libapreq-1.2 is available: http://httpd.apache.org/~joes/libapreq-1.2_rc2.tar.gz Please give it a try and report any problems to the apreq-dev@ list. I'd like to release this version to CPAN as soon as possible. Thanks. Changes since 1.1: July 13, 2003 Experimental support for SFIO is withdrawn. April 30, 2003 Add documentation for subclassing Apache::Request. [Steve Hay] April 18, 2003 Sync test suite uris with latest Apache::Test [Stas] Patch mfd parser's Content-Disposition header to do case-insensitive matches on name filename keywords. This feature allows uploads from Nokia Series 60 phones to work as expected. [Oskari 'Okko' Ojala] Patch Request.xs to revert to using pre-1.1 $upload-fh code for pre-5.8 perls. This patch may get backed out prior to 1.2's release, unless it is known to resolve problems (zombies?) reported to occur with libapreq-1.1 uploads and pre-5.8 perls. [Joe] February 27, 2003 do a better mod_perl version checking, including the test for mod_perl 2.0. [Stas] Applied IKEBE Tomohiro's patch for handling %u strings. February 27, 2003 Add req-nargs to C API to distinguish between query string and request body params. -- Joe Schaefer
Re: mod_perl slower than expected?
Hi there, On Tue, 17 Jun 2003, Trevor Phillips wrote: [snip] The speed problem is not a connect time problem - it's actual run-time of the Perl code. [snip] The only common thing between all the systems with the problem is they're using the i686 Debian package for mod_perl. Do you know for sure that the Per was compiled for i686? Maybe it was compiled for i386, so it would run on just about anything but it can't use a lot of the faster features found in later processors. I'd always compile my own executables, if only so I know what's in there. 73, Ged.
mod_perl PerlTransHandler weirdness
Hi, I would not be surprised if this problem has arisen due to me expecting more from Apache+mod_perl than it's capable of. The server is running Apache 1.3.mumble with mod_perl and mod_php. The site has been entirely built in PHP, by somebody else. They want the facility for http://foo.bar.com/david to redirect to http://foo.bar.com/?page=publicprofile.phpname=david . As I understand it, this needs to run at the URI Translation stage in Apache, which is exposed thru mod_perl via PerlTransHandlers. In the event that the request doesn't match these criteria, it needs to return control to Apache in order that the page gets served as normal (through mod_php). Without the handler in place, this all works, but the /david form doesn't, since there's no code in place to do it. Basically, I have a handler Apache::Publicprofile::Redirector::handler() which is in Apache/Publicprofile/Redirector.pm It is loaded in the site Apache config like: ##begin apache config excerpt## [ inside a VirtualHost block, outside Location block ] PerlModule Apache::Publicprofile::Redirector SetHandler perl-script PerlTransHandler Apache::Publicprofile::Redirector PerlSendHeader Off ##end apache config excerpt## I'm attaching the module, with a slight change to remove the actual webserver details, as requested by the guy whose project this is. I hope the code is self-explanatory, please query any bits that aren't. Currently, the behaviour exhibited is as follows: In any case, regardless of whether the handler is returning OK or DECLINED, Apache tries to serve the *source* of /index.php - ie without running it through mod_php. Is the issue perhaps that PerlTransHandler is the wrong stage to run at? Is it even possible to do what they want to do? FWIW, changing $r-path_info to $r-uri changes from 404 Not Found to 400 Bad Request. It was suggested that path_info may not be available yet by the trans phase. Any help _much_ appreciated - I'm lost here! /joel -- S. Joel Bernstein joel at fysh dot org Apache-Publicprofile-Redirector.pm Description: Perl program
RE: AuthenNTLM undefined value
-Original Message- From: Scandalz.net [mailto:[EMAIL PROTECTED] Subject: Re: AuthenNTLM undefined value what's on line 478 of AuthenNTLM? sub handler ($$) { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; my $self ; my $conn = $r - connection ; LINE 478 - Original Message - From: Franks, David [EMAIL PROTECTED] I am trying to use AuthenNTLM. I put an .htaccess file in a directory and when I try to access the URL for the directory, it gives me an internal server error. The apache error log contains: Can't call method connection on an undefined value at /usr/opt/perl5/lib/site_perl/5.005/aix/Apache/AuthenNTLM.pm line 478. I am using Apache-AuthenNTLM-0.23 + apache_1.3.27 + mod_perl-1.27. Here is the .htaccess file: PerlAuthenHandler Apache::AuthenNTLM AuthType ntlm AuthName test require user 208512 PerlAddVar ntdomain PHS phsntpdc #PerlAddVar ntdomain other_domain pdc_for_domain bdc_for_domain PerlSetVar defaultdomain PHS PerlSetVar ntlmdebug 1 Any ideas? Dave Franks [EMAIL PROTECTED]
Re: mod_perl PerlTransHandler weirdness
Alternatively, can anybody suggest a different way to offer this functionality? I don't think mod_rewrite applies, since the tests are too complicated, but would stand corrected if somebody knows different... I posted this to london.pm earlier and had no joy. /joel, getting a bit desperate.
Re: mod_perl PerlTransHandler weirdness
On Tue, 2003-06-17 at 13:56, Joel Bernstein wrote: Alternatively, can anybody suggest a different way to offer this functionality? I don't think mod_rewrite applies, since the tests are too complicated, but would stand corrected if somebody knows different... Have you tried moving the index.php out of root into a directory (virtual or otherwise) where all content is passed thru mod_php - can't remember the settings off the top of my head. or you could use an internal redirect so that apache treats the new url as a new request and starts from the beginning of its cycle. hth, A. -- Aaron Trevena, BSc (Hons) --- Software Engineer Tusker Direct :: www.tuskerdirect.com
Re: mod_perl PerlTransHandler weirdness
Joel Bernstein wrote: Hi, I would not be surprised if this problem has arisen due to me expecting more from Apache+mod_perl than it's capable of. The server is running Apache 1.3.mumble with mod_perl and mod_php. The site has been entirely built in PHP, by somebody else. They want the facility for http://foo.bar.com/david to redirect to http://foo.bar.com/?page=publicprofile.phpname=david . the secret to the PerlTransHandler is this: it is there to make the URI into a file. so, if you deconstruct the URI to a point where you know which real file you want to serve (at a filesystem level, that is, like /usr/local/apache/htdocs/foo.html) then set $r-filename and return OK. otherwise, what you want to do is set $r-uri to the relative URI you want Apache to deconstruct and return DECLINED. the default Apache trans handler will then map it to a filename for you. Apache will also take care of directories, non-files (like URIs such as /server-status which do not map to files) and so on. so, given http://foo.bar.com/?page=publicprofile.phpname=david you might want to really execute http://foo.bar.com/publicprofile.php?name=david, right? so, parse the incoming $uri and set $r-uri to '/publicprofile.php?name=david' and return DECLINED. now, if publicprofile.php is not running as PHP it means that mod_php is not set up properly - perhaps you not used AddHandler to specify .php files as mod_php scripts, or perhaps have used SetHandler to override the default handler for the Location that governs. the way to test this is to request the resulting uri (/publicprofile.php?name=david) and see if it works without your trans handler. once that works, just insert the trans handler and try again. It was suggested that path_info may not be available yet by the trans phase. yup. $r-path_info is what is left over from the URI once the URI is mapped to a file or Location, so it should be empty until after translation (and possibly empty after as well). HTH --Geoff
puzzle of split() running under mod_perl
Title: Message Hi, We arerunning CSWS1.2(based on Apache 1.3.6) on Open VMS V7.3-1 and CSWS_PERL V1.1 based on Mod_Perl V1.25. We have a function that changes the directory format from Unix to VMS, and this function is used in almost every script of our CGIs. Whenever the CGI that invokes this function get requested twice, the server process dies after the page comes out. In a single threaded server, we get Fatel error in the error log file. Fatal VMS error (status=36) at ROOT$:[PERL5_006_01]VMS.C;2, line 802 during global destruction. In a multi threaded server, we get a notice in the error log file [notice] child pid ab26 exit signal Bad system call. We noticed that it is the regex argument of function split causes the problem. We took this split statement out into a simpleCGI script, and that CGI script works fine in mod_perl. Afteradding quotes outside of the regex of split function in subVMSify, the error went away.We could not figure out why the statement bombs out in our VMSify functionand why adding quotes fixed it. The following are the test script and output in the browser. Thanks in advance for all helps. test.cgi *** use strict;print "content-type:text/html\n\n";print "head/headbody\n"; Test(); sub Test{ foreach (@::INC) { VMSify($_); }} sub VMSify{ my @subDirs; my $directory=uc(shift); $directory=~s/^\/|\/$//g; print "dir=$directory\nbr";# @subDirs=split("/\//",$directory); @subDirs=split(/\//,$directory); $directory=undef; if(defined $ENV{$subDirs[0]}){ $directory=shift(@subDirs).':'; }elsif(scalar(@subDirs)==1 $subDirs[0] eq '.'){ # Special case for current directory @subDirs=(); $directory='[]'; } if(scalar(@subDirs)){ $directory.='['; $directory.=join('.',@subDirs); $directory.=']'; } print "dir after=$directory\nbr"; return $directory;} *** The output in the web brower is dir=DYM$DISK/DYMAX/PERL/DYLIB dir after=DYM$DISK:[DYMAX.PERL.DYLIB] dir=PERL_ROOT/LIB/VMS_AXP/5_6_1 dir after=PERL_ROOT:[LIB.VMS_AXP.5_6_1] dir=PERL_ROOT/LIB dir after=PERL_ROOT:[LIB] dir=PERL_ROOT:[LIB.SITE_PERL.VMS_AXP] dir after=[PERL_ROOT:[LIB.SITE_PERL.VMS_AXP]] dir=PERL_ROOT:[LIB.SITE_PERL] dir after=[PERL_ROOT:[LIB.SITE_PERL]] dir=PERL_ROOT/LIB/SITE_PERL dir after=PERL_ROOT:[LIB.SITE_PERL] dir=. dir after=[] dir=APACHE$ROOT dir after=APACHE$ROOT: dir=APACHE$ROOT/LIB/PERL dir after=APACHE$ROOT:[LIB.PERL] June Young, Software Development bus: (902)422-1973 x144Dymaxion Research Ltd., 5515 Cogswell St., fax: (902)421-1267Halifax, Nova Scotia, B3J 1R2 Canadamailto: [EMAIL PROTECTED]http://www.dymaxion.ca
Can't call method is_initial_req without a package or object reference at .........
All, I'm having some problems with Apache giving me grief, or most probably me getting my knickers in a complete twist. I get the following error:- Can't call method is_initial_req without a package or object reference at . It seems to happen when my URL ends like this:- /somepath/16 but not when it ends like this:- /somepath/16/ Below is the code which is where the error occurs. sub handler { my $r = My::Apache::Request-instance(shift); print STDERR Dumper($r); print STDERR \n\n\nBOOOBS\n\n\n\n\n; die $r not defined unless $r; return OK unless $r-is_initial_req();#ERROR OCCURS HERE my $uri = $r-uri; my $log = $r-log; .. } The handler is simply a multiplexer which based upon a database configuration adds the relevant method handler to the handlers queue. The 'instance' routine for My::Apache::Request is inheritted from the Apache::Request class. the 'new' routine for My::Apache::Request is as follows:- sub new { my ($class, $r) = @_; my $length=32; unless ($r-is_main ) { print STDERR Apache::Request is not Main, Getting Main\n; print STDERR Dumper($r); $r=$r-main; print STDERR Main Apache::Request is:-\n; print STDERR Dumper($r); print STDERR DECLINING\n; return DECLINED; } unless ($r) { print STDERR making a new Request object\n; $r = Apache-request; } $r=Apache::Request-new($r); my $self = bless {_r = $r}, $class; my $t=substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, $length); $self-{XX_created_time_XX}=$t; my @params=$self-param(); print STDERR Here's the Parameters for $class\n; print STDERR Dumper(@params); my $lang_id=$self-param('lang_id'); if ($lang_id) { $lh=My::Maketext-get_handle($class,$lang_id); } else { $lh=My::Maketext-get_handle($class,My::Conf::DEFAULT_LANGUAGE_ID); } print STDERR Creating .ref($self). $t\n; #$self-interpret_uri; return $self; }
Mod Image Magick
Hi, I have some problems when i try install the mod Image Magick. #perl -MCPAN -e 'install Image::Magick' CPAN.pm: Going to build J/JC/JCRISTY/PerlMagick-5.56.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Image::Magick cp Magick.pm blib/lib/Image/Magick.pm AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick) /usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap Magick.xs Magick.xsc mv Magick.xsc Magick.c cc -c -I../ -I.. -I/usr/include/freetype2 -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I/usr/X11R6/include -I/usr/include/libxml2 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -DVERSION=\5.56\ -DXS_VERSION=\5.56\ -fpic -I/usr/local/lib/perl5/5.8.0/i586-linux/CORE -DHAVE_CONFIG_H Magick.c Running Mkbootstrap for Image::Magick () chmod 644 Magick.bs rm -f blib/arch/auto/Image/Magick/Magick.so LD_RUN_PATH=/usr/lib:/usr/X11R6/lib cc -shared -L/usr/local/lib Magick.o -o blib/arch/auto/Image/Magick/Magick.so -L/usr/X11R6/lib -L/usr/lib -L/usr/lib -lMagick -lfreetype -lXext -lSM -lICE -lX11 -lbz2 -lz -lpthread -lm chmod 755 blib/arch/auto/Image/Magick/Magick.so cp Magick.bs blib/arch/auto/Image/Magick/Magick.bs chmod 644 blib/arch/auto/Image/Magick/Magick.bs Manifying blib/man3/Image::Magick.3 /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/bzlib/*.t t/jpeg/*.t t/mpeg/*.t t/png/*.t t/ps/*.t t/tiff/*.t t/ttf/*.t t/x/*.t t/xfig/*.t t/zlib/*.t t/blobdubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay ... Can't load '/root/.cpan/build/PerlMagick-5.56/blib/arch/auto/Image/Magick/Magick.so' for module Image::Magick: /root/.cpan/build/PerlMagick-5.56/blib/arch/auto/Image/Magick/Magick.so: undefined symbol: inflate at /usr/local/lib/perl5/5.8.0/i586-linux/DynaLoader.pm line 229. at t/zlib/read.t line 10 Compilation failed in require at t/zlib/read.t line 10. BEGIN failed--compilation aborted at t/zlib/read.t line 10. Can't load '/root/.cpan/build/PerlMagick-5.56/blib/arch/auto/Image/Magick/Magick.so' for module Image::Magick: /root/.cpan/build/PerlMagick-5.56/blib/arch/auto/Image/Magick/Magick.so: undefined symbol: inflate at /usr/local/lib/perl5/5.8.0/i586-linux/DynaLoader.pm line 229. at t/zlib/write.t line 10 Compilation failed in require at t/zlib/write.t line 10. BEGIN failed--compilation aborted at t/zlib/write.t line 10. Failed 26/26 test scripts, 0.00% okay. 284/284 subtests failed, 0.00% okay. make: ** [test_dynamic] Erro 2 ... Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/zlib/write..dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed --- t/blob.t 255 65280 11 100.00% 1 t/bzlib/read.t255 65280 11 100.00% 1 t/bzlib/write.t 255 65280 11 100.00% 1 t/filter.t255 6528043 43 100.00% 1-43 t/getattribute.t 255 6528025 25 100.00% 1-25 t/jpeg/read.t 255 65280 22 100.00% 1-2 t/jpeg/write.t255 65280 22 100.00% 1-2 t/montage.t 255 6528019 19 100.00% 1-19 t/mpeg/read.t 255 65280 22 100.00% 1-2 t/png/read-16.t 255 65280 55 100.00% 1-5 t/png/read.t 255 65280 66 100.00% 1-6 t/png/write-16.t 255 65280 55 100.00% 1-5 t/png/write.t 255 65280 66 100.00% 1-6 t/ps/read.t 255 65280 33 100.00% 1-3 t/ps/write.t 255 65280 22 100.00% 1-2 t/read.t 255 6528045 45 100.00% 1-45 t/setattribute.t 255 6528068 68 100.00% 1-68 t/tiff/read.t 255 65280 33 100.00% 1-3 t/tiff/write.t255 65280 33 100.00% 1-3 t/ttf/read.t 255 65280 33 100.00% 1-3 t/write.t 255 6528034 34 100.00% 1-34 t/x/read.t255 65280 11 100.00% 1 t/x/write.t 255 65280 11 100.00% 1 t/xfig/read.t 255 65280 11 100.00% 1 t/zlib/read.t 255 65280 11 100.00% 1 t/zlib/write.t255 65280 11 100.00% 1 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force and now? what i do? don't have idea. Some sugestion is welcome. Thanks! Augusto Flavio ___ Yahoo! Mail Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam. http://br.mail.yahoo.com/
Re: Can't call method is_initial_req without a package or objectreference at .........
Martin Moss wrote: All, I'm having some problems with Apache giving me grief, or most probably me getting my knickers in a complete twist. I get the following error:- Can't call method is_initial_req without a package or object reference at . It seems to happen when my URL ends like this:- /somepath/16 but not when it ends like this:- /somepath/16/ /somepath/16 is resollved by mod_dir to /somepath/16/ using an internal redirect, and... unless ($r-is_main ) { print STDERR Apache::Request is not Main, Getting Main\n; print STDERR Dumper($r); $r=$r-main; print STDERR Main Apache::Request is:-\n; print STDERR Dumper($r); print STDERR DECLINING\n; return DECLINED; } you're not returning an object from your constructor on internal redirects :) HTH --Geoff
RE: new libapreq-1.2 release candidate 2 available
Hello, I'm using RedHat 8.0 (httpd-2.0.40-11.5, mod_perl-1.99-05-3). I want to know how can I compile this module, because when I try to run perl Makefile.PL, it returns: mod_perl 1.x ( 1.99) is required at Makefile.PL line 31. So, is this module compatible with mod_perl 2 ? My real interent in this module is for file uploading (form-multipart). How can I do it with or without this module ??? Thanks, Alejandro. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Joe Schaefer Sent: Tuesday, June 17, 2003 6:08 AM To: [EMAIL PROTECTED] Subject: new libapreq-1.2 release candidate 2 available A new release candidate #2 for libapreq-1.2 is available: http://httpd.apache.org/~joes/libapreq-1.2_rc2.tar.gz Please give it a try and report any problems to the apreq-dev@ list. I'd like to release this version to CPAN as soon as possible. Thanks. Changes since 1.1: July 13, 2003 Experimental support for SFIO is withdrawn. April 30, 2003 Add documentation for subclassing Apache::Request. [Steve Hay] April 18, 2003 Sync test suite uris with latest Apache::Test [Stas] Patch mfd parser's Content-Disposition header to do case-insensitive matches on name filename keywords. This feature allows uploads from Nokia Series 60 phones to work as expected. [Oskari 'Okko' Ojala] Patch Request.xs to revert to using pre-1.1 $upload-fh code for pre-5.8 perls. This patch may get backed out prior to 1.2's release, unless it is known to resolve problems (zombies?) reported to occur with libapreq-1.1 uploads and pre-5.8 perls. [Joe] February 27, 2003 do a better mod_perl version checking, including the test for mod_perl 2.0. [Stas] Applied IKEBE Tomohiro's patch for handling %u strings. February 27, 2003 Add req-nargs to C API to distinguish between query string and request body params. -- Joe Schaefer
Re: Can't call method is_initial_req without a package or object reference at .........
Ok, that makes sense, thank you:-) But 'What' should I return, is $r-main the right thing to return? unless ($r-is_main ) { print STDERR Apache::Request is not Main, Getting Main\n; print STDERR Dumper($r); $r=$r-main; print STDERR Main Apache::Request is:-\n; print STDERR Dumper($r); print STDERR DECLINING\n; return DECLINED; } you're not returning an object from your constructor on internal redirects :) HTH --Geoff
Re: temporal directory used by apache/mod-perl?
Apache::Request has a bug, it doesn't throw an error code when the file is partially uploaded. That's why I'm using Apache read() instead. Any idea how tosetup the temporal directory for mod-perl without Apache::Request? What's wrong with TEMP_DIR ? my $apr = Apache::Request-new($r, TEMP_DIR = /home/httpd/tmp); my $upload = $apr-upload('file'); $upload-link(/home/user/myfile) || warn link failed: $!; see: perldoc Apache::Request -- WBR, Mike P. Mikhailov mailto: [EMAIL PROTECTED] ICQ:280990142 My mother always used to tell me, The early bird gets the worm. -- Hector Pizarro Amautatech
Re: Can't call method is_initial_req without a package or object reference at .........
Thanks Geoffrey. Marty - Original Message - From: Geoffrey Young [EMAIL PROTECTED] To: Martin Moss [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 4:23 PM Subject: Re: Can't call method is_initial_req without a package or object reference at . Martin Moss wrote: Ok, that makes sense, thank you:-) But 'What' should I return, is $r-main the right thing to return? I've found that it's pretty rare that you want to mess with main vs subrequest logic yourself. instead, I would just make the constructor return an object based on whatever mod_perl passes it which is, in turn, whatever request record Apache deems to be the proper one for the current (sub)request. so new() should probably just be something like sub new { my ($class, $r) = @_; $r = Apache::Request-new($r); my $self = bless {_r = $r}, $class; $self-init(); return $self; } if it is important to insure that you only populate object attributes once, even in the case of internal redirects or lookups, you could hang attributes off of pnotes in the main request sub init { my $self = shift; $t = ubstr(Digest::MD5...); if ($r-main) { $self-{XX_created_time_XX} = $t; $self-{_r}-pnotes(XX_created_time_XX = $t) } else { $t = $self-{_r}-main-pnotes('XX_created_time_XX'); } ... } or somesuch. untested, but you get the idea :) HTH --Geoff
Re: Mod Image Magick
- Original Message - From: Augusto Flavio [EMAIL PROTECTED] To: modPerl List [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 4:51 AM Subject: Mod Image Magick Hi, I have some problems when i try install the mod Image Magick. [snipped] Hi Augusto - I, for one, have NEVER gotten Image::Magick from CPAN to install!!! I even tried to go to the Image::Magick home page and manually install the image magick pgm + the perl module provided - again a wasted day! I'm not sure what is going on with Image::Magick; their mailing list was of no help - is I::M still active? Anyway, I use it on my web site, and use the pre- packaged I::M program and perl module that came with my Linux distribution (SuSE). Maybe someone out there knows what is going on (Randy K., are you around today?) Sorry - not much help... Aloha = Beau;
Re: list of ported modules?
Stas Bekman wrote: Shannon Eric Peevey wrote: Hi! Is there a list of CPAN modules that have already been ported to work with mod_perl2? Not at the moment, but it's a great idea. Where should we add it? I suppose that this should be a short-life document and eventually it will be removed. So we can put it anywhere. there is: http://perl.apache.org/products/apache-modules.html we could put a section there. That looks like a great place to me :) (BTW, should we make it dynamically updateable, to encourage participation in the list?) What do we have now: Already ported: --- CGI CGI::Cookie Apache::Peek Apache::AuthNetLDAP Apache::AuthzNetLDAP In the process: Module Porters Apache::MP3 Stas Bekman/Clemens Schrimpe [EMAIL PROTECTED] Apache::Scoreboard Stas Bekman Apache::VMonitor Stas Bekman Apache::AuthPerLDAP Shannon Eric Peevey [EMAIL PROTECTED] Anything else I have missed? If you have ported a module or in the middle of porting please tell us. the latter should list the email of the porter so the interested parties can help with the porting. If so, can I add my two modules to it? (Apache::AuthNetLDAP and Apache::AuthzNetLDAP). are they on CPAN already? Yes :) I uploaded Apache::AuthzNetLDAP yesterday. speeves cws
ANNOUNCE: Gestinanna::POF::Repository 0.01
Gestinanna::POF::Repository manages a revision controlled data store based on Gestinanna::POF::Alzabo, allowing revision-controlled documents without requiring direct filesystem access. This package uses CVS as its model but with some differences: o Objects may not be deleted o If a revision greater than the currently modified one already exists, a branch is forced (e.g., if saving a modification to revision 1.2 and revision 1.3 already exists, then a branch is forced, creating a revision similar to 1.2.1.1 (or the first available branch number under 1.2) ) o This module does not track blame information -- blame tracking implementation is application-dependent o An object may have multiple attributes under revision control This does require Gestinanna::POF 0.03, also released at the same time as this package. Changes for Gestinanna::POF: ENHANCEMENTS: - Added support for MLDBM::Sync to Gestinanna::POF::MLDBM. - Added private (unpublished) tests for Gestinanna::POF::LDAP. It should work with LDAP databases at least in read-only mode. BUG FIXES: - Gestinanna::POF::Alzabo had incorrect is_live call to see if it should insert or update. This was exposed by the Gestinanna::POF::Repository package. The uploaded file Gestinanna-POF-Repository-0.01.tar.gz has entered CPAN as file: $CPAN/authors/id/J/JS/JSMITH/Gestinanna-POF-Repository-0.01.tar.gz size: 23973 bytes md5: 2781649b37773d5c31ecead6ade464f2 The uploaded file Gestinanna-POF-0.03.tar.gz has entered CPAN as file: $CPAN/authors/id/J/JS/JSMITH/Gestinanna-POF-0.03.tar.gz size: 36424 bytes md5: 7ed3395416ae518e76dd472f6ab34658 It may take a little while for these packages to make their way to your favorite mirror. They are also available on the SourceForge project page: http://sf.net/projects/gestinanna/ -- James Smith [EMAIL PROTECTED], 979-862-3725 Senior Software Applications Developer, Texas AM CIS Operating Systems Group, Unix
Apache::Auth*LDAP modules going bye-bye...?
Hi! I have installed Apache::AuthenLDAP into my apache 1.3 test machine, and found that version 0.61 does not work with perl-ldap 0.28 (aka Net::LDAP) Since there has not been an update to this module since July 12, 2001, I think that it is safe to say that there is no interest in continuing to support this module. (BTW, I found the same offending code in Apache::AuthzLDAP.) I have compared the functionality of these two module to Apache::AuthNetLDAP and Apache::AuthzNetLDAP, and found that the latter two modules contain all of the functionality of the Bodnar/Gilmore modules, plus some. (NOTE: Apache::AuthzLDAP does have a NestedGroups functionality that will allow recursive searching through... nested groups ;) Is this useful for anyone? If so, then we can add it into Apache::AuthzNetLDAP.) Therefore, I have come to the conclusion that we will not need to port these modules to modperl2... Any dissenters? Also, after perusing the code in both Apache::AuthPerLDAP and Apache::AuthLDAP, both of which have not been updated in over 4 years, I see that all functionality is also available in Apache::AuthNetLDAP. I also think that I will bypass porting these modules as well. Again, any dissenters? speeves cws
Re: Current directory
On Tue, 17 Jun 2003, Oskar wrote: - Original Message - From: Thomas Klausner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 9:41 AM Subject: Re: Current directory Hi! On Tue, Jun 17, 2003 at 02:19:49AM +0200, Oskar wrote: when I am executing perl script on Apache it seems that the current directory is not the directory where the script is located but the directory c:\program files\apache group\apache. I need current dir to be the script dir since i have some pm in the script directories. I have apache 1.3.27 and mod_perl 1. See: http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl I already read that article before posted the message here but it does not solve the problem: I am running more than one web so the adding of each particular directory seems to me little bit dumb. Also i dont see the reason why the current dir should be changed to the dir different from the script dir. Any other suggestion to solve it? You might try the FindBin module; from the docs, NAME FindBin - Locate directory of original perl script SYNOPSIS use FindBin; use lib $FindBin::Bin/../lib; or use FindBin qw($Bin); use lib $Bin/../lib; However, note the following: KNOWN ISSUES If there are two modules using FindBin from different directories under the same interpreter, this won't work. Since FindBin uses BEGIN block, it'll be executed only once, and only the first caller will get it right. This is a problem under mod_perl and other persistent Perl environments, where you shouldn't use this module. Which also means that you should avoid using FindBin in modules that you plan to put on CPAN. The only way to make sure that FindBin will work is to force the BEGIN block to be executed again: delete $INC{'FindBin.pm'}; require FindBin; -- best regards, randy kobes
Re: problem building libapreq on Solaris
Can someone please direct me to where I can unsubscribe from this list. Thanks, Jordan Ward PMO Marketing Director Dzinehaus.info Xavier Noria wrote: On Saturday 14 June 2003 20:54, Ged Haywood wrote: On Fri, 13 Jun 2003, Xavier Noria wrote: Hello, I've just compiled Apache 1.3.27 with mod_perl 1.27 from their tarballs on Solaris. perl is 5.8.0 packaged for Solaris. The installation of libapreq with cpan(1) stops here: [snip] t/httpd -f `pwd`/t/httpd.conf /bin/sh: t/httpd: not found [snip] Looks like it's taking t/httpd instead of /usr/local/apache/bin/httpd, Don't know if there's anyone who actually knows what's going on here but I thought you'd just like to hear from somebody. :) [snip] You could try a soft link from there to the real httpd - I have no idea if something else will then fail. Thank you very much, the symlink worked for libapreq-1.1. I first tried to install the just announced 1.2-rc2, but make test failed: PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/*t/*.t does not exist FAILED--1 test script could be run, alas--no output ever seen make: *** [test_dynamic] Error 2 I have a full typescript file and subscribed to the dev mailing list to report this, I'll send it right away when I receive the confirmation of the subscription from the list manager. Thank you all! fxn -- $_=q;Barcelona Perl Mongers;,$/=y,gaudi,,,;map$,+=(split//)*(-1)**$e++, (split)[.11_09,1.714];$.=qq~~!~m~erce~;$=y,catalunya,,,$;=y,rambles,,, $*=$/^$.;$:=$.+length,[EMAIL PROTECTED]/**$*%$:,$%=$/*$-$*;print+chr($_012? 10$_:/^1/?1$_:$_)for($**($**$%-$//$/),$%-$*,$,*$/,$***$***$*,$***$, ,$[EMAIL PROTECTED]/,$**$,,$;,$***$***$*,$***$*,$.,$**$,$***$,,$***$***$**$,= ~~$.,$*$*,$***$/,$***$,,$,-$.,$[EMAIL PROTECTED]/,$;*$/**$*,$,$.,[EMAIL PROTECTED])
mp2: Re: Can't call method method on an undefined value at Apache-Test/lib/Apache/TestRequest.pm
Brent, I think Stas was having a bit of a look at it, I just ignored the error messages and installed it anyway :) Carl Brent Jensen wrote: Carl, I'm getting the same error on the make test w/ Mod Perl. Did you resolve this issue? I'm using FreeBSD 5.1. Is it really an issue or is it just a testing problem. I get the same error you're getting: Can't call method method on an undefined value at Apache-Test/lib/Apache/TestRequest.pm line 411. Thanks, Brent
Re: Error Handling/Reporting
Yeah, CGI::Carp will do exactly what you want. I trap all system errors (DBI, die, etc) using Carp and format the results into a nice webpage for the user and further, I email myself the error along with the environment variables in use at the time as well as a stack dump of where it occured. This has been a life saver for me. I put this in a module that is included in all perl scripts. Here's my code snippet that does all the work, it might give you some ideas . use CGI::Carp qw(fatalsToBrowser set_message carpout) ; $SIG{'__DIE__'} = \handle_errors; # This just makes sure we catch errors and send to handle_errors # BEGIN ensure this always gets executed first BEGIN { sub handle_errors { $| = 1 ; # Flush all output my $msg = shift; my $docroot = $ENV{SITE_ROOT}/html ; # Default is the default error template my $file = blank_app_error.html ; print Can't open error file *$ENV{SITE_ROOT}/html/$file* :: $msg if !-e $ENV{SITE_ROOT}/html/$file ; set_message(Error in error handling: $msg) ; my $text = qq{ System Error: $msg pThis error has already been forwarded to our support department.p DBname: $db DBhost: $dbhost Site: $ENV{SITE123} } ; my $jstext = $text ; $jstext =~ s/p/\\n\\n/gsi ;# Convert paragraphs to newlines $jstext =~ s/(')|()/\\$1/gsi ; # convert embedded quotes with escaped versions $jstext =~ s/\015\012/\\n/gsi ; # convert the crlf, otherwise javascript will fail $jstext =~ s/\015|\012/\\n/gsi ; # convert the cr or the lf, otherwise javascript will fail $jstext =~ s/CODE//gsi ; # remove the CODE tag # let's make this an alert which ensures its always coming up, even inside a hidden iframe $script = scriptalert('$jstext'); /script ; $text = $script . $text ; print Content-type: text/html\n\n ; # Readtemplate is my local routine to read a file and do some custom parsing on it my $form = readtemplate($ENV{SITE_ROOT}/html/$file) ; $form =~ s/ERROR_MSG/$text/ ; # display message to user print pre$form ; ## Now we pick up additional information to mail to ourselves to derive the context my $stack = CGI::Carp::_longmess() ;# Get the full stack of what happened $stack =~ s/eval '.+?PerlRun\.pm line \d+\n//gsi ; # Remove any evals since we are in PerlRun environment $text .= \n\npreCall Stack is:\n\n$stack\n\n if $stack ; # Send/queue an email for this error to the webmaster # Get context of calling routine $msg .= \n\n$stack\n\n if $stack ; if (defined %ENV) { use Data::Dumper ; $msg .= \nEnvironment:\n . Dumper(%ENV) ; } # My own local interface to sendmail, but essentially you mail yourself here email_queue('webmaster','[EMAIL PROTECTED]',$msg,Website Error on $ENV{SITENAME},$msg) ; exit 1 ; } set_message(\handle_errors) ; } - Original Message - From: Martin Moss [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 7:23 PM Subject: Error Handling/Reporting All, I've been hunting the web for mechanisms whereby I can trap errors from my mod perl objects and report them back to a user nicely, log them AND possibly send reports back to me. Before I started hunting I thought it would be a simple process to use the eval mechanism to run my scripts and then report errors back to my browser. (replacing the nasty error500 document) In my travels I found CGI::Carp and Apache::ErrorReport Before I try to pull them both apart and rebuild something which fits my requirements, has anybody else done anything along these lines? Does anybody have any other Recomendations for me to look at? Kind regards Marty
mp2: Session method not seeming to set extra records?
mp1.99.10-dev apache 2.0.46 Session-0.01 (by Olivier Poitrey) I've got a subroutine as follows : sub login { # checks supplied username passwd against users table in db # if ok, creates a session returns session_id username # otherwise, returns 0 my ($supplied_username, $supplied_passwd) = @_; use DBI; use Session; my $user_id = 0; my $dbh = DBI-connect(DBI:mysql:.$db_name.:.$db_server, $db_user, $db_pass, { RaiseError = 1}) or return -1; my $sth = $dbh-prepare(qq{SELECT * FROM passwd WHERE username = ? AND passwd = PASSWORD(?) }); $sth-execute($supplied_username, $supplied_passwd); my @ary = $sth-fetchrow_array; if (defined($ary[0])) { $user_id = $ary[0]; } my $rc = $sth-finish; if ($user_id == 0) {# no match, return 0 return 0; } my %session_config = ( Store = MySQL, Lock= MySQL, Generate= MD5, Serialize = $serialize, DataSource = DBI:mysql:host=$db_server;database=$db_name, UserName= $db_user, Password= $db_pass, LockDataSource = dbi:mysql:.$db_name, LockUserName= $db_user, LockPassword= $db_pass ); my $session = new Session(undef, %session_config); $session-set('user_id' = $user_id); my $session_id = $session-session_id(); my @keys = $session-keys(); $session-release(); logit($log, keys stored : @keys); return $session_id; } It checks login info ok, and all seems mostly well, *except* it never seems to store the 'user_id' value. the logfile that logit() writes to sees this on every invocation : steel1: {14} tail -f log keys stored : user_id keys stored : user_id keys stored : user_id so $session-set() seems to be working at that point, but in the database record I get this : mysql select * from sessions\G *** 1. row *** id: a1c170b34f080053211471b4365006d8 a_session: BQUDAQogYTFjMTcwYjM0ZjA4MDA1MzIxMTQ3MWI0MzY1MDA2ZDgLX3Nlc3Npb25faWQ= (I'm serializing with Base64) the base64 decoding of the a_session data shows : mmencode -u BQUDAQogYTFjMTcwYjM0ZjA4MDA1MzIxMTQ3MWI0MzY1MDA2ZDgLX3Nlc3Npb25faWQ= a1c170b34f080053211471b4365006d8_session_id Which is the session_id, but no sign of the user_id record? My understanding of the way that Apache::Session (and Session) work is that when you add a variable, it stores it in the a_session field, and when you untie (or in this case use $session-release(), which is equivalent?) that the new value should get written to the session record in the database and thus be available for future reference? Later calls from other scripts can't see user_id when I call them as $session-get('user_id'), which is, I think, consistant with them not showing up in the database? Can anyone see what I'm doing wrong? I'm using Session for syntatic sugar reasons moreso than anything functional except the wrapping of ugly exec()'s (ughhh), is the problem I'm seeing my code/understanding or should I file a bug report with Olivier? thanks Carl
Re: how to unsubscribe from this list
Jordan Ward wrote: Can someone please direct me to where I can unsubscribe from this list. it's in the mail headers: list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Mod Image Magick
Augusto Flavio wrote: I have some problems when i try install the mod Image Magick. #perl -MCPAN -e 'install Image::Magick' [...] /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force [...] and now? what i do? don't have idea. I fail to see the relation of this question to mod_perl. Please refrain from asking totally Off-topic questions here. The traffic on the list is quite high nowadays and we want to keep it focused on mod_perl, before people will start unsubscribing. Thank you for understanding that. There are plenty of other perl-related help lists where you can find the help you are looking for. Check: http://perl.apache.org/docs/offsite/other.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: non-LFS Apache 1.3.27 w/ LFS Perl 5.8.0 (using mod_perl)
[EMAIL PROTECTED] wrote: Guys, anyone with experience on the below problem??? why reposting the same question 3 times? Please give people some time to respond to your questions, you can't expect an immediate reply. Please advice, I would really appreciate the help. [...] Sorry if this question goes out to the wrong discussion group, but I've been told if anyone could answer this then it'll be someone on this forum :) Ok, here goes... Sounds like the right place to me. We use Perl 5.6.x and Perl 5.8.0 with LFS. We also use mod_perl 1.27 with LFS and Apache 1.3.27 (with LFS). To make a long story short...we are running into issues with vendors like IBM and Oracle where they don't want to re-compile their code (i.e. mod_ossos) with LFS. So, we need to run a non-LFS build of Apache 1.3.27. The only way (to our knowledge) we can do this is by re-compiling Perl 5.8.0 without LFS, which means that we have to support two versions of Perl / CPAN / etc...not likely in our current situation. Someone just told me that we can use Apache (Non-LFS) with Perl (LFS) using mod_perl (PERL_USELARGEFILES=0, set in Makefile.PL)? This I know Doug MacEachern did not support in earlier versions of mod_perl. BTW. We just-compiled it and it seems to work, HOWEVER I'm concerned about Segmentation Faults (this is common when using LFS modules with a non-LFS Apache build). For some reason we don't get these errors when using mod_perl /LFS with non-LFS Apache. How is this possible? You have to send a complete problem report as explained here, including a core dump's back trace: http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems Here is our mod_perl build script: ... # run the following from the mod_perl source directory $perl_base/bin/perl Makefile.PL \ INSTALLDIRS=perl PREFIX=$prefix \ USE_APXS=1 WITH_APXS=$apache_base/bin/apxs \ EVERYTHING=1 ... __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [port to mp2] Apache::MP3
[CC'ing Clemens Schrimpe] This is great news. Enclosed is my current version, which is slightly different from 3.03. It is also called 3.04, unfortunately. Thanks Lincoln, I'm not sure when I'll be able to merge this, as I'm leaving on vacation shortly. However Clemens Schrimpe has been working on porting it as well, so he might beat me to it. Meanwhile if somebody asks about a 2.0 port, you can point them to this URL: http://stason.org/tmp/Apache-MP3-3.04.tar.gz As Clemens Schrimpe has pointed out in a private email, my port is not complete as I failed to notice that ICY headers should be sent in nph- mode, and xmms seems to work just fine with it. Hopefully Clemens will provide a better port soonish. Lincoln On Monday 02 June 2003 07:37 am, Stas Bekman wrote: I've ported Apache::MP3 to mp2. I'm not submitting it as a patch yet, since I want to try to make the changes co-exist with mp1. This package currently works only with mp2: http://stason.org/tmp/Apache-MP3-3.04.tar.gz This a temporary location and will be gone once I submit the changes to Lincoln and he releases a new version. I've also cleaned up the code to emit no warnings and be a bit less error-prone (as I tested with no so perfect mp3 files). Still there could be problems, but it should be good enough to start with. p.s. Lincoln, do you have any changes since 3.03? If so, can you please send them to me so I work with the latest version. Thanks. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mp2: right place to unescape HTML?
Carl Brewer wrote: I'm using Stas's read_post() call from the test directory in mp1.99-10-dev, and am using it to grab POST data of the form of an email address .. this is giving me this : read_post returned : username=carl%40somewherepassword=foo Escaped the @ ... of course. I'm curios, where's the best place to unescape it? Should I do it in the read_post function, or afterwards? Recommendations? Look at CGI.pm, you could easily prototype your code after it, as it's written in pure perl. Hint: look at the function param(). __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mp2: Re: Can't call method method on an undefined value at Apache-Test/lib/Apache/TestRequest.pm
Carl Brewer wrote: Brent, I think Stas was having a bit of a look at it, I just ignored the error messages and installed it anyway :) That issue wasn't resolved so far. I can't reproduce it on my setup. From Carl's reports it seems that $have_lwp is true for some reason, even though LWP is not available. Patches are *very* welcome. Brent Jensen wrote: Carl, I'm getting the same error on the make test w/ Mod Perl. Did you resolve this issue? I'm using FreeBSD 5.1. Is it really an issue or is it just a testing problem. I get the same error you're getting: Can't call method method on an undefined value at Apache-Test/lib/Apache/TestRequest.pm line 411. Thanks, Brent -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl slower than expected? - Test Code!
On Tuesday 17 June 2003 18:18, Ged Haywood wrote: Do you know for sure that the Per was compiled for i686? Maybe it was compiled for i386, so it would run on just about anything but it can't use a lot of the faster features found in later processors. Whether it's i686 or i386 - both mod_perl and FastCGI are using the same compile of perl - so what difference should there be? Right! I've put together a test case, which has nothing to do with my EDO project. It's just a simple iterative loop, with subroutine calls, updating a hash. I've included the main module Thrash.pm, which does the work, and doubles as the mod_perl Apache module. I've included a FastCGI version, and a plain CGI version (which can also be run from the command line), all using Thrash.pm. I've also attached a .htaccess file setting up thrash.html to be handled by Thrash.pm. On my main dev box, ab gives an average of 8.8secs for the mod_perl run, and 7.2secs for the FastCGI run. The internal timer and printed output reflects these results too. Interestingly, the time to clear the hash after building it is quite large. ^_^ I commented out the hash adding code, to remove the hash processing, and leave it more as a subroutine call test, but mod_perl was still slower, with benchmarks of 3.7secs for mod_perl, and 2.7secs for FastCGI. I've only tested this on one server so far. I'll test it on others now... I'd be interested to hear if others get this discrepancy on their servers... -- . Trevor Phillips - http://jurai.murdoch.edu.au/ . : Web Technical Administrator - [EMAIL PROTECTED] : | IT Services- Murdoch University | | On nights such as this, evil deeds are done. And good deeds, of / | course. But mostly evil, on the whole. / \ -- (Terry Pratchett, Wyrd Sisters) / package Thrash; $Count = 0; %Hash = (); use Apache::Constants qw(:common); use Apache::Request (); eval use Time::HiRes;; if (!$@) { $Thrash::UseTimeHiRes = 1; } sub handler { my $r = shift; # The Raw handler... $r-send_http_header; $r-print(Thrash::DoIt()); return OK; } sub DoIt { my $TIME_start = ($UseTimeHiRes?Time::HiRes::time():time()); my $out = H1Thrash Test/H1\n; $Count = 0; %Hash = (); foreach my $A (qw(0 1 2 3 4 5 6 7 8 9 A B C D E F)) { SubThrash(0,$A); $out.=$A / $CountBR\n; } $out.=sprintf('BRun Time: %.3f/B',($UseTimeHiRes?Time::HiRes::time():time())-$TIME_start); %Hash = (); # Clear Hash now we're done. return $out; } sub SubThrash { my ($depth,$key) = @_; if ($depth==3) { $Count++; # $Hash{$key} = $Count; return; } foreach my $B (qw(a b c d e f g h i j k l m n o p q r s t u v w x y z)) { SubThrash($depth+1,$key.$B); } } 1; thrash.cgi Description: Binary data thrash.fcgi Description: Binary data .htaccess Description: Binary data
Re: mod_perl slower than expected? - Test Code!
On Wednesday 18 June 2003 11:30, Trevor Phillips wrote: On my main dev box, ab gives an average of 8.8secs for the mod_perl run, and 7.2secs for the FastCGI run. The internal timer and printed output reflects these results too. Oops! The internal timer wasn't accurate: Swap lines 35 36 of Thrash.pm, so the timer happens AFTER the hash is reset: %Hash = (); # Clear Hash now we're done. $out.=sprintf('BRun Time: %.3f/B',($UseTimeHiRes?Time::HiRes::time():time())-$TIME_start); -- . Trevor Phillips - http://jurai.murdoch.edu.au/ . : Web Technical Administrator - [EMAIL PROTECTED] : | IT Services- Murdoch University | | On nights such as this, evil deeds are done. And good deeds, of / | course. But mostly evil, on the whole. / \ -- (Terry Pratchett, Wyrd Sisters) /
[SEMI-OT] perl_tie_hash valid reference?
greetings all, i was wondering if anyone could tell me if the function perl_tie_hash in perl_util.c in the mod_perl 1.27 source could be considered usual reference material for binding a table-like object to a hash(ref) in XS? if not, perchance someone could point me at some literature (or source) on the subject? thanks in advance, .dorian
Re: problem building libapreq on Solaris
On Saturday 14 June 2003 20:54, Ged Haywood wrote: On Fri, 13 Jun 2003, Xavier Noria wrote: Hello, I've just compiled Apache 1.3.27 with mod_perl 1.27 from their tarballs on Solaris. perl is 5.8.0 packaged for Solaris. The installation of libapreq with cpan(1) stops here: [snip] t/httpd -f `pwd`/t/httpd.conf /bin/sh: t/httpd: not found [snip] Looks like it's taking t/httpd instead of /usr/local/apache/bin/httpd, Don't know if there's anyone who actually knows what's going on here but I thought you'd just like to hear from somebody. :) [snip] You could try a soft link from there to the real httpd - I have no idea if something else will then fail. Thank you very much, the symlink worked for libapreq-1.1. I first tried to install the just announced 1.2-rc2, but make test failed: PERL_DL_NONLAZY=1 /usr/local/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/*t/*.t does not exist FAILED--1 test script could be run, alas--no output ever seen make: *** [test_dynamic] Error 2 I have a full typescript file and subscribed to the dev mailing list to report this, I'll send it right away when I receive the confirmation of the subscription from the list manager. Thank you all! fxn -- $_=q;Barcelona Perl Mongers;,$/=y,gaudi,,,;map$,+=(split//)*(-1)**$e++, (split)[.11_09,1.714];$.=qq~~!~m~erce~;$=y,catalunya,,,$;=y,rambles,,, $*=$/^$.;$:=$.+length,[EMAIL PROTECTED]/**$*%$:,$%=$/*$-$*;print+chr($_012? 10$_:/^1/?1$_:$_)for($**($**$%-$//$/),$%-$*,$,*$/,$***$***$*,$***$, ,$[EMAIL PROTECTED]/,$**$,,$;,$***$***$*,$***$*,$.,$**$,$***$,,$***$***$**$,= ~~$.,$*$*,$***$/,$***$,,$,-$.,$[EMAIL PROTECTED]/,$;*$/**$*,$,$.,[EMAIL PROTECTED])