ModPerl::Registry and CGI::Carp
Hi, Is anyone having problems with modperl2 and CGI::Carp I get this error message [Wed May 28 18:00:57 2003] [error] 357: ModPerl::Registry: Can't locate object method "send_http_header" via package "Apache::RequestRec" at /usr/local/lib/perl5/5.8.0/CGI/Carp.pm line 478. Anyone got any ideas? Adam --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003
perl.com: Testing mod_perl 2.0
for those who haven't already seen it, perl.com ran the second of my series of articles on mod_perl 2.0 late last week. the title is actually a bit decieving. it's about using the Apache-Test testing framework, but although Apache-Test is shown in a mod_perl 2.0 context, Apache-Test can be used with mod_perl 1.0 as well - many of the illustrations are cross platform. the code from the article can be downloaded from http://www.modperlcookbook.org/~geoff/perl.com/Apache-Clean-2.0.tar.gz or, for the mod_perl 1.0 version, http://www.modperlcookbook.org/~geoff/perl.com/Apache-Clean-1.0.tar.gz if you're interested in trying it out. enjoy --Geoff > In our continuing mod_perl 2.0 series, Geoff Young looks at the new > testing scheme, Apache-Test, and how it fits in with your mod_perl > programs. > > http://www.perl.com/pub/a/2003/05/22/testing.html
Problem with make test and libapreq 1.1
Hi I'm having a problem getting past the maketest stage installing libapreq-1.1 (to get Apache::Request), Apache 1 and Mod_Perl 1 it's fine (I think) up until the last bit (pasted in at the end). I'm guessing that it's the following line that's causing the others to fail. But I'm still learning and am not sure what to do about it. "have_httpd" is not exported by the Apache::test module at t/cookie.t line 2 Any tips appreciated Angie make[1]: Leaving directory `/angie/libapreq-1.1/Cookie' PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0/i386-linux -I/usr/lib/perl5/5.6.0 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/cookie."have_httpd" is not exported by the Apache::test module at t/cookie.t line 2 Can't continue after import errors at t/cookie.t line 2 BEGIN failed--compilation aborted at t/cookie.t line 2. t/cookie.dubious Test returned status 255 (wstat 65280, 0xff00) t/inheritCan't locate HTTP/Request/Common.pm in @INC (@INC contains: blib/arch blib/lib /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at t/inherit.t line 6. t/inheritdubious Test returned status 2 (wstat 512, 0x200) t/requestCan't locate HTTP/Request/Common.pm in @INC (@INC contains: blib/arch blib/lib /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at t/request.t line 6. t/requestdubious Test returned status 2 (wstat 512, 0x200) FAILED--3 test scripts could be run, alas--no output ever seen make: *** [test_dynamic] Error 2
ugh! mod_perl install problem
Hello, I am having a problem installing mod_perl. I have used this same install procedure on other boxes successfully but am having trouble with this one. The error is at the bottom of this message. System specs are as follows. I apologize in advance if this is not the correct forum for this, however, I am rather frustrated with this and appreciate any assistance. Sun Ultra-25 running Solaris 5.8 patch level Generic_108528-17 I am running these installs as root from Bourne shell (I got the same error in C shell and Bash) ## ##Install GCC ## Installed gcc 3.1 from www.sunfreeware.com using 'pkgadd -d' ## ##Install Perl ## # rm -f config.sh Policy.sh # ./Configure -des -Dusethreads -Dcc='gcc -B/usr/ccs/bin/' ## According to the mod_perl doc in /opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/docs/user/install/install.pod ## we need to use "-Dusethreads". According to the perl doc /opt/d00/install.d/perl.d/perl-5.8.0/README.solaris we need to use "-Dcc='gcc -B/usr/ccs/bin/'" ## the "-des" are -d : use defaults for all answers. -e : go on without questioning past the production of config.sh. -s : silent mode, only echoes questions and essential information. # make # make test # make install # ##Build Apache 2.0.45 # configure Apache using ./configure --prefix=/opt/d00/apache/internal --with-mpm=prefork \ --enable-so \ --enable-proxy \ --disable-ipv6 ## removed for clarity # make ## removed for clarity # make install ## removed for clarity ### This installed successfully install mod_perl 1.9_07# # cd mod_perl-1.99_07 # perl Makefile.PL MP_AP_PREFIX=/opt/d00/apache/internal Reading Makefile.PL args from @ARGV MP_AP_PREFIX = /opt/d00/apache/internal Configuring Apache/2.0.45 mod_perl/1.99_07 Perl/v5.8.0 Checking if your kit is complete... Looks good generating script t/TEST Checking if your kit is complete... Looks good Writing Makefile for Apache::Test generating script t/TEST Checking if your kit is complete... Looks good ## removed for clarity Note (probably harmless): No library found for -lapr Note (probably harmless): No library found for -laprutil ## removed for clarity *** mod_perl dso library will be built as mod_perl.so *** mod_perl static library will be built as mod_perl.a *** You'll need to add the following to httpd.conf: *** LoadModule perl_module modules/mod_perl.so # make cd "src/modules/perl" && make -f Makefile.modperl mksh: Warning: newline is not last character in file Makefile.modperl Current working directory /opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c mod_perl.c && mv mod_perl.o mod_perl.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c modperl_interp.c && mv modperl_interp.o modperl_interp.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c modperl_tipool.c && mv modperl_tipool.o modperl_tipool.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c modperl_log.c && mv modperl_log.o modperl_log.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c modperl_config.c && mv modperl_config.o modperl_config.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/src/modules/perl -I/opt/d00/install.d/mod_perl.d/mod_perl-1.99_07/xs -I/opt/d00/apache/internal/include -D_REENTRANT -fno-strict-aliasing -I/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi/CORE -DMOD_PERL -O -fPIC \ -c modperl_cmd.c && mv modperl_cmd.o modperl_cmd.lo gcc -B/usr/ccs/bin/ -I/opt/d00/install.d/mod_perl.d/mod_pe
Re: ModPerl::Registry and CGI::Carp
On Wed, 2003-05-28 at 13:02, Adam Gent wrote: > Is anyone having problems with modperl2 and CGI::Carp CGI::Carp has not been ported to modperl2. You should assume that modules you download have not been ported unless their docs say otherwise. You can use the compatibility layer, or port it yourself, which is probably not hard in this case. See this note: http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_send_http_header_ - Perrin
[mp2] httpd.conf block problems
I've got a working Apache::ASP application that has been used mainly on more-or-less stock Red Hat Linux 7.2 and 7.3 systems (Apache 1.3.2x, mod_perl 1.26, perl 5.6.1). I tried moving it to a Red Hat Linux 9 system (Apache 2.0.40, mod_perl 1.99_07, perl 5.8.0) and it failed. The bugs I'm seeing are tickled by the block I've been using in httpd.conf on the RH7 systems. This block contains an Apache::ASP->Loader() directive, which precompiles all of the scripts before the httpd children are forked off, for efficiency. If I comment this optional block out, httpd starts up fine. The first bug is a known one: apparently, recent mod_perls are sensitive to the syntax of the tag: they require a space in it, like this: I hope this is just a bug that hasn't risen to the top of the priority list yet, and that the mod_perl folk don't intend to keep this sytax. Once that was fixed, I found a new problem. I recieved errors like this: Syntax error on line 1059 of /etc/httpd/conf/httpd.conf: Bareword "Apache::OK" not allowed while "strict subs" in use at /usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm line 47.!BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm line 58.!Compilation failed in require at (eval 57) line 3.! Line 1059 is the line. If I comment out the "use strict" directive at the top of PerlSection.pm, this problem goes away. I'm not sure what the correct fix is, but I hope this is enough information to lead one of the mod_perl developers to a solution. I replaced the mod_perl Red Hat shippped with v1.99_09 while chasing this problem, so that's the version I changed.
Re: ModPerl::Registry and CGI::Carp
Hi Perrin, Thanks for the info. CGI::Carp did have some code in to work with mod_perl2 but not that bit. I have updated my copy and have sent an email to the author. Adam - Original Message - From: "Perrin Harkins" <[EMAIL PROTECTED]> To: "Adam Gent" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, May 28, 2003 6:54 PM Subject: Re: ModPerl::Registry and CGI::Carp > On Wed, 2003-05-28 at 13:02, Adam Gent wrote: > > Is anyone having problems with modperl2 and CGI::Carp > > CGI::Carp has not been ported to modperl2. You should assume that > modules you download have not been ported unless their docs say > otherwise. > > You can use the compatibility layer, or port it yourself, which is > probably not hard in this case. See this note: > http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_send_http_header_ > > - Perrin > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003
Re: [mp2] httpd.conf block problems
The first bug is a known one: apparently, recent mod_perls are sensitive to the syntax of the tag: they require a space in it, like this: I hope this is just a bug that hasn't risen to the top of the priority list yet, and that the mod_perl folk don't intend to keep this sytax. this is due to a limitation of apache 2.0. there _may_ be a way around it, but probably not any time soon. Once that was fixed, I found a new problem. I recieved errors like this: Syntax error on line 1059 of /etc/httpd/conf/httpd.conf: Bareword "Apache::OK" not allowed while "strict subs" in use at /usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm line 47.!BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm line 58.!Compilation failed in require at (eval 57) line 3.! try this patch, which was introduced after 1.99_09 Index: lib/Apache/PerlSection.pm === RCS file: /home/cvspublic/modperl-2.0/lib/Apache/PerlSection.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- lib/Apache/PerlSection.pm 7 Oct 2002 15:45:52 - 1.3 +++ lib/Apache/PerlSection.pm 20 May 2003 01:20:09 - 1.4 @@ -7,6 +7,10 @@ use Apache::CmdParms (); use Apache::Directive (); +use APR::Table (); +use Apache::Server (); +use Apache::ServerUtil (); +use Apache::Const -compile => qw(OK); use constant SPECIAL_NAME => 'PerlConfig'; --Geoff
Apache Error of $r->read failed to read
Hi, We have been having some problems where all of a sudden apache will start logging the error of: [error] mod_perl: $r->read failed to read Multiple times (100s in less then 10th of a sec), often it will get to the point where load on the machine goes through the roof and apache has problems responding and it appears to be the number of requests that are happening as limits that shouldn't be reached like DB connections and apache processes are maxing out during non-peak hours. From what we could see it looked like someone outside was sending all kind of linefeeds and whatnot within the URL which was documented in the Apache 45 release which we did update - now we are down to getting the above mod_perl error and shortly after that starts all hell breaks loose. Nowhere in our code do we directly call the "read" method nor can I find anything relating to the error so I'm a little lost on what I can do. Any ideas? Thanks -Chris RH Linux 8 Apache 2.0.45 mod_perl 1.99.05 -8<-- Start Bug Report 8<--1. Problem Description: See Above 2. Used Components and their Configuration: *** using /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache/BuildConfig.pm*** Makefile.PL options: MP_APXS => /usr/sbin/apxs MP_GENERATE_XS => 1 MP_LIBNAME => mod_perl MP_USE_DSO => 1 MP_USE_STATIC => 1 *** The httpd binary was not found *** /usr/bin/perl -VSummary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' 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='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm' ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', 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='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.2.92' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Sep 1 2002 23:56:49 %ENV: PERL_LWP_USE_HTTP_10="1" @INC: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . 3. This is the core dump trace: (if you get a core dump): [CORE TRACE COMES HERE] This report was generated by -e on Wed May 28 19:16:35 2003 GMT. -8<-- End Bug Report --8<--
[mp1] .htaccess and mod_perl
I am stuck in an Ensim environment (shared web-hosting, Apache 1.3.27 and mod_perl 1.24) and am trying to get around some of the limitations imposed by Ensim. Basically, I have complete .htaccess control but have no way to restart the server or start it with different arguments or modify the central httpd.conf What is possible within an .htaccess file as far as perl configuration for mod_perl 1? I am already using the sections to unshift @INC (because 'PerlSetVar PERL5LIB /my/path' pushes the values) and have tried using PerlRequire startup.pl, however the startup.pl file only executes for one of the httpd children. What happens with PerlModule directives, i.e. does the module get loaded only once, the first time that apache processes the .htaccess, or every time apache hits the directory? Similarly, If I am developing a module in place and PerlModule it within an .htaccess, will it be reloaded whenever apache hits the directory, or only once? If its only once, can I force a reload of the module? Finally, can I use the sections to totally replace a startup.pl, or are there any caveats that I should be aware of? Thanks -Mike
Re: [mp1] .htaccess and mod_perl
Michael L. Artz wrote: I am stuck in an Ensim environment ugh. What is possible within an .htaccess file as far as perl configuration for mod_perl 1? just about anything. I use an Ensim installation, and am constantly frustrated by it. however, there are ways around just about anything. for instance, I couldn't install an ErrorDocument in a .htaccess file for some reason. fine, I just used PerlInitHandler 'sub { shift->custom_response(404, "/notfound.html"); return 0}' and problem solved :) you can use this approach for just about anything - I've also use $r->handler('default-handler') to force .cgi documents to be un-executed and shown as plain text (useful for code examples :). and it doesn't need to be from an anonymous sub either. What happens with PerlModule directives, i.e. does the module get loaded only once, the first time that apache processes the .htaccess, or every time apache hits the directory? it probably won't matter - like use(), perl will only use() the module once. Similarly, If I am developing a module in place and PerlModule it within an .htaccess, will it be reloaded whenever apache hits the directory, or only once? modules are only loaded once - the first time they are use()d per-child (or at server init) If its only once, can I force a reload of the module? use PerlInitHandler Apache::StatINC to reload them during development (I've also used this on ensim :) HTH --Geoff
Re: Problem with make test and libapreq 1.1
Hi there, On Wed, 28 May 2003, Angie Ahl wrote: > I'm having a problem getting past the maketest stage installing libapreq-1.1 (to > get Apache::Request), Apache 1 and Mod_Perl 1 If that's all that's holding up the installation, you'd probably get away with installing manually and not doing the tests (any of them:). I wouldn't normally recommend it - I'd want to fix the tests - but you probably want to get something happening, and fixing things first could be a little frustrating. OTOH this might be a symptom of something more serious... 73, Ged.
Re: [mp2] httpd.conf block problems
Geoffrey Young wrote: sensitive to the syntax of the tag: they require a space in it, this is due to a limitation of apache 2.0. there _may_ be a way around it, but probably not any time soon. I can live with that. It's good enough to know that you (plural) aren't thrilled with it, either, and intend to fix it some day. :) try this patch, which was introduced after 1.99_09 [snip] +use Apache::Const -compile => qw(OK); Without trying it, I'm sure that line will fix the error I'm seeing. I'd try it, but my RH9 box can't be disturbed at the moment. Thanks!
Re: Problem with make test and libapreq 1.1
Angie Ahl wrote: Hi I'm having a problem getting past the maketest stage installing libapreq-1.1 (to get Apache::Request), Apache 1 and Mod_Perl 1 it's fine (I think) up until the last bit (pasted in at the end). I'm guessing that it's the following line that's causing the others to fail. But I'm still learning and am not sure what to do about it. "have_httpd" is not exported by the Apache::test module at t/cookie.t line 2 Any tips appreciated libapreq will soon have a new release using Apache::Test for its testing. Making this problem go away. Also you miss LWP as other errors indicate. As Ged suggested, try to go ahead and install if for now. Even better try the cvs of 1.2-tobe which has several fixes in it. http://httpd.apache.org/apreq/ __ 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: ugh! mod_perl install problem
Reed, Jonathan S. wrote: Hello, I am having a problem installing mod_perl. I have used this same install procedure on other boxes successfully but am having trouble with this one. The error is at the bottom of this message. System specs are as follows. I apologize in advance if this is not the correct forum for this, however, I am rather frustrated with this and appreciate any assistance. Please use the latest release: 1.99_09. http://perl.apache.org/download/index.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: Apache Error of $r->read failed to read
Chris Faust wrote: Hi, We have been having some problems where all of a sudden apache will start logging the error of: [error] mod_perl: $r->read failed to read Multiple times (100s in less then 10th of a sec), often it will get to the point where load on the machine goes through the roof and apache has problems responding and it appears to be the number of requests that are happening as limits that shouldn't be reached like DB connections and apache processes are maxing out during non-peak hours. From what we could see it looked like someone outside was sending all kind of linefeeds and whatnot within the URL which was documented in the Apache 45 release which we did update - now we are down to getting the above mod_perl error and shortly after that starts all hell breaks loose. Nowhere in our code do we directly call the "read" method nor can I find anything relating to the error so I'm a little lost on what I can do. Any ideas? You probably use CGI.pm or something else that calls $r->read(). This happends in xs/Apache/RequestIO/Apache__RequestIO.h (hint grep the mod_perl source code): /* * XXX: as stated in ap_get_client_block, the real * error gets lots, so we only know that there was one */ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "mod_perl: $r->read failed to read"); break; As you can see from the comment due to a bad implementation of ap_get_client_block in Apache, the error is not available. I'm planning to rewrite all these functions to get rid of ap_get_client_block, and work with bucket brigades instead. In any case that won't solve the problem that you are seeing, I'd dig in Apache. e.g. trying to use mod_cgi (which doesn't use ap_get_client_block) to reproduce the problem and ask at the httpd list. __ 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: [mp1] .htaccess and mod_perl
Geoffrey Young wrote: [...] If its only once, can I force a reload of the module? use PerlInitHandler Apache::StatINC to reload them during development (I've also used this on ensim :) Apache::StatINC is R.I.P. Use Apache::Reload instead. __ 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
Large Data Set In Mod_Perl
Hi All, For one of the websites i have developed (/am developing), i have a dataset that i must refer to for some of the dynamic pages. The data is planetary data that is pretty much in spreadsheet format, aka, i have just under 800,000 "rows" of data. I don't do any copmlex searches or functions on the data. I simply need to look at certain columns at certain times. sample data set: planet |date| right_ascension | declination | distance | altitude | azimuth | visibility -++-+-+--+--+--+ jupiter | 1900-01-01 | 15h 57m 7s | -19° 37.2' |6.108 | 10.199 | 39.263 | up mars| 1900-01-01 | 19h 2m 20s | -23° 36.7' |2.401 | 14.764 |-4.65 | up mercury | 1900-01-01 | 17h 15m 16s | -21° 59.7' |1.151 | 14.041 | 20.846 | up moon| 1900-01-01 | 18h 41m 17s | -21° 21.8' | 58.2 | 17.136 |0.343 | transit neptune | 1900-01-01 | 5h 39m 18s | +22° 4.0' | 28.922 | -15.128 | -164.799 | set I need to be able to say: * Lookup the _distance_ for the planet _mercury_ on the date _1900-01-01_ Currently i do this using a postgres database, however, my question is, is there a quicker way to do this in mod_perl - would a DB_File or some other structure be better? I would be interested in knowing if others have dealt with large data sets as above and what solutions they have used. A DB is quick, but is there something one can use in mod_perl that would be quicker? perhaps something such as copying the whole 800,000 rows to memory (as a hash?) on apache startup? simran.
Re: Large Data Set In Mod_Perl
simran wrote: I need to be able to say: * Lookup the _distance_ for the planet _mercury_ on the date _1900-01-01_ On the face of it, a relational database is best for that kind of query. However, if you won't get any fancier than that, you can get by with MLDBM or something similar. Currently i do this using a postgres database, however, my question is, is there a quicker way to do this in mod_perl - would a DB_File or some other structure be better? A DBM file will be faster. What you can do is build a key out of planet + date, so that you grab the right record with a single access. Either use MLDBM for storing hashes inside each record, or just a simple join/split approach. MySQL would probably also be faster than PostgreSQL for this kind of simple read-only querying, but not as fast as a DBM file. SDBM_File is the fastest DBM around, if you can live with the space limitations it has. perhaps something such as copying the whole 800,000 rows to memory (as a hash?) on apache startup? That would be the fastest by far, but it will use a boatload of RAM. It's pretty easy to try, so test it and see if you can spare the RAM it requires. - Perrin
Re: Large Data Set In Mod_Perl
I've dealt with fairly large sets, but not as static as yours. If your only keys for searching are planet and date, then a perl lookup with a hash will be faster overall since a DB lookup involves connecting to the database, doing the standard prepare/execute/fetch which could be as costly (for a single lookup) as the lookup itself. The actual lookup of the record in the database is probably as fast or faster than Perl (especially after the initial lookup that primes the caches) if you have indexed the columns on the table properly. If you are planning to do lots of lookups on this dataset, preloading the dataset in a perl hash would definitely be the better approach. If you are doing only a few lookups over a given period, it may or may not be worth it and taking up lots of memory for no reason and sticking with the db lookup would probably be best. For the perl hash, I would key the hash on the combo of planet and date, something like: my %Planets = ( jupiter=> { "1900-01-01"=> ( "5h 39m 18s", "+22o 4.0'", 28.922, -15,128, -164.799, "set"), "1900-01-02"=> ( "5h 39m 18s", "+22o 4.0'", 28.922, -15,128, -164.799, "set"), }, neptune=> { "1900-01-01"=> ( "5h 39m 18s", "+22o 4.0'", 28.922, -15,128, -164.799, "set"), "1900-01-02"=> ( "5h 39m 18s", "+22o 4.0'", 28.922, -15,128, -164.799, "set"), }, ) ; You could also just combine the planet and date as the string for the hash key like "jupiter1900-01-01" but not real sure if this buys you any performance - it might even be slightly slower since its working on a much larger single hash rather than a two dimensional hash - might be interesting to benchmark it on your size dataset to see what really happens. As to using DB_file, it would probably be somewhere between the Perl hash approach and using the standard SQL database interface. dale - Original Message - From: "simran" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 28, 2003 9:29 PM Subject: Large Data Set In Mod_Perl > Hi All, > > For one of the websites i have developed (/am developing), i have a > dataset that i must refer to for some of the dynamic pages. > > The data is planetary data that is pretty much in spreadsheet format, > aka, i have just under 800,000 "rows" of data. I don't do any copmlex > searches or functions on the data. I simply need to look at certain > columns at certain times. > > sample data set: > > planet |date| right_ascension | declination | distance | altitude | azimuth | visibility > -++-+-+--+ --+--+ > jupiter | 1900-01-01 | 15h 57m 7s | -19° 37.2' |6.108 | 10.199 | 39.263 | up > mars| 1900-01-01 | 19h 2m 20s | -23° 36.7' |2.401 | 14.764 |-4.65 | up > mercury | 1900-01-01 | 17h 15m 16s | -21° 59.7' |1.151 | 14.041 | 20.846 | up > moon| 1900-01-01 | 18h 41m 17s | -21° 21.8' | 58.2 | 17.136 |0.343 | transit > neptune | 1900-01-01 | 5h 39m 18s | +22° 4.0' | 28.922 -15.128 | -164.799 | set > > > I need to be able to say: > > * Lookup the _distance_ for the planet _mercury_ on the date _1900-01-01_ > > Currently i do this using a postgres database, however, my question is, > is there a quicker way to do this in mod_perl - would a DB_File or some > other structure be better? > > I would be interested in knowing if others have dealt with large data > sets as above and what solutions they have used. > > A DB is quick, but is there something one can use in mod_perl that would > be quicker? perhaps something such as copying the whole 800,000 rows to > memory (as a hash?) on apache startup? > > simran. > >
Re: [mp1] .htaccess and mod_perl
Apache::StatINC is R.I.P. Use Apache::Reload instead. but Apache::StatINC comes with mp1 and Apache::Reload doesn't - it's difficult to install modules on these ensim boxes since you don't have root (and yes, there are other ways around it of course :) --Geoff
Re: [mp2] httpd.conf block problems
+use Apache::Const -compile => qw(OK); Without trying it, I'm sure that line will fix the error I'm seeing. I'd try it, but my RH9 box can't be disturbed at the moment. you will find that you need all the lines in that patch to get it to work - the error you are seeing is just masking others that will occur at runtime :) --Geoff
[error] Can't locate CGI.pm in @INC
I have installed OpenBSD 3.2, with Apache 1.3.26, and mod_perl 1.26 which was installed as a package. I have rebooted, stopped and started apache. I have permissions of 755 on my perl scripts and here is my error log: [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC contains: /usr/local/lib/site_perl/5.6.1/i386-openbsd /usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl . /var/www/ /var/www/lib/perl) at /htdocs/perl/hellothere.pl line 3 during global destruction. BEGIN failed--compilation aborted at /htdocs/perl/hellothere.pl line 3 during global destruction. When I do a find for CGI.pm here are the results: as07# find / -name CGI.pm /usr/libdata/perl5/CGI.pm I have looked through the online mod_perl docs to no avail. Any help would be greatly appreciated! Jeff Brown
Can't use sendmail more than once
I have migrated my site from IIS and Active State to Apache 1.3 and mod_perl on a Windows machine. I use the site to send emails to registered users using Mail::sendmail through our SMTP server (another machine). With Apache I can only send emails once after I start the Apache server, thereafter it tells me it can't connect to the SMTP server. Restarting the Apache server leads to again being able to only send emails once. Any ideas?
Re: [mp1] .htaccess and mod_perl
Geoffrey Young wrote: Apache::StatINC is R.I.P. Use Apache::Reload instead. but Apache::StatINC comes with mp1 and Apache::Reload doesn't - it's difficult to install modules on these ensim boxes since you don't have root (and yes, there are other ways around it of course :) We could bundle Apache::Reload with 1.28 I suppose. __ 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: [error] Can't locate CGI.pm in @INC
On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote: > [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC > contains: [...] > /usr/libdata/perl5/CGI.pm This sort of thing is usually a permissions problem. Try opening that file (full path to CGI.pm) from your CGI and see if it lets you. - Perrin
Re: [error] Can't locate CGI.pm in @INC
Brown, Jeffrey wrote: I have installed OpenBSD 3.2, with Apache 1.3.26, and mod_perl 1.26 which was installed as a package. I have rebooted, stopped and started apache. I have permissions of 755 on my perl scripts and here is my error log: [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC contains: /usr/local/lib/site_perl/5.6.1/i386-openbsd /usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl . /var/www/ /var/www/lib/perl) at /htdocs/perl/hellothere.pl line 3 during global destruction. BEGIN failed--compilation aborted at /htdocs/perl/hellothere.pl line 3 during global destruction. global destruction? When I do a find for CGI.pm here are the results: as07# find / -name CGI.pm /usr/libdata/perl5/CGI.pm /usr/libdata/perl5/ is in @INC. Check CGI.pm perms. See that it is readable by the user that is running the server. __ 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: Can't use sendmail more than once
On Thu, 29 May 2003, Greg Dutkowski wrote: > I have migrated my site from IIS and Active State to Apache 1.3 > and mod_perl on a Windows machine. I use the site to send > emails to registered users using Mail::sendmail through our > SMTP server (another machine). > > With Apache I can only send emails once after I start the > Apache server, thereafter it tells me it can't connect to the > SMTP server. Restarting the Apache server leads to again being > able to only send emails once. > > Any ideas? After it sends the mail, can you tell if the connection to the smtp server is still open? If so, can you explicitly disconnect from your script? Also, is this a script (or handler) run under mod_perl? If so, does this occur only under mod_perl, or does the same thing occur when mod_perl is disabled and an ordinary cgi script is used? If it is run under mod_perl, are all further server connections blocked after the first mail is sent, or is it just the smtp connection that's blocked? -- best regards, randy kobes
Re: Can't use sendmail more than once
On Wed, 2003-05-28 at 22:45, Greg Dutkowski wrote: > I have migrated my site from IIS and Active State to Apache 1.3 and mod_perl > on a Windows machine. I use the site to send emails to registered users > using Mail::sendmail through our SMTP server (another machine). > > With Apache I can only send emails once after I start the Apache server, > thereafter it tells me it can't connect to the SMTP server. Restarting the > Apache server leads to again being able to only send emails once. > > Any ideas? This is a known problem with mod_perl 1.x on Win32. Sockets only work when you make it single-threaded (ThreadsPerChild 1). Doing that doesn't make a difference in terms of your actual script performance, since mod_perl is already single-threaded on Win32, but it will make images slow. One solution is to serve the images from a separate web server. - Perrin
RE: [error] Can't locate CGI.pm in @INC
Here are the permissions on the file: -r--r--r-- 1 root wheel 224666 Apr 28 06:35 CGI.pm The BSD OS is new to me, I am more familure with redhat...but there are some definite perks to OpenBSD and that is why I run it. Anyway wheel is the group, and Apache uses the user and group www to run the server. Any more help? Jeff -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 7:50 PM To: Brown, Jeffrey Cc: [EMAIL PROTECTED] On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote: > [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC > contains: [...] > /usr/libdata/perl5/CGI.pm This sort of thing is usually a permissions problem. Try opening that file (full path to CGI.pm) from your CGI and see if it lets you. - Perrin
Re: Can't use sendmail more than once
Perrin Harkins wrote: On Wed, 2003-05-28 at 22:45, Greg Dutkowski wrote: I have migrated my site from IIS and Active State to Apache 1.3 and mod_perl on a Windows machine. I use the site to send emails to registered users using Mail::sendmail through our SMTP server (another machine). With Apache I can only send emails once after I start the Apache server, thereafter it tells me it can't connect to the SMTP server. Restarting the Apache server leads to again being able to only send emails once. Any ideas? This is a known problem with mod_perl 1.x on Win32. Sockets only work when you make it single-threaded (ThreadsPerChild 1). Doing that doesn't make a difference in terms of your actual script performance, since mod_perl is already single-threaded on Win32, but it will make images slow. One solution is to serve the images from a separate web server. Can we add this factoid to http://perl.apache.org/docs/1.0/guide/troubleshooting.html#Windows_OS_specific_notes ? __ 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: [error] Can't locate CGI.pm in @INC
On Wed, 2003-05-28 at 23:15, Brown, Jeffrey wrote: > Here are the permissions on the file: > > -r--r--r-- 1 root wheel 224666 Apr 28 06:35 CGI.pm > > The BSD OS is new to me, I am more familure with redhat...but there are > some definite perks to OpenBSD and that is why I run it. Anyway wheel is > the group, and Apache uses the user and group www to run the server. Any > more help? It could be a directory above that is the problem. Try the test I suggested and you will know for sure. - Perrin
RE: [error] Can't locate CGI.pm in @INC
Do you mean give the path in my perl script? So the line in my code: use CGI qw(:standard); would be: use /usr/libdata/perl5/CGI qw(:standard); jeff -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 7:50 PM To: Brown, Jeffrey Cc: [EMAIL PROTECTED] On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote: > [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC > contains: [...] > /usr/libdata/perl5/CGI.pm This sort of thing is usually a permissions problem. Try opening that file (full path to CGI.pm) from your CGI and see if it lets you. - Perrin
Re: Can't use sendmail more than once
On Wed, 2003-05-28 at 23:17, Stas Bekman wrote: > Can we add this factoid to > http://perl.apache.org/docs/1.0/guide/troubleshooting.html#Windows_OS_specific_notes > ? Yes. I think Joshua Chamas has a summary of it somewhere, but I can't seem to reach his site or the mod_perl site at the moment for some reason. - Perrin
RE: [error] Can't locate CGI.pm in @INC
On Wed, 28 May 2003, Brown, Jeffrey wrote: > Do you mean give the path in my perl script? > So the line in my code: > use CGI qw(:standard); > would be: > use /usr/libdata/perl5/CGI qw(:standard); I think what Perrin had in mind was to try, in your CGI script, something like open(FILE, '
Re: [mp1] .htaccess and mod_perl
Apache::StatINC is R.I.P. Use Apache::Reload instead. but Apache::StatINC comes with mp1 and Apache::Reload doesn't - it's difficult to install modules on these ensim boxes since you don't have root (and yes, there are other ways around it of course :) Well, Apache::StatINC wasn't distributed with the install of mod_perl that I was using (1.24) or else it wasn't in the global @INC, so I just snapped up the source from cpan and put it (with an addition to @INC) locally in my ensim tree. I will try and get Apache::Reload working, since Stas says so :) I think that I can install any module that doesn't need a compiler, although the whole 'make test' thing might get me since I don't have access to the httpd binary. Who needs testing anyway? Thanks -Mike
RE: [error] Can't locate CGI.pm in @INC
On Wed, 2003-05-28 at 23:25, Brown, Jeffrey wrote: > Do you mean give the path in my perl script? > > So the line in my code: > > use CGI qw(:standard); > > would be: > > use /usr/libdata/perl5/CGI qw(:standard); Actually, what I had in mind was just this: open(CGI, '/usr/libdata/perl5/CGI.pm') or die $!; If you can't read the file, that line will die. - Perrin
RE: [error] Can't locate CGI.pm in @INC
Here are the results from the log file: [Wed May 28 20:50:21 2003] [error] No such file or directory at /htdocs/perl/first.pl line 6 during global destruction. Jeff -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:36 PM To: Brown, Jeffrey Cc: [EMAIL PROTECTED] On Wed, 2003-05-28 at 23:25, Brown, Jeffrey wrote: > Do you mean give the path in my perl script? > > So the line in my code: > > use CGI qw(:standard); > > would be: > > use /usr/libdata/perl5/CGI qw(:standard); Actually, what I had in mind was just this: open(CGI, '/usr/libdata/perl5/CGI.pm') or die $!; If you can't read the file, that line will die. - Perrin
Re: [mp1] .htaccess and mod_perl
Michael L. Artz wrote: Apache::StatINC is R.I.P. Use Apache::Reload instead. but Apache::StatINC comes with mp1 and Apache::Reload doesn't - it's difficult to install modules on these ensim boxes since you don't have root (and yes, there are other ways around it of course :) Well, Apache::StatINC wasn't distributed with the install of mod_perl that I was using (1.24) or else it wasn't in the global @INC, so I just snapped up the source from cpan and put it (with an addition to @INC) locally in my ensim tree. eh? It's been in the distro for the last 6 years or so. But Apache::Reload is a way to go. mp2 has only it. So it's better to get used to it. I will try and get Apache::Reload working, since Stas says so :) I think that I can install any module that doesn't need a compiler, although the whole 'make test' thing might get me since I don't have access to the httpd binary. Who needs testing anyway? I don't think it has a test suite anyways. __ 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: [error] Can't locate CGI.pm in @INC
On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote: > Here are the results from the log file: > > [Wed May 28 20:50:21 2003] [error] No such file or directory at > /htdocs/perl/first.pl line 6 during global destruction. openbsd's httpd is chrooted. Ed.
mp2: apache 2.0.46 works
I've just spun up apache 2.0.46 on Solaris 8, and the install of mod_perl 1.99_09 seems fine so far. Carl
[mp2] new utils mp2bug and mp2doc and more ModPerl::MethodLookupmethods
I forgot to mention that 1.99_09 installs two new utils: - mp2bug: used for success/failure reports after mod_perl was installed and the source is no longer available (e.g. binary distros). - mp2doc: replaces perldoc to cope with the Apache2/ subdir (perldoc won't know to search under Apache2)/. So now you can do things like: % mp2doc Apache::Filter Also ModPerl::MethodLookup has new useful features: print_object() and print_module() (there is also non-print API): % perl -MApache2 -MModPerl::MethodLookup -e print_object Apache::RequestRec Objects of type 'Apache::RequestRec' can invoke the following XS methods: MethodModule - BINMODE Apache::RequestIO CLOSE Apache::RequestIO [many more snipped] % perl -MApache2 -MModPerl::MethodLookup -e print_module Apache::RequestRec Module 'Apache::RequestRec' contains the following XS methods: Method Invoked on object type allowed Apache::RequestRec allowed_methods Apache::RequestRec [many more snipped] For more info see: http://perl.apache.org/docs/2.0/api/ModPerl/MethodLookup.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: mp2: apache 2.0.46 works
Carl Brewer wrote: I've just spun up apache 2.0.46 on Solaris 8, and the install of mod_perl 1.99_09 seems fine so far. Great. Thanks Carl! For those who post success reports (which are as important as failure notes), please either include the output of mp2bug (added in 1.99_09 to replace t/REPORT which won't be available after 'make install') or at least mention perl version and apache mpm used. __ 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: [error] Can't locate CGI.pm in @INC
Problem solved! You all are a fantastic resource to newbies! Jeff -Original Message- From: Ed [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 9:28 PM To: Brown, Jeffrey; [EMAIL PROTECTED] On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote: > Here are the results from the log file: > > [Wed May 28 20:50:21 2003] [error] No such file or directory at > /htdocs/perl/first.pl line 6 during global destruction. openbsd's httpd is chrooted. Ed.
Re: [error] Can't locate CGI.pm in @INC
Brown, Jeffrey wrote: Problem solved! You all are a fantastic resource to newbies! Jeff -Original Message- From: Ed [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 9:28 PM To: Brown, Jeffrey; [EMAIL PROTECTED] On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote: Here are the results from the log file: [Wed May 28 20:50:21 2003] [error] No such file or directory at /htdocs/perl/first.pl line 6 during global destruction. openbsd's httpd is chrooted. Again, can someone please post a patch/addition for the troubleshooting.pod doc explaining the problem and the solution in details. I've seen this kind of questions more than once here. Should go into OpenBSD cat at: http://perl.apache.org/docs/1.0/guide/troubleshooting.html#OS_Specific_Notes Get the pod by clicking on the [src] button. __ 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
[mp2] a better way to block/throttle clients
mod_perl 1.0 has several tools for throttling/block clients, but they all do their work in pretty late stage, wasting quite a few resources. With mp2 you can now throttle/block clients before any data was sent and before Apache has done anything at all. This example module takes advantage of running during the pre_connection phase. I believe this is "almost" as efficient as firewall blocking (the "only" overhead is select() and several calls in perl). the cool thing is that Apache simply drops the connection without sending anything back to the client ;) Of course you want to adopt it to use a real database and some well defined blocking policies. May be Randal will revise his webtechnique column to use this better phase (CC'ing him). #file:MyApache/BlockIP2.pm #-- package MyApache::BlockIP2; use Apache::Connection (); use Apache::Const -compile => qw(FORBIDDEN OK); my %bad_ips = map {$_ => 1} qw(127.0.0.1 10.0.0.4); sub handler { my Apache::Connection $c = shift; my $ip = $c->remote_ip; if (exists $bad_ips{$ip}) { warn "IP $ip is blocked\n"; return Apache::FORBIDDEN; } return Apache::OK; } 1; Configuration: PerlPreConnectionHandler MyApache::BlockIP2 You will need mp 1.99_08 or higher for this to work. __ 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] httpd.conf block problems
On Thu, 2003-05-29 at 05:24, Warren Young wrote: > Geoffrey Young wrote: > > > >> sensitive to the syntax of the tag: they require a space in it, > > > > this is due to a limitation of apache 2.0. there _may_ be a way around > > it, but probably not any time soon. > > I can live with that. It's good enough to know that you (plural) aren't > thrilled with it, either, and intend to fix it some day. :) Oy! Indeed. I am the guilty person to blame for not having fixed it quite yet. And yes, we are all very much aware of it ;-( But I am happy to say : "It's httpd's fault!". > > try this patch, which was introduced after 1.99_09 > [snip] > > +use Apache::Const -compile => qw(OK); > > Without trying it, I'm sure that line will fix the error I'm seeing. > I'd try it, but my RH9 box can't be disturbed at the moment. > > Thanks! -- -- - Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B) http://gozer.ectoplasm.org/F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5 Q: It is impossible to make anything foolproof because fools are so ingenious. perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}' signature.asc Description: This is a digitally signed message part
Re: Large Data Set In Mod_Perl
Hi there, On Wed, 28 May 2003, Perrin Harkins wrote: > simran wrote: [snip] > > * Lookup the _distance_ for the planet _mercury_ on the date _1900-01-01_ [snip] > you can get by with MLDBM or something similar. You might also want to investigate using a compiled C Btree library which could be tuned specifically to your dataset. Hard work. [snip] > > perhaps something such as copying the whole 800,000 rows to memory [snip] > That would be the fastest by far, but it will use a boatload of RAM. To economise on memory you could compress the data (or part of it) before storage/lookup using a fast compress/decompress algorithm. There would be a tradeoff between memory consumption and processor cycles of course. That kind of thing can get a bit complicated... :) 73, Ged.
Handler called second time acts up.
Hi all, I have the following problem. I designed a mod_perl handler module that parses a certain XML-like language into Virtual Reality Modeling Language (VRML) and sends it to the browser. It works fine first time, but when I refresh it, it works differently. It feels like the module does not create a new VRML on refresh but adds a new one to the previous, the result being crooked and twisted. Similar thing happens when I activate url in VRML file, calling handler again from inside the roduced VRML. Hope you understand what I mean. My theory is that something is wrong with local/global variables in the module. Any hints? Dr. Igor Rojdestvenski,Dept. Plant Physiology, Umea university, Umea 90187, Swedene-mail: [EMAIL PROTECTED]phone: +46-73-6205020fax: +46-90-7866676homepage: www.patronov.net
RE: ugh! mod_perl install problem
That did it. Thank you very much. Jon Reed -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:08 PM To: Reed, Jonathan S. Cc: [EMAIL PROTECTED] Subject: Re: ugh! mod_perl install problem Reed, Jonathan S. wrote: > Hello, > I am having a problem installing mod_perl. I have used this same install procedure > on other boxes successfully but am having trouble with this one. The error is at > the bottom of this message. System specs are as follows. I apologize in advance if > this is not the correct forum for this, however, I am rather frustrated with this > and appreciate any assistance. Please use the latest release: 1.99_09. http://perl.apache.org/download/index.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: Handler called second time acts up.
Hi there, On Thu, 29 May 2003, Igor Rojdestvenski wrote: > designed a mod_perl handler moduel [snip] > works fine first time, but when I refresh it, it works differently. [snip] > My theory is that something is wrong with local/global variables [snip] Check out the mod_perl Guide - you can find it on the mod_perl website, http://perl.apache.org The guide contains a wealth of information about this kind of thing. See in particular the sections about mod_perl traps, debugging, and "Sometimes it works, sometimes it doesn't..." 73, Ged.
RE: Can't use sendmail more than once
That's fixed it - I don't server many images - thanks very much! -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Thursday, 29 May 2003 1:07 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Can't use sendmail more than once On Wed, 2003-05-28 at 22:45, Greg Dutkowski wrote: > I have migrated my site from IIS and Active State to Apache 1.3 and mod_perl > on a Windows machine. I use the site to send emails to registered users > using Mail::sendmail through our SMTP server (another machine). > > With Apache I can only send emails once after I start the Apache server, > thereafter it tells me it can't connect to the SMTP server. Restarting the > Apache server leads to again being able to only send emails once. > > Any ideas? This is a known problem with mod_perl 1.x on Win32. Sockets only work when you make it single-threaded (ThreadsPerChild 1). Doing that doesn't make a difference in terms of your actual script performance, since mod_perl is already single-threaded on Win32, but it will make images slow. One solution is to serve the images from a separate web server. - Perrin