apache + mod_perl + mod_php fails
Hello, I have problems compiling apache under mac os x. I had no problems without php but with php it doesn't work. Furthermore i need mod_rewrite. I consulted docs at perl.apache.org and the install-guide in practical mod_perl. What i did starting in /usr/local/src: This is a simple installation scenario of the mod_perl and mod_php in Apache server: 1. Configure Apache. cd apache_1.3.29 sudo ./configure --prefix=/usr/local/apache --with-layout=Apache 2. Build mod_perl. cd ../mod_perl-1.29 sudo perl makefile.PL \ APACHE_SRC=../apache_1.3.29/src \ NO_HTTPD=1 \ USE_APACI=1 \ PREP_HTTPD=1 \ EVERYTHING=1 sudo make 3. Build mod_php. cd ../php-4.3.4 sudo ./configure --with-apache=../apache_1.3.29 \ --with-mysql --enable-track-vars sudo make sudo make install 4. Build Apache: cd ../apache_1.3.29 sudo ./configure \ --prefix=/usr/local/apache \ --with-layout=Apache \ --activate-module=src/modules/perl/libperl.a \ --activate-module=src/modules/php4/libphp4.a \ --enable-module=rewrite \ --enable-shared=rewrite sudo make after this make i get: ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist ld: Undefined symbols: _actions_module _include_module _log_config_module make[2]: *** [target_static] Error 1 make[1]: *** [build-std] Error 2 make: *** [build] Error 2 but this php4-dir is there! So what do i do wrong? Everything else yields no errors and as said before works fine without php. I can only find docs concerning either php or mod_perl. The practical mod_perl book an the mod_perl website are the only sources i found that mention this kind of installation. Please help me getting this thing up and running! -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: apache + mod_perl + mod_php fails
Hello Ged, I copied all files to my ~ and repeated all setps. After make in point 4 i now get: ** A test compilation with your Makefile configuration ** failed. The below error output from the compilation ** test will give you an idea what is failing. Note that ** Apache requires an ANSI C Compiler, such as gcc. Error Output for sanity check cd ..; gcc -DDARWIN -DMOD_PERL -DUSE_PERL_SSI -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -DUSE_EXPAT -I./lib/expat-lite `./apaci` -I. -I/usr/local/lib/perl5/5.8.3/darwin-2level/CORE-o helpers/dummy helpers/dummy.c -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -lm -L/usr/local/lib /usr/local/lib/perl5/5.8.3/darwin-2level/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.3/darwin-2level/CORE -lperl -ldl -lm -lc ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist ld: table of contents for archive: modules/php4/libmodphp4.a is out of date; rerun ranlib(1) (can't load from it) ld: warning prebinding disabled because dependent library: /usr/lib/libdl.0.dylib is not prebound make: *** [dummy] Error 1 = End of Error Report = Aborting! As advised i only did make install with sudo. Am 18. Mär 2004 um 18:10 schrieb Ged Haywood: Hi there, On Thu, 18 Mar 2004, Michael wrote: I have problems compiling apache under mac os x. I had no problems without php but with php it doesn't work. Furthermore i need mod_rewrite. I consulted docs at perl.apache.org and the install-guide in practical mod_perl. What i did starting in /usr/local/src: Don't build things in /usr/local/src. Build in your home directory, as an unprivileged user, only do 'make install' as root. Otherwise you will probably run into a few permissions problems. That might be the cause of your problem here but I'd like to hear what happens when you build in your home directory before claiming victory on this one. Stas, I notice that in http://perl.apache.org/docs/1.0/guide/ install.html#A_Summary_of_a_Basic_mod_perl_Installation we start with % cd /usr/src % lwp-download ... which clearly won't work in the vast majority of installations because a non-root user won't have write permission there. I can't believe we haven't noticed that before, it should be changed. Shall I do it? 73, Ged. what does 73 stand for? -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: apache + mod_perl + mod_php fails
OK, just saw myself that i should have run ranlib. after that and another configure and make i get: ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist ld: warning prebinding disabled because dependent library: /usr/lib/libdl.0.dylib is not prebound ld: Undefined symbols: _actions_module _include_module _log_config_module make[2]: *** [target_static] Error 1 make[1]: *** [build-std] Error 2 make: *** [build] Error 2 Am 18. Mär 2004 um 19:18 schrieb Michael: Hello Ged, I copied all files to my ~ and repeated all setps. After make in point 4 i now get: ** A test compilation with your Makefile configuration ** failed. The below error output from the compilation ** test will give you an idea what is failing. Note that ** Apache requires an ANSI C Compiler, such as gcc. Error Output for sanity check cd ..; gcc -DDARWIN -DMOD_PERL -DUSE_PERL_SSI -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -DUSE_EXPAT -I./lib/expat-lite `./apaci` -I. -I/usr/local/lib/perl5/5.8.3/darwin-2level/CORE-o helpers/dummy helpers/dummy.c -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -lm -L/usr/local/lib /usr/local/lib/perl5/5.8.3/darwin-2level/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.3/darwin-2level/CORE -lperl -ldl -lm -lc ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist ld: table of contents for archive: modules/php4/libmodphp4.a is out of date; rerun ranlib(1) (can't load from it) ld: warning prebinding disabled because dependent library: /usr/lib/libdl.0.dylib is not prebound make: *** [dummy] Error 1 = End of Error Report = Aborting! As advised i only did make install with sudo. Am 18. Mär 2004 um 18:10 schrieb Ged Haywood: Hi there, On Thu, 18 Mar 2004, Michael wrote: I have problems compiling apache under mac os x. I had no problems without php but with php it doesn't work. Furthermore i need mod_rewrite. I consulted docs at perl.apache.org and the install-guide in practical mod_perl. What i did starting in /usr/local/src: Don't build things in /usr/local/src. Build in your home directory, as an unprivileged user, only do 'make install' as root. Otherwise you will probably run into a few permissions problems. That might be the cause of your problem here but I'd like to hear what happens when you build in your home directory before claiming victory on this one. Stas, I notice that in http://perl.apache.org/docs/1.0/guide/ install.html#A_Summary_of_a_Basic_mod_perl_Installation we start with % cd /usr/src % lwp-download ... which clearly won't work in the vast majority of installations because a non-root user won't have write permission there. I can't believe we haven't noticed that before, it should be changed. Shall I do it? 73, Ged. what does 73 stand for? -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: apache + mod_perl + mod_php fails
So i reran ranlib and configure and make as told in the instructions on mod_perl website. I continue to get: ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist ld: warning prebinding disabled because dependent library: /usr/lib/libdl.0.dylib is not prebound ld: Undefined symbols: _actions_module _include_module _log_config_module make[2]: *** [target_static] Error 1 make[1]: *** [build-std] Error 2 make: *** [build] Error 2 Shall i post the complete output of make? Where do i get help on this issue? Building apache with modperl and modphp and modwrite is possible? Thanks for Your help Michael Am 18. Mär 2004 um 20:55 schrieb Stas Bekman: Michael wrote: Hello Ged, I copied all files to my ~ and repeated all setps. After make in point 4 i now get: ** A test compilation with your Makefile configuration ** failed. The below error output from the compilation ** test will give you an idea what is failing. Note that ** Apache requires an ANSI C Compiler, such as gcc. So much better when you show the real build output ;) Error Output for sanity check cd ..; gcc -DDARWIN -DMOD_PERL -DUSE_PERL_SSI -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -DUSE_EXPAT -I./lib/expat-lite `./apaci` -I. -I/usr/local/lib/perl5/5.8.3/darwin-2level/CORE-o helpers/dummy helpers/dummy.c -Lmodules/php4 -L../modules/php4 -L../../modules/php4 as you can see mod_php's configure has pushed: -Lmodules/php4 -L../modules/php4 -L../../modules/php4 don't ask us why, ask the php guys. ;) -lmodphp4 -lm -L/usr/local/lib /usr/local/lib/perl5/5.8.3/darwin-2level/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.3/darwin-2level/CORE -lperl -ldl -lm -lc ld: warning -L: directory name (../modules/php4) does not exist ld: warning -L: directory name (../../modules/php4) does not exist so these are just warnings, ignore them. ld: table of contents for archive: modules/php4/libmodphp4.a is out of date; rerun ranlib(1) (can't load from it) do you think that's the cause of the error? can you build mod_php4 on its own? I'd try to do that first, as the cause of the problem could be in the mod_php land. ld: warning prebinding disabled because dependent library: /usr/lib/libdl.0.dylib is not prebound i'm not a darwin user, so i'm not sure whether this is important, but as it says it's a warning, let's hope that it's harmless. make: *** [dummy] Error 1 73, Ged. what does 73 stand for? good bye in morse: http://www.envf.port.ac.uk/illustration/z/hig/71to80/73/jb/73.htm __ 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 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Rocks.pm
David Arnold wrote: > Stas, > > See my comment below, following yours. > [snip] > >> It seems like I am following all of the directions. Any suggestions? > > > >Is the path /home/darnold/httpd/httpd-2.0/perl readable by the user/group > you > >run the Apache under? (hint: grep httpd.conf for User and Group). e.g. move > >that file into /tmp and everything should work just fine. > > My settings in httpd.conf are: > > User apache > Group apache > > And I have set up a user named apache with group apache. What would I do to > make the path /home/darnold/httpd/httpd-2.0/perl readable by my apache > user? > It means that the user 'apache' has execute permissions on every directory in that path. Michael Peters -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Trouble getting mp2 to handle only cgi-bin/*.pl files
Saju Pillai <[EMAIL PROTECTED]> > I am having some trouble trying to get mod_perl > handle only .pl files from cgi-bin. mp2 wants to > handle all the files in cgi-bin > > My relevant config is ... > > > >Alias /perl/ "/home/srp/ap2/cgi-bin/" >PerlOptions -SetupEnv >PerlModule ModPerl::Registry > > PerlSetEnv PERL5LIB > "/home/srp/perl/lib/5.8.3" > SetHandler perl-script I think this line is the culprit. It tells apache that everything there should be handled as a perl-script > AddHandler perl-script .pl This one tells it to just handle the .pl's > PerlResponseHandler ModPerl::Registry > Options +ExecCGI > > > Michael Peters PlusThree -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Method Handler not working
Perrin Harkins wrote: On Thu, 2004-07-22 at 11:26, MARTIN MOSS wrote: This error doesn't occur on machines running the same code (mirrored in the same way as the redhat box), it works perfectly fine. Has anybody seen this type of error before, is it the symptom of some other issue that I've missed somehow? Did you compile with support for method handlers? That has to be enabled. Also, are there any httpd.conf differences? right. Does your httpd.conf say SetHandler MyPackage::handler or SetHandler MyPackage Michael Peters Developer PlusThree -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Method Handler not working
MARTIN MOSS wrote: Michael <[EMAIL PROTECTED]> wrote:Perrin Harkins wrote: On Thu, 2004-07-22 at 11:26, MARTIN MOSS wrote: This error doesn't occur on machines running the same code (mirrored in the same way as the redhat box), it works perfectly fine. Has anybody seen this type of error before, is it the symptom of some other issue that I've missed somehow? Did you compile with support for method handlers? That has to be enabled. Also, are there any httpd.conf differences? right. Does your httpd.conf say SetHandler MyPackage::handler or SetHandler MyPackage It is setup like this:- SetHandler perl-script PerlHandler My::Package Shouldn't that be PerlHandler My::Package->handler if you are doing method handlers. Is the config the same on the other boxes where it is working? Michael Peters Developer PlusThree -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Accessing form mutiples
Dermot Paikkos wrote: Hi modperls, Apache/1.3.26 (Unix) mod_perl/1.27 I have started getting odd results from requests that come from forms with multiple options. If I pass the following uri all is well: http://server.com/junk?one=1&two=2&three=3 But this doesn't http://server.com/junk?no=1&no=2&no=3 Well to be fair it does work if I put the list into an array but if I use a hash reference it doesn't and I can only access the first item. Apache::Request::param will only return a list if it is called in list context. This means you may have to force it to return a list using () like this ($r->param('my_param')). But it looks like you are trying to put the values of your params as keys to a hash. You can't have a list be a key to a hash. HTH Michael Peters Developer Plus Three What am I doing wrong?? Sorry if this is a bit OT but I am not sure if this is a modperl issue or a perl reference knowledge void. Thanx. Dp. == JUNK.PM === package SPL::junk; use Apache::Constants qw(:common REDIRECT); use Apache::Request; use Apache::File; use strict; use warnings; use diagnostics; use Carp; $| =1; sub handler{ my $r = Apache::Request->new(shift); # my $hash_ref; my @users; foreach my $param ($r->param) { print STDERR "\$r->$param = ".scalar($r->param($param))."\n"; # $hash_ref->{$r->param($param)} = 0; push(@users,$r->param($param)); } # foreach my $ref (keys %{$hash_ref}) { # print STDERR "$ref -> $hash_ref->{$ref}\n"; # } foreach my $u (@users) { print STDERR "user = $u\n"; } return OK; } # End of handler 1; ~~ Dermot Paikkos * [EMAIL PROTECTED] Network Administrator @ Science Photo Library Phone: 0207 432 1100 * Fax: 0207 286 8668 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Embedding another webpage within a web page
Not really related to mod_perl, but check out WWW::Mechanize for form filling, link following, page retrieving easiness. :) Martin Moss wrote: All, I have an interesting issue. I'm in the process of whitelabeling a website, but part of the process I need to whitepabel is hosted by an outsourced company. Rather than get the outsource company to change their html, I would rather download and edit the html from the outsourced website on the fly. I was thinking of writing a contentHandler which uses LWP::Useragent etc.. to download from the outsourced website. however I have only limited experience with it. Also, if the page I wish to download is itself a form, how would I go about getting LWP to 'submit' values etc... Kind Regards Marty ___ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Apache::Test problems
hello all, I'm trying to get Apache::Test to work for a module I'm writing, but I'm having difficulties. All setup information is at the end... I'm using Module::Build (0.26) and Apache::Test (1.14). I've setup my Build.PL as indicated with the documentation with Apache::TestMB. I run perl Build.PL -httpd /usr/local/apache/bin/httpd ./Build ./Build test and then the server never starts up and I get Syntax error on line 24 of /home/mpeters/development/modules/CGI-Application-Plugin-Apache/t/conf/httpd.conf: Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration [ error] server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode) It seems like it's thinks it's using a dynamic build and of course LoadModule won't work. Am I doing something wrong ? Thanks, mod_perl & apache = Static build Apache/1.3.31 (Unix) mod_perl/1.29 configured perl -V === Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Platform: osname=linux, osvers=2.4.21-4.elsmp, archname=i386-linux-thread-multi uname='linux tweety.devel.redhat.com 2.4.21-4.elsmp #1 smp fri oct 3 17:52:56 edt 2003 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dversion=5.8.3 -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 -Dinc_version_list=5.8.2 5.8.1 5.8.0' 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 -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -g -pipe -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.3.3 20040412 (Red Hat Linux 3.3.3-7)', 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 -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.3.3' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Apr 15 2004 13:09:17 @INC: /usr/lib/perl5/5.8.3/i386-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Authentication using https
> All, > > I'm about to replace the authentication mechanism that > our web site uses. However I wanted to sanity check my > thought process. > > Is it possible to have an Authen handler sitting on > certain areas of a site, and if a user isn't logged in > (i.e. doesn't have an auth session cookie) we present > them with a form. (I can do this, but the next bit is > new to me). Then when they send their details, i.e. > username and password, they go over an SSL connection, > which provided they are correct, then shows the page > the user originally wanted? > > Basically I have a mechanism working that does this > without the SSL, but can I update it to use an SSL > connection for the login form submit? > > Marty > see Apache-AuthCookie I believe everything you want is implemented in this package -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Controlling licensed software?
> On Sun, 20 Feb 2005 20:26:07 -0500 > Stas Bekman <[EMAIL PROTECTED]> wrote: > > > Adi Fairbank wrote: > > > Take a look at Crypt::License on CPAN. I used it a couple years > > > back to do exactly what you are trying to do. It encrypts your Perl > > > source code and then decrypts it on the fly. There is a slight > > > overhead for the decryption, but if running under mod_perl, that > > > should be negligible since it would only need to decrypt on apache > > > startup. > > > > Just be aware that if perl sees the decrypted code, the user can see > > it too. It's not trivial but certainly doable, for example while > > running under perl debugger. I wonder why Crypt::License docs don't > > include any warning. Or do I miss something? I haven't tried this > > particular module, but all the previous discussions about similar > > modules had the conclusion that you can really hide the code, other > > than making it harder to get to it. > > > > Yes, it's fairly easy (for any programmer) to intercept the perl code > after it is decrypted and before it's sent to the perl interpreter. > It > would not be easy for the average user though (depending on who your > users are). > > But with Crypt::License, you will only be able to decrypt *if* you > have > a valid license key. That may not make a difference, if you are > offering free trial versions, for example. > > Stas, I'm sure you didn't miss anything in the Crypt::License docs.. > As > I remember, the docs were very minimal and it took me a while just to > figure out how to get it to work- and I had to look through the > source > quite a bit. > I'm more than happy to accept donated documentation to add to the module :-) I'm not a great writer (or tech writer) so any contribution of "actual documentation" would be appreciated and accepted. Michael
[mp2] CGI.pm patch
I ran into the same (or a similar) problem that Scott Beuker reported with CGI.pm truncating POST content in an mp2 setup. In my case the POST was truncated at around 7500 bytes. A check with tcpdump shows that the entire POST is correctly sent to apache. I started by upgrading CGI.pm to the latest release (3.01), but that didn't fix it. Looking through the archives I saw a patch posted by Stas. Here's my version of that patch, that appears to fix that problem. *** CGI.pm~ 2003-12-12 15:09:45.0 -0800 --- CGI.pm 2003-12-12 15:12:29.0 -0800 *** *** 551,558 } if ($meth eq 'POST') { !$self->read_from_client(\$query_string,$content_length,0) !if $content_length > 0; # Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. --- 551,565 } if ($meth eq 'POST') { ! if($content_length > 0) { !my $len = $content_length; !while ($len > 0) { ! my $data = ''; ! my $read = $self->read_from_client(\$data,$content_length,0); ! $len -= $read; ! $query_string .= $data if $read > 0; !} ! } # Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. Michael -- Michael Peppler Data Migrations, Inc. [EMAIL PROTECTED] http://www.mbay.net/~mpeppler Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or long term contract positions - http://www.mbay.net/~mpeppler/resume.html -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
[ANNOUNCE] Apache::AuthCookie 3.05
The file Apache-AuthCookie-3.05.tar.gz has entered CPAN as file: $CPAN/authors/id/M/MS/MSCHOUT/Apache-AuthCookie-3.05.tar.gz size: 31025 bytes md5: 4288575a1eedb52b2fb774324cd63ec8 Changes: Version: 3.05 - Fix POD documentation bug (thanks Steve van der Burg) - login(): set Location header with err_headers_out rather than headers_out (Casey West) - put cookie removal code in remove_cookie() method, put cache handling code in handle_cache() (Mark A. Hershberger) - reorganized tree to support multiple mod_perl versions. - rewrote tests to use Apache::Test framework from CPAN. - fix POD errors in authorize() documentation. - initial support for mod_perl version 2 - mp2: check for Apache::RequestRec arg so that unported subclasses throw exceptions. mod_perl v2 subclass authors: the API has changed slightly for the mod_perl v2 version. See README.modperl2 for details. Regards, Michael Schout GKG.NET, Inc. -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [ANNOUNCE] Apache::AuthCookie 3.05
On Wed, 28 Jan 2004, Geoffrey Young wrote: > so, the Location header really needs to special treatment to be included in > redirect responses, which is typically why you put things in err_headers_out. Well, the report I got on it was that setting it in headers_out rather than err_headers_out causes "Client-Warning: Redirection loop detected" headers to be generated. I never was able to reproduce that and figured it must just be a configuration issue. The main reason I changed it was because I *thought* that err_headers_out was more appropritate because login returns REDIRECT. However, looking at http_protocol.c, I'm not so sure. At least looking at the apache 1.3 sources, ap_send_error_response() in http_protocol.c prefers to have Location in headers_out rather than err_headers_out (as you have already pointed out :)). So from that standpoint, its probably better to have the Location in headers_out. Given that, I think its best to change it back for the next release. So to answer your question, there was not really a specific bug involved here. I just assumed that err_headers_out was the appropriate place becuase of the REDIRECT. I didn't know that http_protocol.c was treating Location differently from other headers :). Thanks for pointing that out. Regards, Michael Schout GKG.NET, Inc. -- Hal 9000 - "Put down those Windows disks Dave Dave? DAVE!!" -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
simple question
I'm writing an access control handler. I have a little routine to cleanup the variables so that they don't persist after the script is through running into the next run. However, sometimes I do a redirect to a login page like so. $r->internal_redirect($VAR{'login_page'}); clean_up(); return OK; My question is: Will the clean_up() routine run, or will the script loose control at the internal redirect and never reach the clean_up routine. Thanks John Michael
Apache::AuthenNTLM 2.05 ntlm+basic
On the inTRAnet side of this it works fine, and authenticates agenst a PDC/BDC. on the inTERnet side of this it fails. prompts for user/pass/domain. What I am trying to do is if the user is on the network use NTLM. if he is on the internet use basic and have them sign in via user/passwd created w/ htpasswd. am I not using authenNTLM properly? am I missing something? error_log: [Mon Feb 09 12:10:59 2004] [error] Bad/Missing NTLM/Basic Authorization Header for / [Mon Feb 09 12:11:01 2004] [error] No PDC and no fallbackdomain given for domain [Mon Feb 09 12:11:01 2004] [crit] [client 198.147.38.151] configuration error: couldn't check user. No user file?: / PerlAuthenHandler Apache::AuthenNTLM AuthType ntlm,basic require valid-user PerlAddVar ntdomain "CONWAYqgats006 ciits903" PerlSetVar ntlmauthoritative "off" PerlSetVar ntlmdebug 0 AuthName "testing" AuthUserFile /www/secure/passwd AuthGroupFile /www/secure/group Michael Dooley Integrated Services Manager [EMAIL PROTECTED] [EMAIL PROTECTED] O: (630).449.1000 F: (630).449.1010 C: (773).580.8777 -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
RE: Mail bounced thru Kazakhstan -- This list only
its not a problem with the list. it's a problem w/ one of the users on the list. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 3:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Mail bounced thru Kazakhstan -- This list only Hello, Sending mail to this list is not working properly. This is a test through Comcast's web interface instead of OE. 'Course if you have a clue, regarding this problem, I'd like to hear from you. (Al's address below is unreachable. Comcast support has proven useless.) When I try to post to a list at [EMAIL PROTECTED] my mail gets bounced with this message: Subject: Returned mail: You are not allowed posting # (not true, AFAIK) From: "Jonathan Mangin" <[EMAIL PROTECTED]> To: 2:5083/82 Date: Mon, 9 Feb 2004 10:36:15 -0500 Subject: Re: Registry not loaded...script still works could not be gateway to this address For more information about this gateway send a mail to Alexander Uskov 2:5083/121 or [EMAIL PROTECTED] I am subscribed to the list. The message lands on the list plus I get the returned mail. Can you offer any insights to this problem? Thanks. Jon -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Sections
Would anyone be able to toss a dog a bone? I have this in my httpd.conf and the server starts up fine, but when I try to access the page it doesn't do any authentication. I also tried it in $DOCUMENT_ROOT/.htaccess and I get a Perl not allowed here. Anyone have any ideas how I can pull this off? $Location{"/"} = { if ( $ENV{REMOTE_ADDR} =~ /x.x.x.x/) { ## This is set for my IP specificly for a trial run. PerlAuthenHandler => Apache::AuthenNTLM, AuthType => ntlm, require => valid-user, PerlAddVar => {ntdomain => "DOMAINPDC BDC",}, PerlSetVar => {ntlmdebug => 0,}, } else { AuthType => Basic, require => valid-user, AuthName => "Login", AuthUserFile => www/secure/passwd, AuthGroupFile => www/secure/group, } }; -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
RE: Sections
CORRECTION: ERROR: [Tue Feb 10 08:26:06 2004] [error] Bad/Missing NTLM/Basic Authorization Header for / [Tue Feb 10 08:26:06 2004] [error] No PDC and no fallbackdomain given for domain DOMAIN if ( $ENV{REMOTE_ADDR} = '192.168.0.24') { $Location{"/"} = { PerlAuthenHandler => "Apache::AuthenNTLM", AuthType => "ntlm", require => "valid-user", PerlAddVar => {ntdomain => "DOMAIN PDC BDC",}, PerlSetVar => {ntlmdebug => 1,}, }; } else { $Location{"/"} = { AuthType => "Basic", require => "valid-user", AuthName => "testing", AuthUserFile => "www/secure/passwd", AuthGroupFile => "www/secure/group", }; } -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Apache::AuthenNTLM 2.05
I have tried a variety of entries but I cant get this specific perl section to work. does anyone have any suggestions? I cant be the only person to have tried this am i? $Location{"/"} = { PerlAuthenHandler => Apache::AuthenNTLM, AuthType => ntlm, require => valid-user, "PerlAddVar ntdomain" => { domain => DOMAIN, PDC => PDC, BDC => BDC,}, PerlSetVar => { ntlmdebug => 1,}, }; I have also tried: PerlAddVar => { ntdomain => "domain pdc bdc", }, "PerlAddVar ntdomain" => "domain pdc bdc", PerlAddVar => { ntdomain => {domain => "pdc bdc",},}, -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
RE: [mp2] UDP communications in perl module running under mod_perl2
> Which Unix? I've heard about the troubles with sockets on AIX (w/ mod_perl 1) Solaris 8. > Have you read: Yes. However, unless I'm confused, that is a bit different in that it is an example of using APR to work with the socket established by Apache to communicate with the client. I need to establish my own UDP conversation with a "third-party" service from where I'll retrieve data which I'll use to compose my response to the client. If I can use APR to do that, great, but I couldn't find docs/samples/tests that create/open/close APR sockets. Thanks, Michael Maciag -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 4:41 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [mp2] UDP communications in perl module running under mod_perl2 [EMAIL PROTECTED] wrote: > Apache/2.0.48 (Unix) mod_perl/1.99_12 Perl/v5.8.0 Which Unix? I've heard about the troubles with sockets on AIX (w/ mod_perl 1) > Should I have any difficulty running a simple socket UDP Perl module > under the above configuration? Run directly from Perl, I'm able to > send/recv from an external server. However, run from the apache server, > the recv fails. (I've tried the Perl Socket module and the recv doesn't > complete. If I use IO:Socket, the recv returns with a 'connection > refused'.) > > I see the references to APR socket routines in mp2. Do I need to use those? Yup. Have you read: http://perl.apache.org/docs/2.0/user/handlers/protocols.html In particular: http://perl.apache.org/docs/2.0/user/handlers/protocols.html#Socket_based_Pr otocol_Module __ 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 -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] UDP communications in perl module running under mod_perl2
Fortified with the responses from Philippe and Stas, I went back and, after re-examining the entire configuration, found a typo that was causing my error. Now, no problem at all working with the third-party server over UDP from mod_perl2 using IO::Socket::INET. Yours, chagrined, Michael Maciag -Original Message- From: Philippe M. Chiasson [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 4:16 PM To: Stas Bekman Cc: Michael Maciag; [EMAIL PROTECTED] Subject: Re: [mp2] UDP communications in perl module running under mod_perl2 On Wed, 2004-02-11 at 10:53 -0800, Stas Bekman wrote: > Michael Maciag wrote: > >>Which Unix? I've heard about the troubles with sockets on AIX (w/ mod_perl > > > > 1) > > > > Solaris 8. > > > > > >>Have you read: > > > > Yes. However, unless I'm confused, that is a bit different in that it is an > > example of using APR to work with the socket established by Apache to > > communicate with the client. I need to establish my own UDP conversation > > with a "third-party" service from where I'll retrieve data which I'll use to > > compose my response to the client. If I can use APR to do that, great, but I > > couldn't find docs/samples/tests that create/open/close APR sockets. > > Ah, then yes, you should be able to use Perl sockets. I doubt that the problem > has to do anything with mod_perl, though. YOu said that recv fails, but you > dind't specify what was the error message. > > Also I remember Philippe was working on mod_udp or something like that, so he > certainly will know if there are any special Apache issues to deal with. Philippe? If you are trying to send an UDP query over to a server and read a response from it in Perl, there is no problem, really, i.e.: use strict; use IO::Socket::INET; sub handler { my $r = shift; my $socket = new IO::Socket::INET ( PeerAddr => 'localhost:echo', Proto=> 'udp', Type => SOCK_DGRAM, ) || die $!; $socket->send($r->path_info) || die $!; my $response; $socket->recv($response, length($r->path_info)) || die $!; print ($r->path_info eq $response) ? "OK" : "NOK"; } Just works fine! In a case like this one, trying to use APR for UDP is overkill. Use Perl. Gozer out. > __ > 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 -- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[JOB] web application developer
We are looking for mod_perl application developers immediately. Who we're looking for: We're in the market for an Application developer with detailed knowledge of web server / web development on Unix systems. You should have 2+ years experience in software development perl/CGI, with a very high level of understanding of Apache web server and mod_perl. mod_perl experience on a unix system is the primary requirement. Applicants should be also be familiar with SQL and DBI. Should be able to develop maintainable, high traffic web applications and be able to tune the server/apps for system performance. Needs to integrate into existing team. Communication skills a must! Who we are: Since the monopoly of Network Solutions, Inc has been broken up, GKG.NET, Inc. has been accredited to be a TLD registrar for the .com, .net, .org, and .info domains. We are committed to our employees and to our customers and our actions always take these 2 into consideration. Our office environment is very relaxed and we like to have fun while we get our work done. We have a virtual officing concept that allows our employees to have home based offices and work remotely. Our management team has 75+ years experience in the hi tech industry and extensive years in the commercial banking industry as well. Please send your resume by email, fax or ground mail to: GKG.NET, Inc. 2700 Earl Rudder Frwy, Ste 1300 College Station, TX 77840 Fax: (979) 694-7060 Email: [EMAIL PROTECTED] If possible, please include a list of mod_perl projects you have worked on as references as well as a sample of your code. Feel free to call me at (800) 617 0412 or email me if you have any questions. Taylor Marvin -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[mp2] my filter crashes on reverse proxied content
27;Exiting Mike:filter.pm'); return Apache::DECLINED; } my $src = "" my $dst = $r->dir_config->get('FilterDestination'); # unset Content-Length since we're probably changing the length unless ($f->ctx) { $r->headers_out->unset('Content-Length'); $f->ctx(1); } $log->info('Mike:filter.pm(43): mapping for ', $r->uri, ' (an HTML document)'); while ($f->read(my $buffer, BUFF_LEN)) { $buffer =~ s/$src/$dst/ig; $f->print($buffer); } $log->info('Exiting Mike:filter.pm'); return Apache::OK; } 1; 2. Used Components and their Configuration: *** mod_perl version 1.9913 *** using d:/Perl/site/lib/Apache2/Apache/BuildConfig.pm *** Makefile.PL options: MP_AP_PREFIX => D:\Apache2 MP_COMPAT_1X => 1 MP_GENERATE_XS => 1 MP_INST_APACHE2 => 1 MP_LIBNAME => mod_perl MP_USE_DSO => 1 MP_USE_STATIC => 1 *** The httpd binary was not found $ ./Apache -V Server version: Apache/2.0.48 Server built: Mar 19 2004 00:05:49 Server's Module Magic Number: 20020903:4 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR="server/mpm/winnt" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/apache" -D SUEXEC_BIN="/apache/bin/suexec" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error.log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" $ ./Apache -l Compiled in modules: core.c mod_win32.c mpm_winnt.c http_core.c mod_so.c *** D:\Perl\bin\perl.exe -V Summary of my perl5 (revision 5 version 8 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef 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='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"D:\Perl\lib\CORE" -machine:x86' libpth="D:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -libpath:"D:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 804 Built under MSWin32 Compiled at Dec 1 2002 23:15:13 %ENV: PERL_LWP_USE_HTTP_10="1" @INC: D:/Perl/lib D:/Perl/site/lib . 3. This is the core dump trace: (if you get a core dump): [CORE TRACE COMES HERE] This report was generated by -e on Mon Mar 22 15:21:35 2004 GMT. -- Thanks a lot, Michael Franken -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[mp2] my filter crashes on reverse proxied content
e:filter.pm'); return Apache::DECLINED; } my $src = $r->dir_config->get('FilterSource'); my $dst = $r->dir_config->get('FilterDestination'); # unset Content-Length since we're probably changing the length unless ($f->ctx) { $r->headers_out->unset('Content-Length'); $f->ctx(1); } $log->info('Mike:filter.pm(43): mapping for ', $r->uri, ' (an HTML document)'); while ($f->read(my $buffer, BUFF_LEN)) { $buffer =~ s/$src/$dst/ig; $f->print($buffer); } $log->info('Exiting Mike:filter.pm'); return Apache::OK; } 1; 2. Used Components and their Configuration: *** mod_perl version 1.9913 *** using d:/Perl/site/lib/Apache2/Apache/BuildConfig.pm *** Makefile.PL options: MP_AP_PREFIX=> D:\Apache2 MP_COMPAT_1X=> 1 MP_GENERATE_XS => 1 MP_INST_APACHE2 => 1 MP_LIBNAME => mod_perl MP_USE_DSO => 1 MP_USE_STATIC => 1 *** The httpd binary was not found $ ./Apache -V Server version: Apache/2.0.48 Server built: Mar 19 2004 00:05:49 Server's Module Magic Number: 20020903:4 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR="server/mpm/winnt" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/apache" -D SUEXEC_BIN="/apache/bin/suexec" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error.log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" $ ./Apache -l Compiled in modules: core.c mod_win32.c mpm_winnt.c http_core.c mod_so.c *** D:\Perl\bin\perl.exe -V Summary of my perl5 (revision 5 version 8 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef 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='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"D:\Perl\lib\CORE" -machine:x86' libpth="D:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -libpath:"D:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 804 Built under MSWin32 Compiled at Dec 1 2002 23:15:13 %ENV: PERL_LWP_USE_HTTP_10="1" @INC: D:/Perl/lib D:/Perl/site/lib . 3. This is the core dump trace: (if you get a core dump): [CORE TRACE COMES HERE] This report was generated by -e on Mon Mar 22 15:21:35 2004 GMT. -- Thanks a lot, Michael Franken -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
The problem seems to be related to threading (free to wrong pool) on Win32. As can be read from article http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-01/msg00748.html. I've set my threads to 1, and the problem seems gone. Of course this is not a solution, since the server now is deadslow. Anyway it's a hint for some of you to get a real fix, although I've seen many people reporting 'free to wrong pool', and no solutions yet, hope this gets resolved soon. Michael -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Randy, Just did upgrade my Perl, but it didn't help much, I get different error messages, but seems to be same problem. Randy Kobes wrote: On Mon, 22 Mar 2004, Michael Franken wrote: The problem seems to be related to threading (free to wrong pool) on Win32. As can be read from article http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-01/msg00748.html. I've set my threads to 1, and the problem seems gone. Of course this is not a solution, since the server now is deadslow. Anyway it's a hint for some of you to get a real fix, although I've seen many people reporting 'free to wrong pool', and no solutions yet, hope this gets resolved soon. This "free to wrong pool" error is a generic type of problem, so fixes happen on a case-by-base basis. hmm, I tend to find generic solutions to generic problems, but hey, that may be asked too much ;-) Is it possible for you to try perl-5.8.3 (ActivePerl 809)? This also has some thread-related fixes that may be relevant. regards, Michael -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Geoff, I can't really say whether Apache::Clean works. I replaced my Filter with Apache::Clean, and it worked. However it only gets fired on the first page, since my filter is intended to fix the urls, which happen to be on the first page in a baseref. Mike Geoffrey Young wrote: I have written a OutputFilter that finds a string in a response and replaces the string with another. It works fine with static files, but not on response from a reverse proxy, and that is just what I want to achieve. I'm trying to run my Outlook Web Access backend behind an Apache frontend. Running Apache::Clean for instance does work on reverse proxied content, it seems. are you saying that Apache::Clean works fine but your altered code does not? I didn't see anything in your code that looked unusual. if you could reduce the Apache::Clean test suite to a minimal code + test that reproduced your problem it would help alot. --Geoff -- -- drs. Michael Franken senior consultant Xebia bv, Melkweg 23a, 1251PP Laren, The Netherlands, www.xebia.com office: +31-35-5381921, mobile: +31-651 149 132, [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Stas, Good idea, but I've tested it, and it doesn't help (I created on alias in my host file with the same length, yes). regards, Michael Stas Bekman wrote: Geoffrey Young wrote: I have written a OutputFilter that finds a string in a response and replaces the string with another. It works fine with static files, but not on response from a reverse proxy, and that is just what I want to achieve. I'm trying to run my Outlook Web Access backend behind an Apache frontend. Running Apache::Clean for instance does work on reverse proxied content, it seems. are you saying that Apache::Clean works fine but your altered code does not? I didn't see anything in your code that looked unusual. if you could reduce the Apache::Clean test suite to a minimal code + test that reproduced your problem it would help alot. Michael's filter is different in a sense that it may enlarge the original input, whereas Apache::Clean always shrinks it. So in this code: while ($f->read(my $buffer, BUFF_LEN)) { $buffer =~ s/$src/$dst/ig; $f->print($buffer); } perl never allocates extra memory for $buffer =~ s/$src/$dst/ig; whereas in Michael's case it will if length($src) < length($dst). Michael, if you test with length($src) == length($dst), does the problem go away? __ Stas Bekman JAm_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 -- -- drs. Michael Franken senior consultant Xebia bv, Melkweg 23a, 1251PP Laren, The Netherlands, www.xebia.com office: +31-35-5381921, mobile: +31-651 149 132, [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
] [info] Mike:filter.pm(43): mapping for /exchange/mike/ (an HTML document) [Mon Mar 22 21:20:52 2004] [info] Exiting Mike:filter.pm Free to wrong pool 97d568 not a41280. [Mon Mar 22 21:20:52 2004] [info] Mike:filter.pm(43): mapping for /exchange/mike/Inbox/ (an HTML document) [Mon Mar 22 21:20:55 2004] [info] Exiting Mike:filter.pm [Mon Mar 22 21:20:55 2004] [info] Mike:filter.pm(43): mapping for /exchange/mike/Inbox/ (an HTML document) [Mon Mar 22 21:20:55 2004] [info] Exiting Mike:filter.pm Thanks for the testcase, what's next? Stas Bekman wrote: Michael Franken wrote: Hi Stas, Good idea, but I've tested it, and it doesn't help (I created on alias in my host file with the same length, yes). and if you drop the dir_config calls and use hardcoded $src, $dst? __ 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 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Stas, First of all thanks for your quick and great response. I am using Perl 5.8.3, yes. And I'm happy to provide you with a testcase. Note though that i'm a little handicapped on my Win32 box. I do have make/gcc/etc on cygwin, but my current setup has been built using binaries only. I'm not using any switches. I'll setup a simple environment 1st, and send you my httpd.conf file Mike Stas Bekman wrote: Michael Franken wrote: Hi Stas, That was close, I got a few responses, but then it crashed again: [...] Thanks for the testcase, what's next? Can we see the relevant parts of your config? Have you used by chance 'PerlOptions +Parent' switches? Ideally, it'd be nice if you could prepare for us a complete test suite, from the tar ball: http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description then I'll try to make a special mod_perl build which emulated win32 memory pool allocation to reproduce the problem. Also have you tried with 5.8.3 as Randy suggested? Though it seems like the interpreter scoping problem that keeps on haunting us :( __ 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 -- -- drs. Michael Franken senior consultant Xebia bv, Melkweg 23a, 1251PP Laren, The Netherlands, www.xebia.com <http://www.xebia.com> office: +31-35-5381921, mobile: +31-651 149 132, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var #ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var #ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var #ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var #ErrorDocument 410 /error/HTTP_GONE.html.var #ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var #ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var #ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var #ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var #ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var #ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var #ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var #ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var #ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var #ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var # # The following directives modify normal HTTP response behavior to # handle known problems with browser implementations. # BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 # # The following directive disables redirects on non-GET requests for # a directory that does not include the trailing slash. This fixes a # problem with Microsoft WebFolders which does not appropriately handle # redirects for folders with DAV methods. # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV. # BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully BrowserMatch "^gnome-vfs" redirect-carefully # # Allow server status reports generated by mod_status, # with the URL of http://servername/server-status # Change the ".@@DomainName@@" to match your domain to enable. # # #SetHandler server-status #Order deny,allow #Deny from all #Allow from .@@DomainName@@ # # # Allow remote server configuration reports, with the URL of # http://servername/server-info (requires that mod_info.c be loaded). # Change the ".@@DomainName@@" to match your domain to enable. # # #SetHandler server-info #Order deny,allow #Deny from all #Allow from .@@DomainName@@ # # # Proxy Server directives. Uncomment the following lines to # enable the proxy server: # # #ProxyRequests Off # # #Order deny,allow #Deny from all #Allow from all # # # Enable/disable the handling of HTTP/1.1 "Via:" headers. # ("Full" adds the server version; "Block" removes all outgoing Via: headers) # Set to one of: Off | On | Full | Block # #ProxyVia On # # To enable the cache as well, edit and uncomment the following lines: # (no cacheing without CacheRoot) # #CacheRoot "D:/ApacheT/proxy" #CacheSize 5 #CacheGcInterval 4 #CacheMaxExpire 24 #CacheLastModifiedFactor 0.1 #CacheDefaultExpire 1 #NoCache a-domain.com another-domain.edu joes.garage-sale.com # # End of proxy directives. # # Bring in additional module-specific configurations # Include conf/ssl.conf ### Section 3: Virtual Hosts # # VirtualHost: If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # http://httpd.apache.org/docs-2.0/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # NameVirtualHost 212.238.156.229:81 #NameVirtualHost * # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # # # ServerAdmin [EMAIL PROTECTED] #DocumentRoot /www/docs/dummy-host.example.com #ServerName dummy-host.example.com #ErrorLog logs/dummy-host.example.com-error_log #CustomLog logs/dummy-host.example.com-access_log common # ServerName mda.demon.nl DocumentRoot e:/www/docs/rowan.kueper.org LogLevel error ProxyPass /exchange http://mda.demon.nl:86/exchange ProxyPassReverse/exchange http://mda.demon.nl:86/exchange ProxyPass /exchweb http://mda.demon.nl:86/ExchWeb ProxyPassReverse/exchweb http://mda.demon.nl:86/ExchWeb ProxyPass /public http://mda.demon.nl:86/public ProxyPassReverse/public http://mda.demon.nl:86/public PerlModule Apac
Re: [mp2] my filter crashes on reverse proxied content
x27;Apache.exe': Loaded 'C:\WINDOWS\system32\dnsapi.dll', No symbols loaded. 'Apache.exe': Loaded 'C:\WINDOWS\system32\winrnr.dll', No symbols loaded. 'Apache.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll', No symbols loaded. 'Apache.exe': Loaded 'C:\WINDOWS\system32\rasadhlp.dll', No symbols loaded. The thread 'Win32 Thread' (0x1e58) has exited with code 0 (0x0). Unhandled exception at 0x280829d4 in Apache.exe: 0xC005: Access violation reading location 0x0c10. >perl58.dll!280829d4() mod_perl.so!10007985() mod_perl.so!1000813d() libhttpd.dll!ap_pass_brigade(ap_filter_t * next=0x008c9f30, apr_bucket_brigade * bb=0x007d4db0) Line 511 + 0x7C mod_proxy_http.so!ap_proxy_http_process_response(apr_pool_t * p=0x007d4900, request_rec * r=0x008c8060, proxy_http_conn_t * p_conn=0x007d4e00, conn_rec * origin=0x007d4fc8, proxy_conn_rec * backend=0x007d4e18, proxy_server_conf * conf=0x00585510, apr_bucket_brigade * bb=0x007d4db0, char * server_portstr=0x04b5fe78) Line 921 + 0xeC mod_proxy_http.so!ap_proxy_http_handler(request_rec * r=0x007d4e00, proxy_server_conf * conf=0x00585510, char * url=0x007d4ee0, const char * proxyname=0x, unsigned short proxyport=0) Line 1091 + 0x1dC mod_proxy.so!proxy_run_scheme_handler(request_rec * r=0x008c8060, proxy_server_conf * conf=0x00585510, char * url=0x008c9eee, const char * proxyhost=0x, unsigned short proxyport=0) Line 1108 + 0x3bC mod_proxy.so!proxy_handler(request_rec * r=0x00585510) Line 419C libhttpd.dll!ap_run_handler(request_rec * r=0x008c8060) Line 152 + 0x1fC libhttpd.dll!ap_invoke_handler(request_rec * r=0x008c8060) Line 362C libhttpd.dll!ap_process_http_connection(conn_rec * c=0x007d4a08) Line 250 + 0x6C libhttpd.dll!ap_run_process_connection(conn_rec * c=0x007d4a08) Line 42 + 0x1fC libhttpd.dll!ap_process_connection(conn_rec * c=0x007d4a08, void * csd=0x007d4938) Line 175 + 0x6C libhttpd.dll!worker_main(long thread_num=8210944) Line 718C msvcrt.dll!77bc91ed() kernel32.dll!77e4a990() Michael Franken wrote: Hi Stas, I've just setup a simple environment with a pretty vanilla config. I get respons as before, but it crashes after a few responses. The funny thing I noticed is that the first time I launched the new server, I got no errors form my reverse proxied mod_perl'd pages. Here's my httpd.conf: [snip] --8<--- regards, Mike Stas Bekman wrote: Michael Franken wrote: Hi Stas, That was close, I got a few responses, but then it crashed again: [...] Thanks for the testcase, what's next? Can we see the relevant parts of your config? Have you used by chance 'PerlOptions +Parent' switches? Ideally, it'd be nice if you could prepare for us a complete test suite, from the tar ball: http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description then I'll try to make a special mod_perl build which emulated win32 memory pool allocation to reproduce the problem. Also have you tried with 5.8.3 as Randy suggested? Though it seems like the interpreter scoping problem that keeps on haunting us :( __ 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 -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[mp2] migrating mp1 RequestRec::notes() to mp2
I am having problems trying to migrate some Perl code (that I didn't write) from mod_perl 1 (and libapreq 1) to mod_perl 2 (and libapreq2). I don't understand why I having problems with this simple code example. package Example; use strict; use mod_perl; use Apache2; use Apache::RequestRec; use Apache::Request; # libapreq2 sub handler : method { my ($class, $r) = @_; my $apr = Apache::Request->new($r); $apr->notes( 'mm_secure' => 0 ); } 1; The error is: [Tue Mar 23 11:41:36 2004] [error] [client 127.0.0.1] Usage: Apache::RequestRec::notes(obj, val=NULL) at /var/www/perl/Example.pm line 14. -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Stas, I understand that going thru 40 KB is a pain. Unfortunately I can't seem to get the test suite running, the Perl Makefile does not produce a valid makefile, and I can't seem to fix it (something with DIRFILESEP). As I told you I'm a little handicapped on my Win32/cygwin machine, as I'm working off of binaries. I would still appreciate if you'd look into my case. The httpd.conf is really standard, the 40KB is all std comments, all I really do is: #added by MF 10/03/2004 LoadFile "d:/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so ServerName mail.franken.ws DocumentRoot e:/www/docs/rowan.kueper.org LogLevel error ProxyPass /exchange http://localhost:86/exchange ProxyPassReverse/exchange http://localhost:86/exchange ProxyPass /exchweb http://localhost:86/ExchWeb ProxyPassReverse/exchweb http://localhost:86/ExchWeb ProxyPass /public http://localhost:86/public ProxyPassReverse/public http://localhost:86/public PerlModule Apache2 PerlModule Mike::Filter SetHandler modperl PerlOutputFilterHandler Mike::Filter PerlSetVar FilterSource localhost:86 PerlAddVar FilterDestination mail.franken.ws:80 You can verify it by simply running tomcat in the backend, and reverse proxy http://localhost:8080/manager, you will see the same behavior. Stas Bekman wrote: Michael Franken wrote: Hi Stas, I've just setup a simple environment with a pretty vanilla config. I get respons as before, but it crashes after a few responses. The funny thing I noticed is that the first time I launched the new server, I got no errors form my reverse proxied mod_perl'd pages. Here's my httpd.conf: 40kb to work through is not simple ;) Please reread again what I've suggested: > Can we see the relevant parts of your config? > ... > Ideally, it'd be nice if you could prepare for us a complete test suite, > from the tar ball: > http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description > then I'll try to make a special mod_perl build which emulated win32 > memory pool allocation to reproduce the problem. if you can do that, it'll help us a lot. otherwise i don't when we will be able to try to reproduce your problem, since the amount of time required to accomplish that ourselves is a way too large. 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 regards, Michael -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Stas, Perrin, Thanks for the note, but I'm not sure whether the documentation is consistent. Besides saying "The SetHandler directive is only relevant for response phase handlers", the documentation says to use 'SetHandler modperl' when you want to use PerlSetVar and $r->dir_config, which is what I do. Anyway the filter won't work without 'SetHandler modperl'... Michael Stas Bekman wrote: Perrin Harkins wrote: On Thu, 2004-03-25 at 06:45, Michael Franken wrote: SetHandler modperl PerlOutputFilterHandler Mike::Filter PerlSetVar FilterSource localhost:86 PerlAddVar FilterDestination mail.franken.ws:80 Silly question: is this right, using SetHandler modperl when mod_perl is just being used for filtering? Yes, it's wrong. SetHandler affects only the response phase. http://perl.apache.org/docs/2.0/user/config/config.html#C_SetHandler_ __ Stas Bekman JAm_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 -- drs. Michael Franken senior consultant Xebia bv, Melkweg 23a, 1251PP Laren, The Netherlands, www.xebia.com office: +31-35-5381921, mobile: +31-651 149 132, [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] my filter crashes on reverse proxied content
Hi Stas, Stas Bekman wrote: Michael Franken wrote: Hi Stas, I understand that going thru 40 KB is a pain. Unfortunately I can't seem to get the test suite running, the Perl Makefile does not produce a valid makefile, and I can't seem to fix it (something with DIRFILESEP). As I told you I'm a little handicapped on my Win32/cygwin machine, as I'm working off of binaries. I would still appreciate if you'd look into my case. The httpd.conf is really standard, the 40KB is all std comments, all I really do is: That's exactly what I was after, Michael. You're welcome. #added by MF 10/03/2004 LoadFile "d:/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so ServerName mail.franken.ws DocumentRoot e:/www/docs/rowan.kueper.org LogLevel error ProxyPass /exchange http://localhost:86/exchange ProxyPassReverse/exchange http://localhost:86/exchange ProxyPass /exchweb http://localhost:86/ExchWeb ProxyPassReverse/exchweb http://localhost:86/ExchWeb ProxyPass /public http://localhost:86/public ProxyPassReverse/public http://localhost:86/public PerlModule Apache2 PerlModule Mike::Filter SetHandler modperl PerlOutputFilterHandler Mike::Filter PerlSetVar FilterSource localhost:86 PerlAddVar FilterDestination mail.franken.ws:80 That looks very similar to the mp2 test. t/filter/TestFilter/both_str_req_proxy.pm Since you didn't run the mp2 test suite at all I'd suggest to start there. I'd be happy to run a few cases, if you can point me to some documentation. I'll try to play with it and see if I can reproduce it. Mind you, I'm not running on win32. I'm curious whether you __can__ reproduce it then, since the problem seems related to threading... You can verify it by simply running tomcat in the backend, and reverse proxy http://localhost:8080/manager, you will see the same behavior. right, "simply running tomcat"... Much simpler then setting up Exchange I can tell you ;-) __ 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 regards, Michael -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[ANNOUNCE] Apache::AuthCookie 3.06
The uploaded file Apache-AuthCookie-3.06.tar.gz has entered CPAN as file: $CPAN/authors/id/M/MS/MSCHOUT/Apache-AuthCookie-3.06.tar.gz size: 32510 bytes md5: 8d64e84fb8accd870b058e6b7b1634f9 Changes: ** BUG FIX: AuthNameSatisfy (Any|All) directives were broken. AuthCookie was using AuthCookieSatisfy rather than ${auth_name}Satisfy. If you used this feature and had an "AuthCookieSatisfy" directive in your config file, you MUST change this to ${auth_name}Satisfy. E.g.: "WhateverSatisfy All" - created better test cases for AuthNameSatisfy directives. - when redirecting, set Location with headers_out() not err_headers_out(). apache prefers Location in headers_out, even if the status code is not 200. - MP2: Apache::unescape_url() -> Apache::URI::unescape_url() - check for mod_perl 1.9913 or later for Apache::URI (Frederick Moyer) - Remove set status in login.pl which caused malformed custom error document (Frederick Moyer) - Add support for ${auth_name}CookieName to change the name of the cookie used for each auth name. Default remains ${auth_name}_${auth_type} if not set. - make some debug log_error() calls conditional on $debug Regards, Michael Schout -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Send ASCII file to the browser
Hi guys, I have a small problem with sending simple ASCII file to the browser. Inside perl module I have a method which find and send specific file: my $fh = new Apache::File('some_file'); my $r = Apache->request; $r->content_type('plain/text'); $r->headers_out->set('Content-Disposition' => "attachment; filename=some_file); $r->sendfile($fname); I call that method from a web page. Problem: source code of the web page is added at the end of downloaded file. Any suggestions? Thanks in advanced. -- Best regards, Michael Stepanov Perl/Linux Developer Francoudi & Stephanou Ltd Tel: +357 25-867154 Email: [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Send ASCII file to the browser
Chris Gamache wrote: This might be solution: $r->content_type('text/plain'); Yes, you are right! I should be more careful! Thanks. --- Michael Stepanov <[EMAIL PROTECTED]> wrote: Hi guys, I have a small problem with sending simple ASCII file to the browser. Inside perl module I have a method which find and send specific file: my $fh = new Apache::File('some_file'); my $r = Apache->request; $r->content_type('plain/text'); $r->headers_out->set('Content-Disposition' => "attachment; filename=some_file); $r->sendfile($fname); I call that method from a web page. Problem: source code of the web page is added at the end of downloaded file. Any suggestions? Thanks in advanced. -- Best regards, Michael Stepanov Perl/Linux Developer Francoudi & Stephanou Ltd Tel: +357 25-867154 Email: [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html __ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com -- Best regards, Michael Stepanov Perl/Linux Developer Francoudi & Stephanou Ltd Tel: +357 25-867154 Email: [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Advice needed on custom webapp framework
On Wed, 17 Nov 2004, jonathan vanasco wrote: > Ideally, I would have the packages in Website and WebAppFramework > lookup the right DB for the Website There are many ways to solve this problem. I'll show you 2 ways. I'll focus just on the database part to keep this as short as possible, but the same ideas apply to the user object... One way is to put the databse in a separate package and access it using static methods. e.g.: my $dbh = Website::Database->dbh; You could even make this a method of WebAppFramework. Then you are simply left with the problem of getting the right database handle for each website. There are many ways to do that. One way would be to just have a hash or something in WebAppFramework that stores the database handles for each partuclar website, and then have your dbh() (or whatever you decide to call it) method figure out which handle to retrieve. The downside is that you have to modify WebAppFramework everytime you create a new application (or, create methods for managing the datbase hash, and call them from within your appliaction). If you don't want to do it that way, another way would be to simply subclass WebAppFramework for each site, and then have the individual appliactions subclass it. e.g.: package WebAppFrameWork::SomeSite; use base 'WebAppFrameWork'; sub dbh { # return database appropriate for "SomeSite" } ... __END__ package WebApp::SomeSite::SomeApp; use base 'WebAppFrameWork::SomeSite'; # calling $self->dbh in here calls WebAppFrameWork::SomeSite->dbh # plus you can call any methods provided by WebAppFrameWork ... __END__ Regards, Michael Schout -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Handling the User pressed Stop button case - problems
Federico M. wrote: Hi, what's wrong whit this script. I need to detect when the user press the stop button. I read: http://perl.apache.org/docs/1.0/guide/debug.html#Handling_the__User_pressed_Stop_button__case SO: Debian Sarge. This is my apache.http: --- # If the perl module is installed, this will be enabled. Alias /perl/ /var/www/perl/ SetHandler perl-script PerlHandler Apache::Registry PerlFixupHandler Apache::SIG LogFormat "%h %l %u %t \"%r\" %s %b &{SIGPIPE}e" Options +ExecCGI I have mod_perl.so, but don't have mod_perl.c This is my script: -- #!/usr/bin/perl you need to assign the request object to $r my $r = shift; $r->send_http_header; print"PID=$$\n"; $r->rflush; while(1) { $r->print("\0"); $r->rflush; last if $r->connection->aborted; $i++; sleep 1; } If you had put a 'use strict' in there at the top it might have been easier to see this. -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: the scripts under mod_perl are running as mod_cgi
INFOQUEST USA INC wrote: I am going to design a auto-installer for mod_perl as many of my customers is not comfortable installing it. I will post it here soon. you should really check out ApacheToolBox (http://apachetoolbox.com/). It's really easy to use to install apache/mod_perl/php, and a whole bunch of other modules. The only drawback is that it doesn't work for apache2/mod_perl2 yet. -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [pm1] Building mod_perl for Tenon's iTools on Mac OS 10.2
1) Why can't "make test" fire up Apache? 2) Why is --without-execstrip necessary on Mac OS X (Darwin/FreeBSD)? 3) Are any other Apache configuration options necessary to replicate Tenon's configuration, if required by mod_perl? Any pointers much appreciated. At the moment it's a bit difficult to administrate the server in question, since mod_perl isn't working. try build perl with threads support. Mike.
Re: [Fwd: AuthenNTLM and slow web server]
On Fri, Oct 31, 2003 at 08:08:02PM +0100, Stefano Ciancio wrote: > > Hi, > > I have seen better the log and the error in apache's error.log was about some > gif that the web server not found. > But the big problem with this module is that seem for each object it require an > authentication from pdc/bdc. This behaviour causes the web server to go _very_ > slow. The user must wait ten of seconds to load a single web page. > > I want use this module to obtain a single sign on in the Intranet of my company > that have thousands of users in some trusted NT pdc/bdc. > Do you think that this module could working fine? Exists some other mechanism to > obtain the single sign on with ntlm? > It's fairly easy to knock a PDC/BDC over if you throw enough authentication requests at it. The key is to do everything possible to limit the number of authentication requests it has to make. Someone mentioned using cookies, which is one way. There have been several discussed over the years on this list. You should check the archives to give you some ideas on how to solve the problem. I found the most success using one of the authentication caching modules. Michael
video pirates
I am trying to find out the best way to prevent people from opening several browsers to download several video files at one time. I think it may be site download robots causing the problem. I have heard of mod throttle and mod bandwidth or would it be better to try and write something in modperl. The area is protected by mod rewrite using http_referer. Any thoughts on the subject would be greatly appreciated. Thanks john Michael
Problem with startup file
I'm getting this error while trying to start apache with my perl startup file. ## String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 373, near "carp "stat($start): $!"" (Do you need to predeclare carp?)String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 384, near "carp "opendir($dotdots): $!"" (Do you need to predeclare carp?)String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 389, near "carp "stat($dotdots): $!"" (Do you need to predeclare carp?)String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 403, near "carp "readdir($dotdots): $!"" (Do you need to predeclare carp?)String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 428, near "croak "Cannot chdir to $path: $!"" (Do you need to predeclare croak?)String found where operator expected at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 431, near "croak "Cannot chdir back to $cwd: $!"" (Do you need to predeclare croak?)[Fri Nov 07 22:17:33 2003] [error] syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 373, near "carp "stat($start): $!""!syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 384, near "carp "opendir($dotdots): $!""!syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 389, near "carp "stat($dotdots): $!""!syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 403, near "carp "readdir($dotdots): $!""!syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 428, near "croak "Cannot chdir to $path: $!""!syntax error at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 431, near "croak "Cannot chdir back to $cwd: $!""!BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Cwd.pm line 515.!Compilation failed in require at /usr/lib/perl5/5.8.0/File/Spec/Unix.pm line 8.!BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/File/Spec/Unix.pm line 8.!Compilation failed in require at /usr/lib/perl5/5.8.0/File/Spec.pm line 20.!Compilation failed in require at /usr/lib/perl5/5.8.0/CGI//Carp.pm line 266.!BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/CGI//Carp.pm line 266.!Compilation failed in require at /usr/lib/perl5/5.8.0/CGI.pm line 3.!BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/CGI.pm line 3.!Compilation failed in require at /etc/httpd/conf/perl/startup.pl line 25.!BEGIN failed--compilation aborted at /etc/httpd/conf/perl/startup.pl line 25.!Compilation failed in require at (eval 1) line 1.! # Any help. Thanks John Michael
I got it.
Thanks, But I got it working. JM
Re: Problem with startup file
The problem was caused from trying to use an old modperl startup file on modperl 2.0. Cya JM
connection monitoring
Let me start by saying, I am a self taught programmer and have written modperl scripts to run under apache registry and dabbled with writting my own modperl modules. I want to write a modperl script to monitor connections each remote_ip is making to a certain folder. I want to be able to limit people from downloading more than some number of files at one time. My idea is to keep track of how many connections I have from each ip in a mysql database or maybe in some sort of memory cache. In trying to figure out how to do it, I know that sometimes people will terminate their connection from their browser before the modperl connection handler is able to unlog the connection. Therefore, I could expire old connections, which I will probably have to do anyway to clean up old connections that are left over. But, is there anyway to tell if the user has terminated the download and do a cleanup. i guess if you write it in modperl, you could cleanup in the log phase. IF I write the script in regular perl whcih I am better at and run it under apahe registry, how would I know the connection was terminated. Any ideas on the subject would be greatly appreceiated. Thanks John Michael
connection monitoring
Someone pointed me to checking the connection class for an abort. I found info on this in the modperl cookbook..That seems useful if you want to server your own files, but would take a lot of overhead if you had to continue to check it for a large file. It would not really do me any good to serve the file myself if under modperl I would think anyway I saw some stuff on the apache log handler & cleanup handler in there as well. My question is does the log handler get called only after the file has been completly sent to the browser(at the end). I'm thinking it does, but want to be sure. I do a lot of trial and error. Is that what I have to do to figure this out? John Michael
Re: connection monitoring
But This: if ($h->r->connection->aborted) { would not be called until this $h->r->send_fd($fh); were already through. For a large file, wouldn't that it too late. or would a real aborted connection cause send_fd($fh) to go ahead and stop sending the file. I've been reading through the cookbook and trying to piece this together. Say I want to only allow one coneection per ip to a certain folder. I think I need to create an access handle to determine and monitor whether to allow someone another connection from their ip. Return OK if they are allowed, update a list of some sort showing that the ip does have an active connection. I need to know where to remove the active connection. WOuld I then create a handler to run in the logging phase to remove the the IP from the active connection list. JM - Original Message - From: "Thomas Klausner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 29, 2003 2:19 AM Subject: Re: connection monitoring > Hi! > > On Sat, Nov 29, 2003 at 02:00:18AM -0600, John Michael wrote: > > Someone pointed me to checking the connection class for an abort. I found > > info on this in the modperl cookbook..That seems useful if you want to > > server your own files, but would take a lot of overhead if you had to > > continue to check it for a large file. It would not really do me any good > > to serve the file myself if under modperl I would think anyway > > I'm not really sure I understand completely what you're after, but recently > I had to implement something wich sound similar: Registeres users are > allowed to download a fixed quantity of mp3 files. If they abort the > download, their quota shouldn't be decremented. > > So I did something like this: > > $h->r->send_fd($fh); > > if ($h->r->connection->aborted) { > $h->debug("DOWNLOAD ABBORTED!!"); > > # reset download count > } > > return OK; > > Obviously, I am serving the mp3-files using a mod_perl enabled Apache. > > > > -- > #!/usr/bin/perl http://domm.zsi.at > for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/} > > -- > Reporting bugs: http://perl.apache.org/bugs/ > Mail list info: http://perl.apache.org/maillist/modperl.html > -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
connection monitoring still
I think I may have it. I'm trying to limit users to a certain folder to only 1 connection at a time. I'm going to keep a list of active connections. DO I just write the access handler and at some point in the handler add the cleanuphandler sub handler { # code to check for active connections # code to add ip to active connections list if not already active # if already active return FORBIDDEN else $r->push_handlers(PerlCleanupHandler => \&cleanup); return OK; } sub cleanup { # remove active connections here } Is this correct. John Michael
Once more connection monitoring
>> Be aware of proxies. Many ISPs use proxies, in this situation your are> excluding all people using the same proxy because one of their users is> accessing a directory/file.>I'm not worried about this aspect. I'm going to validate using cookies andcan use cookies along with their ip, user agent, and lang var to come up with a scheme.I'm more worried about whether or not I am on the right track with thissection of code layout. IF i wanted to allow a validated user to download one file at a time from a certain folder sub handler { # validate user first to see if they belong in this area # check and see if this user already has an active connection and is currently downloading a file by maintaining this information in some way(memory cache, flat file, db)don't know or can you poll the active connections on the server or would that take too more resources # if already active return FORBIDDEN else # add user to active connections list if not already active $r->push_handlers(PerlCleanupHandler => \&cleanup); return OK;}sub cleanup { # remove active connections here b/c I won't be called until either the file is through being sent or user terminated connection freeing up services for this user to download another file}Is this correct.John Michael
Re: Persisting data across authenticate <-> authorize ?
Tim Pushor wrote: Hi modperl list First of all, I am so excited to have discovered mod_perl. I have been writing modules in C for a while now, and have been porting an old module that used to work under Apache 1.2 to work on Apache 1.3 and am having trouble for various reasons. I picked up mod_perl and in less time than porting an old (already had been in production) module to a new environment, I have almost completely re-written the module in perl. Oh why didn't I do this sooner ;-) My real question is this: I am writing an authentication / authorization module. For various reasons, the authenticatoin portion determines various things about the user in order to provide succesfull authentication. This information can then be used later, in the authorization module. I would like to cache this information somehow so that the authorization handler doesn't need to perform these operations over. I am already using IPC::Shareable in the authentication handler and would prefer to not use that mechanism. Is there a way to have the data persist across the authenticate/authorize parts of the module? If you are just trying to have data that you set in the authentication be seen in the authorization phase you could just use $r->pnotes(). http://perl.apache.org/docs/1.0/api/Apache.html#_r_E_gt_pnotes___key____value___ -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: site layout
Arshavir Grigorian wrote: Hi, I have a module called Application that pretty much acts as a dispatcher and handles the root URI of my application. The problem is the images that I would like to put under the same URI path, but can't do because I don't know how to return the request back to Apache from Application when the request is for an image. In other words, I would like to have: SetHandler perl-script PerlResponseHandler MCAM::Application and the URI for images be /images/. When Application detects that the request is for anything under /images/, it returns the control to Apache to serve the image, otherwise it displatches the request to the right module. I think adding this would solve the problem: SetHandler default -- Michael Peters Developer Plus Three, LP -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
mod_perl 1.99: sendfile returns empty document
Hi List, we got a strange problem on Apache/2.0.52 (Unix) mod_perl/1.99_18 Perl/v5.8.5. $r->content_type('image/jpeg'); $r->sendfile($docname); returns an empty image (length: 0). The jpg image $docname exists and is readable for apache. Also error handling does not work: If we change $document to a _not_ existing file, then $r->sendfile($docname) || return $err->handle( ... ) will NOT return $err->handle() In this case also my $rc=$r->sendfile($docname); unless ($rc==APR::SUCCESS) { return $err->handle ( ... ); } will not return $err->handle(). Any ideas? Thanks in Advance! Regards, Michael Heidel -- Michael HeidelEUC Online Service GmbH HRB Köln 32038 Geschäftsführer Taubengasse 9 Tel. +49 221 58007-20 <[EMAIL PROTECTED]> D-50676 Köln Fax +49 221 58007-28 Tel.-Durchwahl: -22 Public PgP Key: http://www.euc.de/pgp/mheidel.asc -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp1] Linking confusion
On Thu, 30 Dec 2004, William McKee wrote: > Hi folks, > > I'm trying to recompile Perl and Apache/mod_perl on a Debian Sarge > system using the following versions: > > Perl 5.8.6 > Apache 1.3.33 > mod_perl 1.29 > > I am compiling mod_perl statically (using Apachetoolbox) with the > following options: > > APACHE_PREFIX=/usr/local/apache > APACHE_SRC=/usr/local/src/Apachetoolbox-1.5.72/apache_1.3.33/src > SSL_BASE= > APACI_ARGS='--enable-module=rewrite' > DO_HTTPD=1 > USE_APACI=1 > EVERYTHING=1 > Try... in apache directory make distclean ./configure --with-layout=Apache then in mod perl source directory Run: perl Makefile.PL \ APACHE_SRC=/usr/src/apache/src \ DO_HTTPD=1 \ USE_APACI=1 \ PREP_HTTPD=1 \ EVERYTHING=1 \ make make test # broken ?? make install back in apache directory ./configure --with-layout=Apache \ --activate-module=src/modules/perl/libperl.a make make install > During compilation of mod_perl, I was seeing undefined reference errors > which are nicely described on the install page[1]. The prescription > suggests rebuilding Perl with dynamic linking; apparently the version > that's shipped with Debian is not dynamically linked(?). Sounds fine, > but I'm not a C programmer so am not sure exactly what this means. > > >From what I could find reading the INSTALL document that comes with the > Perl source, I need to recompile with the -Duseshrplib compile-time > option. My understanding is that this option will build a libperl.so > file. Is this correct? Am I taking the right action to build a dynamic > Perl? > > With that option, I am able to compile Apache with mod_perl. Now though, > when starting the newly compiled server, I'm receiving relocation errors > which appear to be due to multiple versions of libperl.so/libperl.a (not > sure which). > > While browsing the net for possible solutions, I came across the > troubleshooting document[2]. It seems to say that if 'perl > -V:useshrplib' returns true, then Perl is statically linked. Is this > correct? It seems opposite of what I'd expect from reading the INSTALL > document. > > I'm pretty much at wits end as to why I'm receiving relocation errors. > The best I can figure is some kind of binary incompatibility between the > version of Perl that I've compiled and previously compiled libraries. > I've tried reinstalling some of the XS modules such as DBI which seems > to clear up these errors. > > Any other suggestions or pointers, esp. in light of the differences > between dynamic and static linking and libperl.so/libperl.a, would be > much appreciated. > > > Thanks, > William > > [1] > http://perl.apache.org/docs/1.0/guide/install.html#Undefined_reference_to__PL_perl_destruct_level_ > [2] > http://perl.apache.org/docs/1.0/guide/troubleshooting.html#_relocation_errors__or__undefined_symbol_ > > -- > Knowmad Services Inc. > http://www.knowmad.com > > -- > Report problems: http://perl.apache.org/bugs/ > Mail list info: http://perl.apache.org/maillist/modperl.html > List etiquette: http://perl.apache.org/maillist/email-etiquette.html > -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: maintaining state between request cycles....
[EMAIL PROTECTED] wrote: Hi, in my application ( the Project XP ) I use mod_perl. but I haven't yet found a good way of maintaining state between request cycles, using hidden fields and cookies. Is there ( I hope ) a better way to store the state of the client/server application between requests other than hidden fields and cookies? HTTP is a state-less environment. Once the server serves the request it forgets about the client. There is no way for the server to positively be able to identify the client on the clients next visit. The only way that state can be maintained is for the client to present some token to the server (either in a cookie, or hidden field, etc) telling the server who it is. I'm pretty sure that there is no way around this. Why does it bother you to use cookies or hidden fields? -- Michael Peters Developer Plus Three, LP
Re: File perms problem
Jason Dixon wrote: Hi folks: Sorry for the noob question on here, but I've never encountered this before. I'm working on a small CGI app using mod_perl, and I'm getting the usual "file permissions deny server execution" error. The odd thing is that this isn't for the CGI script itself, but for every linked file in the "images/" directory! Disabling mod_perl for this Location "fixes" the problem, but I'd rather figure out what is causing this. Why would mod_perl attempt to execute images? SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI FollowSymLinks PerlSendHeader On Because that's what you are telling it to do. SetHandler operates on everything in that Location. In order to have apache do it's normal thing with the images you will need to put them in a separate directory/location. If you decide to put them under the /assetdb, then you will need to tell apache to handle them SetHandler default-handler HTH -- Michael Peters Developer Plus Three, LP
Re: Perl module requiring mod_perl
Patrick LeBoutillier wrote: Hi, I am writing a Perl module the requires mod_perl to run. What I would like to do detect if mod_perl is installed (and the appropriate version) directly from Makefile.PL (PREREQ_PM). just put something like this in PREREQ_PM mod_perl => '1.9916' That will require mod_perl v1.99_16 or later. Regards, Michael Schout
Re: [BENCHMARK] Server Resources
Skylos wrote: Also, to compare, I work with an apache 1.3 site that has alot of cgi perl script on it. With the idea that shifting to mod_perl registry mode would cause this site to go faster, I modified the configuration. And watched the system load average rapidly climb into the multiple-hundreds! Its a tilt of the hat to BSD that it didn't crash right there. But I was able to kill apache (-9 -9 -9!!) and restore the cgi scripts to normal mod_cgi handling. What happened? Memory usage. Each copy of the apache had those big cgi scripts loaded in. And this very busy server had ALOT of processes running simultaneously. Did you preload the those scripts at server start-up? This would change it so that instead of each apache child having it's own copy of each script they would have been placed in shared (copy-on-write) memory. -- Michael Peters Developer Plus Three, LP
Re: CGI::Session or CGI::Application
Octavian Rasnita wrote: Hi, If I want to use CGI::Session or CGI::Application, can I do it if I use mod_perl or there are better modules for using with MP? Just a couple of thoughts: CGI::Session does not appear to be well maintained. It's very popular and I know many people who have tried to send in patches and fixes but the author has been unresponsive. There is also no way to 'guarantee' that no too session will have the same id with CGI::Session, especially in a multi-server environment (eg, load-balanced cluster). Lately I have switched to using Apache::Session (and sometimes wrapping it in an object interface since it's a tied-hash). It's well maintained and you can easily use something like mod_unique_id with Apache to almost absolutely guarantee that each new request will have it's own id and can there use that id when you start a session. On a C::A note, I wonder how hard it would be for Cees to add Apache::Session support to C::A::P::Session. -- Michael Peters Developer Plus Three, LP
Re: CGI::Session or CGI::Application
[EMAIL PROTECTED] wrote: Interesting, your comments on CGI::Session vs Apache::Session as I've had nothing but trouble with Apache::Session::File -- session data inconsistently being written to the file. I'm sorry to hear that. Did you mention those problems to the author or bring it up on the mod_perl list? Were you using just Apache::Session::File or Apache::Session::Flex? I suspect that it was having issues with locking the files so maybe trying another locking mechanism (using Flex) might have helped. But that's just a guess. Several years ago I first tried Apache::Session, but had the problem with data being saved in the session, so tried CGI::Session, which at the time also used a tied hash & everything worked fine (used ::File & ::MySQL, both). Unfortunately, a recent server upgrade forced a CGI::Session module upgrade -- & the newer module had removed the tied hash implementation in favor of an object oriented one. Couldn't find the older module with tied hash implementation anywhere, so quickly changed to using Apache::Session for those sites that were using the session module. The ::MySQL module seems OK, but the ::File module had same problem as before - inconsistent writing of data to the session. So, I had to scramble to re-write code for several sites to implement the 'new' CGI::Session oo implementation. Do you use the Apache::Session::File module or one of the others? Sorry, I only use Apache::Session::MySQL (or Apache::Session::Flex with a store of MySQL). I use MySQL over File because it's *so* fast for primary key lookups. If you have any kind of traffic, I can guarantee that it'll be faster than using a straight file, and since it's not any harder to setup (except creating the table, but then they give you the sql for that) I always go with the faster option :) -- Michael Peters Developer Plus Three, LP
Re: [OSCon 2005] RFC
Philippe M. Chiasson wrote: Here are a few possible talks I could make at OSCon. Feedback would be much appreciated ;-) Presentation: mod_perl 2.0, The Next Generation I would definitely like to see this one. I think I hear the same question all of time. "Why mod_perl 2. What does it do that mod_perl 1 doesn't". Presentation: mod_perl-2.0: Advanced Profiling & Instrumenting Techniques Speaker: Philippe M. Chiasson <[EMAIL PROTECTED]> Duration: 45 minutes Presentation: mod_perl for Speed Freaks! Speaker: Philippe M. Chiasson <[EMAIL PROTECTED]> Duration: 45 minutes I would also be interested in these 2 as well. Do all 3 :) -- Michael Peters Developer Plus Three, LP
Re: duplicating installation on other server
Bart Simpson wrote: I've just had to move to a new developement machine. I built apache2, mp2 and now I'm ready to install the cpan modules i downloaded individually. I don't want to do that again. Is there a faq somewhere that tells best way to do this. I copied old site_perl directory to new machine and it seems to run ok . Is this sufficient or will there be issues? If the machines have the exact same architecture, external libraries, etc than you _might_ be ok. But I would suggest creating a CPAN bundle off the first machine and use that to install. http://cpan.org/misc/cpan-faq.html#How_make_bundle This will also catch the problem of not having some external (to perl) library installed on your system (like GD). -- Michael Peters Developer Plus Three, LP
Re: localized lexical varibles
Vladimir D Belousov wrote: Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':common'; sub handler { my $r=Apache->request; $r->content_type('text/html'); $r->send_http_header; print "Request: ".$r->uri.""; my $s = $r->uri; print "From main: $s"; Call(); return OK; sub Call { print "From Call: $s"; print "But request: ".$r->uri; } } You're creating a closure with $s and $r. Check out http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Understanding_Closuresthe_Easy_Way to understand why this causes strange behavior. You wouldn't normally notice this under normal perl since the interpreter gets reloaded and your scripts get re-compiled on each run. mod_perl doesn't recompile your scripts for each run thus letting you see this behaviour that actually exists in perl itself. The easiest/cleanest workaround is to always pass those kind of shared resources to your subroutines as arguments. -- Michael Peters Developer Plus Three, LP
Re: localized lexical varibles
Vladimir D Belousov wrote: Tom Schindl wrote: Vladimir D Belousov wrote: You are creating a closure here for $s here. There enough material out there go and read about closures(See Apache::Registry). Why do you embed a sub into a sub? I hope this sub will be mmm... "localized subroutine" and all varibles in one will be reinitialized :) I now - it's nonsense :) The variables would get reinitialized if you passed them in as arguments. The link that I sent you explains that once the Call sub is compiled it creates a closure around the $r and $s variables so that even if they are changed in other places, that closure will make sure that Call never sees those changes. By the way, any compilation time errors are found out only at the request to the Apache. But how such code Apache loads? I mean if a code has sintax errors, for example. Or Apache loads code only with first client request? If you preload your modules in a startup.pl or by a PerlLoadModule directive then apache will not start if there are syntax errors. If you don't do that however, you'll have to wait until the first time apache compiles the module, which is normally at request time. A good idea is to preload all of your modules and then use Apache::Reload inside of the modules you are still developing. HTH -- Michael Peters Developer Plus Three, LP
Re: Class::DBI + mod_perl? "Can't locate object method 'search' ...
Mark McWiggins wrote: Hi All, "Plan to throw one away" (see *The Mythical Man-Month* by Brooks), indeed: I've just about finished a more-complex than-I-thought web + database application and then too late thought "gosh, nice if there were something like Hibertnate for Perl." A quick web search led me to Class::DBI, which looks like it will eliminate 75% of the code I just wrote, and good riddance to it since I have to maintain the thing ongoing. It does reduce a lot of code, but as you've seen, it has it's own quirks... Maybe that's why we love it so much :) BUT ... I have a small example working as a standalone Perl script but can't get it going inside mod_perl. I have a startup.pl script running successfully: I don't know if it addresses the specific issue you are having, but there is a wiki page just for running C::D under mod_perl. http://www.class-dbi.com/cgi-bin/wiki/index.cgi?UsingWithModPerl If you aren't having some of these issues now, you soon will be, so at least I have lent a hand on your next problem :) use lib qw(/usr/local/apache2/perl); use Class::DBI; use Class::DBI::Pg; use inforce; 1; And the 'inforce' module is just simply: #!/usr/bin/perl use strict; use base qw(Class::DBI::Pg); __PACKAGE__->set_db(Main => 'dbi:Pg:dbname=etracclass', 'nobody', ''); __PACKAGE__->set_up_table('inforce'); 1; But I can't get my Apache::ASP page to recognize it with any combination of use inforce; with or without the other classes above in 'startup.pl'. I get Can't's locate object method "search" via package 'inforce' ... Obviously this is something simple -- thanks in advance for any guidance whatsoever on this. HTH a little. -- Michael Peters Developer Plus Three, LP
Re: data persistence problem with Class::DBI
Eric W. Bates wrote: > I'm a list newbie; so I apologize if this question has been hashed > before and my google queries were simply badly written. > > We're using Class::DBI in a mod_perl context and all is working quite > well. However, sometimes a CDBI object persists with old data after the > record has been updated. Hitting apache with a 'graceful' fixes it. > > We have separate handlers for displaying and editing the records; so I'm > assuming that the copy of the object used in the display handler is > persisting between accesses in spite of the handler's code > reinstantiating the object with a retrieve(). mod_perl doesn't make your objects persistent unless you create some sort of session and store your objects in it, or you have a problem in your code (closure, global, etc). Besides issues with your code, it can also be database related. Are you using MySQL with InnoDB tables? then it could be your transaction isolation level. You might have a look at the wiki page for some more details on using Class::DBI with mod_perl (sorry it's down at the moment) > > Anybody dealt with this? > > Think it's a feature of Ima::DBI or some other part of Class::DBI? > > Thanks for your time. > > -- > Eric W. Bates > [EMAIL PROTECTED] -- Michael Peters Developer Plus Three, LP
[ANNOUNCE] Apache-AuthCookie 3.07
The uploaded file Apache-AuthCookie-3.07.tar.gz has entered CPAN as file: $CPAN/authors/id/M/MS/MSCHOUT/Apache-AuthCookie-3.07.tar.gz size: 34483 bytes md5: 38672d492c3281893872502f04b4f584 Changes since 3.06: *** mod_perl2 users: THIS RELEASE IS INCOMPATIBLE WITH PAST RELEASES *** If you are running mod_perl2, you must update to at least *** mod_perl 2.0.0 RC5. The mod_perl2 version of AuthCookie has been *** renamed to Apache2::AuthCookie ** MP2: RENAME AuthCookie.pm.mp2 to Apache2::AuthCookie. - MP2: Update module, and tests for mod_perl 2.0.0 RC5. mod_perl2 users MUST use Apache2::AuthCookie now. - Require Apache::Test 1.22 - Add support for ${auth_name}SessionTimeout configuration paramter which will re-issue the ticket with the expires parameter set to the value of this configuration setting for each request. This is useful for idle-timeout. - POD fixes. - MP2: fix uninitialized warnings if no POST/GET data (RT 11371) - make sure recognize_user() returns an Apache constant in all cases. Returns DECLINED in cases where we were returning undef before. (Thanks Vivek) - Add support for MS HttpOnly cookie property. Please report any bugs to [EMAIL PROTECTED]
Re: ticketing solutions
Dan Brian wrote: > My point was that I don't need a CPAN module to verify hashes. Features > could include a mechanism for rotating a key on the servers being > accessed, IP verification ... and other features I can't think of. :-) Apache::AuthTicket does ip verification. Not sure what you mean by "key rotation", but AuthTicket allows you to change the "secret" key in the database periodically. These are used to verify that the ticket has not been tampered with. You can have multiple "secret" keys active at the same time, allowing tickets just issued on the previous key to expire before you remove it from the database. So, for example, you can issue new "secret" keys every 2 hours, and delete all secret keys more than 6 hours old at the same time. AuthTicket will always issue new tickets using the most recent secret key. Not sure if this is the type of thing you are referring to, or if you are looking for something else :). Regards, Michael Schout
Re: ticketing solutions
Dan Brian wrote: > What are people using to do authentication ticketing from mp? Nothing > jumps out of CPAN at me, mostly because what I've seen just makes md5's > out of username/password/expiration. Any recommendations? My Apache::AuthTicket module implements a ticketing system similar to that in the Eagle book. Unfortunatly it is MP1 only at this time. I am working hard to port it over to MP2 RC5. Hoping to have something released over the weekend if I get some free time :). If you are looking for a non-perl implementation, this may help you: http://www.openfusion.com.au/labs/mod_auth_tkt/ However, its only for apache 1.x apparently. Regards, Michael Schout
reading post data.
I am wondering what the best way is to read POST data under MP2. In MP1, I was using $r->content for this. In MP2, $r->content does not exist, so I used the version from an earlier copy of Apache::compat, which was using $r->get_client_block() instead. Now, get_client_block() is apparently deprecated, and I am left with the choice of: 1) using $r->read(). CGI.pm apparently does it this way. 2) Use APR::Brigade. Apache2::compat from 2.0.0 RC5 does provides content() this way. 3) some other way that I do not know about :). I am unclear what the advantages are for either approach. The APR::Brigade docs do not really clarify this for me. Does anyone know which of these methods is better and why? Regards, Michael Schout
Re: compiling perl on freebsd to support ithreads
Foo Ji-Haw wrote: > Hello Philip, > > You are suggesting that FBSD 4.x is not easy to compile ithreads via > ports. I wonder why FBSD even on 5.x does not come with ithreads > precompiled (Linux does!). But I find it quite a deterent to use FBSD > for multiple apps in the future. One of the biggest complaints I hear (and voice) is that the linux distros ship a perl with ithreads. It's slower and almost noone wants or needs it. It looks like FBSD is doing what the majority of people want it to do, so I wouldn't knock it :) -- Michael Peters Developer Plus Three, LP
Re: compile mod_perl with Apache::DBI support
jiesheng zhang wrote: > By this configuration, without the "use Apache::DBI ();" and with > "$Apache::DBI::DEBUG=1" in the startup.pl, I could not see the debug > output in the error log. looks like you hit it on the head. If you don't have $Apache::DBI::DEBUG=1 in your startup, then you wont see anything in the errorlog. from the doc: "To enable debugging the variable $Apache::DBI::DEBUG must be set. This can either be done in startup.pl or in the user script." -- Michael Peters Developer Plus Three, LP
Re: Apache::Session::Store::Postgres FOR UPDATE problems [OT]
Jeffrey W. Baker wrote: > It is possible that the FOR UPDATE is spurious. It signals to the > database system that this transaction intends to write that row. With > PostgreSQL's MVCC transaction isolation system, it's probably not > necessary and may be causing problems. It definately *is* necessary if you want to ensure that only one process has access to your session data at a time. MVCC will prevent a second client from WRITING to the same row, but it will not block it from reading the row. In other words, MVCC will not prevent the following scenario: client 1: SELECT * FROM sessions WHERE id='1'; client 2: SELECT * FROM sessions WHERE id='1'; # at this point, client 1 and client 2 both have copies of the session. suppose client 1 makes changes to the session data and saves it: client 1: UPDATE sessions SET data='...' WHERE id='1'; now suppose client 2 makes changes: client 2: UPDATE sessions SET data='...' WHERE id='1'; Whoops, you just wiped out the changes that client 1 made! FOR UPDATE prevents this because it tells the database that you intend to change the row. The database will not let anyone else select that row FOR UPDATE until you either issue a COMMIT or ROLLBACK. So in otherwords: client 1: SELECT * FROM sessions WHERE id='1' FOR UPDATE; client 2: SELECT * FROM sessions WHERE id='1' FOR UPDATE; at this point, client 2 will block until client 1 either does COMMIT or ROLLBACK. So if you want to ensure that only one client has the session data at a time, you need FOR UPDATE. Regards, Michael Schout
Re: Newline and tab escaping in Apache's error_log
Sam Tregar wrote: > Hello all. Does anyone know why Apache (v1.3.33) is escaping newlines > and tabs in my error logs? I'm seeing stuff like: > >[Thu Jun 2 18:54:18 2005] [error] Error executing run mode 'process': >Unable to find message named 'city_missing' in messages.conf. at >/home/sam/projectx/lib/Projectx/Message.pm line >131\n\tProjectx::Message::add_message('city_missing') called at >/home/sam/projectx/lib/Projectx/Form.pm line >183\n\tProjectx::Form::_errs_to_messages('Arc.. > > That can get pretty unreadable for dead stack traces. Any idea how to > turn it off? It's a fairly recent change to apache since some characters could cause problems for some text viewers thus creating a security hole (if your text reader isnt smart enough). You can turn it off by building apache like so: CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED" ./configure make ... -- Michael Peters Developer Plus Three, LP
[ANNOUNCE] Apache::AuthTicket 0.40
The uploaded file Apache-AuthTicket-0.40.tar.gz has entered CPAN as file: $CPAN/authors/id/M/MS/MSCHOUT/Apache-AuthTicket-0.40.tar.gz size: 20346 bytes md5: a1d0a5650b9deae181effb977c8d71a8 No action is required on your part Request entered by: MSCHOUT (Michael Schout) Request entered on: Mon, 06 Jun 2005 20:14:12 GMT Request completed: Mon, 06 Jun 2005 20:14:39 GMT - Changes since 0.31: o update to use new Apache::Filter API (you need at least 1.012 now) o Create Apache2::AuthTicket from copy of Apache::AuthTicket and ported to mod_perl 2.0 API. This is the first release that supports mod_perl2 o MP2 - use SQL::Abstract to generate queries
Re: Any way for a PerlHandler to know what Location block it's in?
John Siracusa wrote: > Confusing subject, simple question: > > > PerlSetVar MyRoot "/foo/bar" > SetHandler perl-script > PerlHandler MyModule > > > MyModule calls $r->dir_config('MyRoot') to get the "/foo/bar" path. > > I want to ditch the "PerlSetVar MyRoot" line because it will always have > the same value as the "Location" directiv above it. Is there a way MyModule > can get "/foo/bar" using some other means? I feel almost silly saying this, but did you look at $r->location? http://perl.apache.org/docs/1.0/api/Apache.html#_r_E_gt_location -- Michael Peters Developer Plus Three, LP
Re: Help (Desperate) - Install Bundle::Apache2 catastrophic
Thomas Hilbig wrote: > Sorry, httpd is 2.0.52 and not 2.0.54 (sorry, panic). > > My whole site is Perl CGI based using ModPerl2 for > performance, using Perl CGI library for requests and > not the pure Apache requests. It's always worked up > until loading the Bundle::Apache2 package. I wanted > to load the Apache2 API for some ModPerl handler > writing. > > Most common CGI errors are: > > Can't locate object method "register_cleanup" via This error comes from the fact that register_cleanup() is now cleanup_register() and is in the APR::Pool package, so you need to use APR::Pool (); But, since CGI.pm is throwing these errors, I'd say it's because you haven't upgraded it. What version of CGI.pm are you running? It needs to be at version 3.10 for complete compatibility with mod_perl2. -- Michael Peters Developer Plus Three, LP
module requires either Apache::Foo or Apache2::Foo
Hello all, I have a module that can be run either under mod_perl 1 and 2. This works great when running and testing using Apache-Test, but the bit I'm having problems with is the install. For it to run properly it needs either Apache::Constants or Apache2::Const. This is easy enough to figure out which one to pick at run time (or compile time) but I can't figure out a good way to do this at build time using either M::B or EU::MM so that the appropriate prerequs are followed or at least complained about. I thought about just putting them into the 'recommends' of Module::Build and then just letting the end user dork around with it, but this seems like a very unfriendly approach. As a side note, I know I can split it up into 2 different distributions using the 'Apache' and 'Apache2' names, but I really don't want to do that since 99% or the modules code is the same regardless of the platform. -- Michael Peters Developer Plus Three, LP
Re: Eagle book RandPicture.pm, $r->internal_redirect, and IE 6.0 showing same image every time
David Christensen wrote: Thank you everyone for your thoughts and help. :-) Geoffrey Young wrote: $r->no_cache(1) ... no_cache() should work (or at least it has for me in the past when IE has given me similar headaches). [EMAIL PROTECTED]:~$ wget -s -nv http://192.168.254.3/random/picture 16:41:15 URL:http://192.168.254.3/random/picture [20831/20831] -> "picture.3" [1] [EMAIL PROTECTED]:~$ head -n 12 picture.3 HTTP/1.1 200 OK Date: Fri, 01 Jul 2005 23:40:47 GMT Server: Apache/1.3.33 (Debian GNU/Linux) mod_perl/1.29 Last-Modified: Wed, 04 Jun 2003 06:53:10 GMT ETag: "1064b-515f-3edd9756;42c4b3fd" Accept-Ranges: bytes Content-Length: 20831 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: image/jpeg Expires: Fri, 01 Jul 2005 23:40:47 GMT That's odd. no_cache should not be sending the 'Expires' header. Instead it uses the more forceful 'Pragma: no-cache' and 'Cache-control: no-cache'. These are not showing up in your headers. The only thing I can think of is that no_cache(1) is not being executed? -- Michael Peters Developer Plus Three, LP
Re: module requires either Apache::Foo or Apache2::Foo
Geoffrey Young wrote: Michael Peters wrote: Hello all, I have a module that can be run either under mod_perl 1 and 2. This works great when running and testing using Apache-Test, but the bit I'm having problems with is the install. For it to run properly it needs either Apache::Constants or Apache2::Const. This is easy enough to figure out which one to pick at run time (or compile time) but I can't figure out a good way to do this at build time using either M::B or EU::MM so that the appropriate prerequs are followed or at least complained about. see some of stas' modules on cpan - Apache::Peek comes to mind. IIRC they support both mp1 and mp2 and have some kind of dynamic build-time checking code in Makefile.PL Thanks, I'll look into those. as a community we really ought to figure out the "right" way to do this and abstract it into something everyone can just cut-and-paste. or, better, include it as a package in both mp1 and mp2. I think the "best" way might be to look to Apache::Test. Figuring out which one to use at run time is easy and well documented but the install/testing time is the tricky bit. I don't know if it's currently available, but is there a way to query Apache::Test to find out which version of mod_perl it will run against (since A::T figures this out when it's installed right)? -- Michael Peters Developer Plus Three, LP
Re: module requires either Apache::Foo or Apache2::Foo
Geoffrey Young wrote: >>>as a community we really ought to figure out the "right" way to do this >>>and abstract it into something everyone can just cut-and-paste. or, >>>better, include it as a package in both mp1 and mp2. >> >> >>I think the "best" way might be to look to Apache::Test. Figuring out >>which one to use at run time is easy and well documented but the >>install/testing time is the tricky bit. I don't know if it's currently >>available, but is there a way to query Apache::Test to find out which >>version of mod_perl it will run against (since A::T figures this out >>when it's installed right)? > > > well, kinda. > > what Apache-Test does is cache the data you entered when you ran 'make > test'. for example, if you built Apache-Test as > > $ perl Makefile.PL -apxs /my/httpd-2.1-binary > > then A-T would never again ask you "what httpd do you want to use?" when, > say, a CPAN module uses A-T for its tests and the user forgets to specify > -apxs. of course, insert -httpd, APACHE_TEST_HTTPD, etc for -apxs. > > now, I've always maintained that this is a very bad idea whose > implementation is still the source of the occasional frustrated user > (besides myself), but I won't go into that here :) but I think it's even > worse for what you're after. > > what we all want is a way for 'perl Makefile.PL' to know whether it's being > built against mp1 or mp2 for the (rare) module that cares at build-time. a > good example is for directive handlers, which are 100% runtime for mp2 but > require build-time XS-fu for mp1. if a user has mp1 and mp2 on the same > box, A-T will likely come from mp2 which would cause build-time inspection > of A-T libraries to fail for mp1 installs if we chose the A-T route. worse, > there will be no clear path for a confused user to follow when things don't > go as they wish ("what does Apache-Test have to do with where Apache::Foo > from CPAN installs?"). I would argue that there is another case that is not as rare; dependencies. If a user tries to install my module via CPAN I would like it to be able to determine what other things need to be tracked down. And these dependencies may be different depending on the target mod_perl API version. > it also assumes that your mp1 user will actually have A-T installed. next > time we get together I'll need to rant a bit about how I can't stand modules > that refuse to _build_ because my @INC lack things they need only for their > _test_ environment. Oh, I completely agree. I like M::B's idea of 'build_requires' and it would be nice if it also had a 'test_requires' as well. > in short, using a test-environment variable to affect build or runtime > environments breaks all sorts rules, if only those that I've made up and > believe in myself :) > > that said, my personal preference would be a ModPerl::MM library that was > distributed with both mp1 _and_ mp2. modules that are mp2-based could > enforce mp2 via what they should already be doing: > > ModPerl::MM::WriteMakefile(NAME => 'My::MP2::Foo'); > > modules that are both mp1 and mp2 but need to know at build-time should be > able to do something as simple as > > my $version = ModPerl::MM::Query::version_query(); > > before the call to WriteMakfile(), which would launch an interactive > dialogue saying something like > > this module can be installed for either mod_perl 1.0 or mod_perl 2.0 > but you need to choose now: [1/2] > > and then leave you do do what you require. Ooohhh, that would be nice :) > mp1-only modules or modules that require no build-time interaction could > simply forget about querying all together. > > anyway, IIRC dorian has done some work on this front. probably not like > what I've just described, but he's done _something_ which is a start :) I don't have a lot of time right now to help, but if he has any ideas or something that partially works, I'd be willing to be a sounding/testing board. > of course, there's nothing preventing you from using Apache::TestConfigData > etc now yourself. however, I don't think that is a viable or wise long-term > solution to the issue at hand. I think you convinced me of how bad an idea this is, so I turn my head and walk the other way :) -- Michael Peters Developer Plus Three, LP
Re: Problems with DBI & modperl on Irix 6.5
Robert Aspinall wrote: > Hello, > > I'm running modperl 1.29 on Apache 1.3.31 with Perl 5.8.2, running on > Irix 6.5.25m. > > When I try to use the Apache::DBI module, I get the following > > > Can't load > '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for > module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal > Error: unresolvable symbol in > /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: > PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm > line 229.\n at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line > 252\nBEGIN failed--compilation aborted at > /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252. > Compilation failed in require at > /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. > BEGIN failed--compilation aborted at > /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. Do you have DBI successfully installed? Are you using the latest version of Apache::DBI (0.94)? I know that they are currently working on the next release, but I think all of the issues in that case are with mod_perl2 so they shouldn't affect what you're trying to do. -- Michael Peters Developer Plus Three, LP
Re: Apache::Test too late for PerlSwitches
Thomas Nagel wrote: >>yeah. and that directive launches the interpreter, thus the collision. >> >>as stas suggested, extra.last.conf.in is the answer in this case. > > > Cool && thanx, it now works as expected. > > Maybe there should be a word of warning added to the Testing document > for similar cases (unless I overread it of course ;-) A list of directives that launch the interpreter would be pretty cool :) -- Michael Peters Developer Plus Three, LP
Re: Apache::Test too late for PerlSwitches
Geoffrey Young wrote: > > Michael Peters wrote: > >>Thomas Nagel wrote: >> >> >>>>yeah. and that directive launches the interpreter, thus the collision. >>>> >>>>as stas suggested, extra.last.conf.in is the answer in this case. >>> >>> >>>Cool && thanx, it now works as expected. >>> >>>Maybe there should be a word of warning added to the Testing document >>>for similar cases (unless I overread it of course ;-) > > > probably. patches welcome :) Along this lines, I was going to prepare a patch to make this a clearer but I couldn't find where extra.last.conf.in was documented (since I thought this would be a good place to explain what you might put into it). I search perl.apache.org and while there are several mentions of "extra.conf.in" I couldn't find any for "extra.last.conf.in". -- Michael Peters Developer Plus Three, LP
Re: Apache::Test too late for PerlSwitches
Geoffrey Young wrote: >>>>>Maybe there should be a word of warning added to the Testing document >>>>>for similar cases (unless I overread it of course ;-) >>> >>> >>>probably. patches welcome :) >> >> >>Along this lines, I was going to prepare a patch to make this a clearer >>but I couldn't find where extra.last.conf.in was documented (since I >>thought this would be a good place to explain what you might put into >>it). I search perl.apache.org and while there are several mentions of >>"extra.conf.in" I couldn't find any for "extra.last.conf.in". > > > hmm, maybe it isn't documented there, then. I know I wrote about it in an > article I did for perl.com Turns out it was documented, but not as "extra.last.conf.in" but rather as anything that matches "/\.last\.(conf|pl).in$/". But regardless, here is a patch that tries to make things a little clearer. -- Michael Peters Developer Plus Three, LP --- testing.pod.orig 2005-07-11 14:07:25.0 -0400 +++ testing.pod 2005-07-11 14:07:01.0 -0400 @@ -1237,7 +1237,11 @@ /\.last\.(conf|pl).in$/ -will be included very last in F. +will be included very last in F. This is especially useful +if you want to include Apache directives that would need a running Perl +interpreter (see L) +without conflicting with Apache::Test's use of +C>. Make sure that you don't try to create F, it is not going to work, since F is already generated by @@ -1284,11 +1288,20 @@ =item * +if the file F exists, it will be used to +generate F with C<@variable@> substitutions. + +=item * + if the file F exists, it will be included by F. =item * +if the file F exists, it will be included by +F after the F file. +=item * + if the file F exists, it will be included by F as a mod_perl file (PerlRequire).
Re: initializing global data structures from a db
John Saylor wrote: > hi > > i have a problem with initializing perl data structures from the db. i > have an init routine that does all kinds of stuff and is called from > startup.pl. one of the things i wanted it to do was to grab some stuff > from the db and populate a hash with it. > one way that has been suggested is to tie the data structures to > subroutines to do the work of getting the data from the db on their > first call. That's probably not the best approach, but it really depends on how often this data is used, how big it is and how often it changes. If it's used a lot and isn't really large and rarely changes I would preload at server startup. That way you only need to touch the db once and all of your apache children will have reduced memory (since they will all share it until it's changed) because of Copy-On-Write memory (if your system has that). -- Michael Peters Developer Plus Three, LP
Re: Apache::AuthCookie Setup
Paul D. Kraus wrote: > I installed apache::authcookie from apt on debian and I can not find any > of the files that the docs mention under examples. real.t doesn't exist > and the "testing" suite is also non-existent. Sounds like your package does not include these files from the official distribution. Download the official distribution from CPAN at: http://search.cpan.org/~mschout/Apache-AuthCookie-3.08/ The POD docs explain the httpd.conf settings, and there is a complete working system written for the test environment. See t/conf/extra.conf.in, t/lib/Sample/AuthCookieHandler.* Regards, Michael Schout (AuthCookie maintainer)
Re: debugging 'server closed the connection unexpectedly' from PostgreSQL 8.0
Mark Stosberg wrote: > 2. In a couple related modules we a construct like: "our $DBH = > DBI->connect()". > We don't do that elsewhere in the application. With some effort we could > refactor the code to get rid of this. I tried switching to "local our", > but I got a test failure. (Although I didn't get to the bottom of why > that test failed before reverting). I don't know if this is the root of you problems, but this seems like a bad idea anyway. Depending on how you do this and where, ff you preload this module it will open the db connection at server startup (which isn't bad in and of itself). That handle will have to be closed after startup is done. DB handles opened before the children are forked cannot be used after the fork. > Usually we pass the handle around through the CGI::Application object, > and that works fine. This seems like the better approach. > I'm interested to know: Does it seem like I am even looking in the right > place to troubleshoot this? General suggestions? Is this a Pg or Apacahe error? Are you using Apache::DBI? You might be ablet to reproduce the problem in your QA env if you run the server in single process mode. This will make it easier to simulate all of the children getting hit and serving requests. -- Michael Peters Developer Plus Three, LP
Re: survey
Octavian Rasnita wrote: > What do you think, why the number of hosts which use mod_perl is decreasing > continuously as the following survey shows? > > http://perl.apache.org/outstanding/stats/netcraft.html Just a guess, but I think it might be related to the fact that some servers moved to Apache2, but mod_perl2 was not officially released until a few short months ago. I know a lot of people were using it before it became official released, but many were avoiding it. -- Michael Peters Developer Plus Three, LP
Re: memory resident config hash
Octavian Rasnita wrote: > Hi, > > I have a config file which contains a hash ref and I get its values by using > the do() function. > > I don't think this is the best solution, because the speed might be slow. > That file is accessed on each access to each page. > > Is it possible to store that hash in the memory somehow? Just put it into it's own package and preload it. As long as you don't change the data it'll stay shared. package MyConfig; our %DATA = ( ... ); 1; Then reference it anywhere as MyConfig::DATA{foo}; HTH -- Michael Peters Developer Plus Three, LP
Re: memory resident config hash
Octavian Rasnita wrote: > Thank you, I have done so, but I still have a problem. > > I used to run those config files using do() for getting the data based on a > variable, for example: > > my $ref = do("$language.ini"); > > And depending on the value of the $language variable, it is launched a > different .ini file. If these are just .ini files, then why don't you use something like Config::Simple to create a object from which to read the data. You could then create a wrapper class that would give access to this object as a singleton. Load the class on server startup and initialize the object there too. As long as you don't change the data it should be stay shared by all of your apache children. > I don't know how to get the variable from a module if I know the name of > that module only at runtime. > > I have tried: > > my $module = "Teddy::ModuleName"; > eval "require $module"; Once you do a 'require' in a process the data is no longer shared between processes. Another request that needs the same configuration data that is handled by a different apache process will need to do the same 'require' thus increasing it's unshared memory, etc. Sometimes this is necessary, but it should be avoided if possible. How many of these language specific configs do you have? Do you know which ones are more likely to be used? If you do then preload as many as possible ahead of time. > But now I don't know how to get the value of $content variable from > Test::ModuleName. > > I know that I can get it using $Teddy::ModuleName::content, but I know the > name of that module only at runtime. > > I have tried $module::content, but it doesn't work. > > Please advice how I can do that. I was trying to get this to work with a hash as the package data, but for some reason it didn't work. But perlref show how to do it with a hashref. my $DATA = $MyConfig::DATA; my $package = $DATA->{'lang_config'}; eval "require $package"; my $LANG_DATA; { no strict 'refs'; $LANG_DATA = ${"${package}::DATA"}; } ==MyConfig= package MyConfig; our $DATA = { other => 'MyConfig::Other', }; 1; =MyConfig::Other=== package MyConfig::Other; our $DATA = { foo => 'more stuff', }; -- Michael Peters Developer Plus Three, LP
Re: Suggestions for creating an archive
Perrin Harkins wrote: > On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote: > >>Do you mean a redirect to a completely separate handler or cgi? > > > I mean a standard redirect to a normal .zip file, which you let apache > serve for you like any other file. Then you clear these out > periodically with a cron job. > > >>So I guess the question is there a way define a name for the >>download? > > > There is a way to do it, defined as part of HTTP or MIME -- I can't > quite remember. If you do an external redirect you won't have to bother > figuring it out. If you are generating your own content headers you use the Content-Disposition header. Something like: $r->header_out( 'Content-Disposition' => 'inline; filename=my_cool_stuff.zip' ); -- Michael Peters Developer Plus Three, LP
Re: a faster html::template?
Praveen Ray wrote: > Here is a very very simple script comparing three > approaches to build a large html table. would you mind sending this script as an attachment. Email clients tend to garble... Thanks -- Michael Peters Developer Plus Three, LP
FIXED -- [Fwd: Cannot build static mod_perl 2.0.1 / Apache 2.0.54 on Solaris 9]
Hi, This has been fixed. Thank you very much to Cory Omand who pointed me to http://www.blastwave.org where Solaris builds for lots of applications are already available. Best regards, Michael Original Message Subject:Cannot build static mod_perl 2.0.1 / Apache 2.0.54 on Solaris 9 Date: Fri, 09 Sep 2005 16:27:05 +0200 From: Michael FOURNEAU - Sun Proactive Services <[EMAIL PROTECTED]> Organization: Sun Microsystems Belgium / Luxembourg To: modperl@perl.apache.org Hi, I'm not subscribed to this mailing list, so please respond to me... and actually, I'm not a developer... In order to install AxKit, since a few days, I'm still unsuccessfully trying to configure mod_perl 2.0.1 with the following environment : Solaris 9 (KJP 117171-17) / PERL 5.8.7 / Apache 2.0.54 / make=/usr/ccs/bin/make * PERL was successfully built with the following options : ./configure -des -Dusethreads -Dcc="gcc -B /usr/ccs/bin" * Bundle::Apache2 was added within CPAN. * I tried to configure a static mod_perl in Apache with the following options : perl Makefile.PL MP_USE_STATIC=1 \ MP_AP_PREFIX=/usr/src/apache/httpd-2.0.54 \ MP_AP_CONFIGURE="--with-mpm=prefork" * Although the previous command successfully ended, make ends with the following messages : Perl_Tstack_max_ptr /usr/share/src/mod_perl/mod_perl-2.0.1/src/modules/perl/mod_perl.a(modperl_callback.o) ld: fatal: Symbol referencing errors. No output written to .libs/httpd collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `httpd' Current working directory /usr/share/src/apache/httpd-2.0.54 *** Error code 1 make: Fatal error: Command failed for target `all-recursive' Current working directory /usr/share/src/apache/httpd-2.0.54 *** Error code 1 make: Fatal error: Command failed for target `ap_build' Thru perl.apache.org and Google, I can't figure out what those messages mean... * Apache 2.0.54 alone can successfully install with the following option : ./configure --with-mpm=prefork I can't find any further references to help me on this. Any idea about what could be wrong ? Thanks beforehand, Michael = Apache 2.0.54 configuration options = # ./httpd -V Server version: Apache/2.0.54 Server built: Sep 8 2005 23:10:28 Server's Module Magic Number: 20020903:9 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_FCNTL_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/usr/local/apache2" -D SUEXEC_BIN="/usr/local/apache2/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" = PERL 5.8.7 configuration options = # perl -V Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=solaris, osvers=2.9, archname=sun4-solaris-thread-multi uname='sunos proactive 5.9 generic_117171-17 sun4u sparc sunw,ultra-enterprise ' config_args='-des -Dusethreads -Dcc=gcc -B /usr/ccs/bin' 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 -B /usr/ccs/bin', ccflags ='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='3.3.2', gccosandvers='solaris2.9' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc -B /usr/ccs/bin', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lpthread -lc perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_d