Re: Trouble compiling mod_perl
On Thu, 27 Apr 2000, Jean-Sebastien Morisset wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I first tried to compile mod_perl-1.22 using APXS, but whenever I would load the module, the Apache child would die. Here's the command line I used: perl Makefile.PL NO_HTTPD=1 EVERYTHING=1 WITH_APXS=/opt/apache-1.3.12/bin/apxs USE_APXS=1 your perl -V might help spot the problem. as would a stacktrace (see SUPPORT for hints) I then tried to compile mod_perl with Apache (not shared). When I do, the make fails. Here's the mod_perl config I used: try using the steps in INSTALL.simple.mod_ssl instead.
Re: php And Apache::ASP
On Thu, 27 Apr 2000, Jerrad Pierce wrote: [Thu Apr 27 06:14:07 2000] [error] [asp] [2726] cannot load Apache::Symbol for UndefRoutine: Can't locate Devel/Symdump.pm in @INC (@INC contains: why does Apache::ASP use Apache::Symbol::undef? that hack should be obsolete, as it was only need to avoid the mandatory 'constant subroutine redefined' warning, which went away in Perl 5.005
Re: Install probs.
On Fri, 28 Apr 2000, Dominic Blythe wrote: please reply to [EMAIL PROTECTED] as i'm not on the list... on Corel Linux (which is Debian slink)... I'm compiling mod_perl into apache 1.3.xx (19 i think) and all the mod_perl make, make install goes ok. APACI ./configure is fine too, but when i make apache, I get about a page of complaints about mod_perl, mostly of the format "Undefined reference to mod_perl_some_function_name in mod_perl.c" and it won't make. make and make test on mod_perl both complained about libwww missing, but all the install notes said this isn't absolutely required. without the activate-module=src/modules/perl/mod_perl.c apache completed make install with no probs (well it runs anyway) you're missing a step, but it's impossible to say which without details. try using the steps in INSTALL.simple
Re: Help - Install mod_perl-1.23
On Fri, 28 Apr 2000, James Xie wrote: Helllo, I recently downloaded Apache_1.3.12 and installed it on Redhat 6.1, everything was working fine. I run into problems when I tried to install mod_perl-1.23. Everything was compiled ok, but I got error messages (see below) when I try to run the make test. I'm new to both Apache and mod_perl, thank you for your help in advance. still waiting for server to warm up...not ok hmm, what happens if you run: % make start_httpd % GET http://localhost:8529/perl/perl-status % make kill_httpd ? you can also get more details on why apache isn't reponding like so: % make start_httpd % strace -f -s1024 -o strace.out -p `cat t/logs/httpd.pid` % make run_tests % make kill_httpd have a look at strace.out
Re: PerlAddVar ?
On Mon, 1 May 2000, Matt Sergeant wrote: It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) you could implement that with a directive handler, that uses $r-dir_config-add at request time. though, it would be simple to add to mod_perl. patch below compiles, but i haven't tested. then your script can have: my @values = $r-dir_config-get('Fred'); Index: src/modules/perl/mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.116 diff -u -r1.116 mod_perl.c --- src/modules/perl/mod_perl.c 2000/04/13 06:07:33 1.116 +++ src/modules/perl/mod_perl.c 2000/05/04 05:56:48 @@ -126,6 +126,9 @@ { "PerlSetVar", (crft) perl_cmd_var, NULL, OR_ALL, TAKE2, "Perl config var and value" }, +{ "PerlAddVar", (crft) perl_cmd_var, + (void*)1, + OR_ALL, TAKE2, "Perl config var and value" }, { "PerlSetEnv", (crft) perl_cmd_setenv, NULL, OR_ALL, TAKE2, "Perl %ENV key and value" }, Index: src/modules/perl/perl_config.c === RCS file: /home/cvs/modperl/src/modules/perl/perl_config.c,v retrieving revision 1.95 diff -u -r1.95 perl_config.c --- src/modules/perl/perl_config.c 2000/05/04 04:52:34 1.95 +++ src/modules/perl/perl_config.c 2000/05/04 05:56:51 @@ -729,11 +729,21 @@ MP_TRACE_d(fprintf(stderr, "perl_cmd_var: '%s' = '%s'\n", key, val)); if (cmd-path) { perl_dir_config *rec = (perl_dir_config *) config; -table_set(rec-vars, key, val); +if (cmd-info) { +table_add(rec-vars, key, val); +} +else { +table_set(rec-vars, key, val); +} } else { dPSRV(cmd-server); -table_set(cls-vars, key, val); +if (cmd-info) { +table_add(cls-vars, key, val); +} +else { +table_set(cls-vars, key, val); +} } return NULL; }
Re: PerlAddVar ?
On Mon, 1 May 2000, Stas Bekman wrote: That [the name] would be confusing. How about: not if you think of it in terms of an apache table: PerlSetVar = ap_table_set PerlAddVar = ap_table_add
Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12
can you see if this patch fixes the problem? make sure you let mod_perl build httpd and pass USE_APACI=1 to Makefile.PL --- Makefile.PL 2000/04/21 06:24:27 1.158 +++ Makefile.PL 2000/04/27 22:45:30 1.160 @@ -186,7 +186,7 @@ $PERL_DEBUG = ""; $PERL_DESTRUCT_LEVEL = ""; $PERL_STATIC_EXTS = ""; -$PERL_EXTRA_CFLAGS = ""; +$PERL_EXTRA_CFLAGS = $] = 5.006 ? $Config{ccflags} : ""; $SSLCacheServerPort = 8539; $SSL_BASE = ""; $Port = $ENV{HTTP_PORT} || 8529;
Re: -DPERL_NO_GET_CONTEXT horks everything
i hate to see you suffer this pain, when the proper fix was posted to p5p on friday (see patches/no_get_context.pat) and modperl-2.0/00README_FIRST no longer suggests building Perl with -DPERL_NO_GET_CONTEXT "cvs up early, cvs up often"
Re: Deep recursion on subroutine Apache::Constants::AUTOLOAD
On Fri, 21 Apr 2000, Martin Lichtin wrote: Anyone understand why perl -we 'use Apache::Constants; Apache::Constants::OK();' causes this problem? what version of mod_perl are you using? from the command line you should get this error: % perl -we 'use Apache::Constants; Apache::Constants::OK();' Undefined subroutine Apache::Constants::OK called at -e line 1. you can't use Apache::Constants outside of httpd.
Re: PerlHandler stopped working???
On Sat, 22 Apr 2000, Matt Sergeant wrote: On Sat, 22 Apr 2000, Matt Sergeant wrote: The only thing I can think of, is that Apache::MimeXML is somehow stopping the PerlHandler phase from being executed. Can it do that (but still allow the PerlFixupHandler phase to execute)??? OK, it was Apache::MimeXML... Which is very odd indeed. A bug in mod_perl by the looks of things. All I'm returning from Apache::MimeXML, btw, is OK or DECLINED. It was returning OK when PerlHandler stopped working. For now I'll disable it, and set Mime types manually for .xml files - but something is seriously not right there. as i already explained to matt in another email, if a TypeHandler returns OK, then mod_mime's type handler is not called. which means that SetHandler, AddType, etc., for that require will be ignored, unless you return DECLINED or implement them yourself (see Apache::MIME in ch8 of the eagle book)
Re: httpd could not be started
On Sat, 22 Apr 2000 [EMAIL PROTECTED] wrote: I am trying to build httpd using DSO and mod_perl, mod_ssl and mod_php (but that one hasn't come up yet) I'm on an unpatched RedHat 6.1 with a newly built 5.6.0 perl (egcs 2.91.66) with mod_perl from CVS and mod_ssl-2.6.3-1.3.12 for apache_1.3.12 what version of mod_perl are you using? did 'make test' pass? the server might be core dumping, if you could follow the hints in the SUPPORT doc for getting a stacktrace, we should be able to figure out why.
Re: httpd could not be started
On Sat, 22 Apr 2000 [EMAIL PROTECTED] wrote: It's a much simpler problem than I let on to before... (thanks matt@telepath) whoops, disregard my last message then. The error log shows what went wrong, but I am at a bit of a loss on how to correct it. [info] mod_unique_id: using ip addr my.valid.ip.address getpeername: Socket operation on non-socket getsockname: Socket operation on non-socket Error getting local address hostname returns the correct answer. I put "my.ip.x.x localhost" into /etc/hosts inetd is running, but all /etc/inetd.conf programs are commented out. I'm getting my IP from DHCP, but it is constant until midnight. you should use the loopback address for localhost: 127.0.0.1 localhost
Re: End failed -- Cleanup aborted and other errors
On Sat, 22 Apr 2000, Gagan Prakash wrote: Hi, We are in the process of moving our site www.adalbadal.com from the web hosting company in India to iserver -- they do have mod_perl!!! Well during this process, some of our scripts are giving us: END failed--cleanup aborted at /dev/null line 6. Callback called exit at /dev/null line 6. and an occassional Out of memory! This server has Apache 1.3.11 Mod_perl 1.21 might want to try 1.23. do this script have END blocks? if so, what are they doing?
Re: vanilla install failure 1.3.12/1.22/5.6.0
On Sun, 23 Apr 2000 [EMAIL PROTECTED] wrote: Program received signal SIGSEGV, Segmentation fault. 0x806412e in perl_handler (r=0x8727d9c) at mod_perl.c:844 844 dPPREQ; seems the common element in both of these reports is ssl. i'll build a mod_perl+mod_ssl mix, so long as i can reproduce the problem, i'll have a patch soon..
RE: Unknown Error Message
On Mon, 24 Apr 2000, Ian Mahuron wrote: I get something similar when I wrap my call to Apache::Session::DBI in an eval to try to catch it die()ing (ie. session id not found). IIRC, this is a known bug in perl. right, which is fixed in 5.6.0 panic: POPSTACK Callback called exit.
Re: PerlHandler stopped working???
I guess the problem is that mod_mime implements SetHandler - and I'm not convinced it should. If you were given the opportunity to do it all again understood, but this is how apache is designed, mod_perl is just going with the flow here. I'd suggest it be done as follows: If a PerlTypeHandler returns OK, check if @{$r-get_handlers('PerlHandler')} is true (i.e. there's a PerlHandler waiting in the wings). If so, call $r-handler('perl-script'). so why not just do that in your PerlTypeHandler? i don't think it's right for mod_perl to have that logic hardwired in. the other solution, is to let mod_mime do it's thang in the type phase, and do your thang in the fixup phase to override anything mod_mime did that you don't want.
Re: segfault in DSO mod_perl 1.23 (perl 5.6.0) with apache-1.3.12
perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/sbin/apxs EVERYTHING=1 probably a long shot, but any difference if you build with USE_DSO=1 instead of USE_APXS ?
Re: PerlHandler stopped working???
I do now - just uploaded a new version. It's still not correct though - a proper fix would have to pull SetHandler out of mod_mime altogether, I you'd still have the same problem, Apache stops calling type handlers after the first one returns OK. besides, you can apply the SetHandler config in your TypeHandler by using a subrequest, no need to pull it out of mod_mime. I guess one important question is - why do we have to call SetHandler for PerlHandlers and not for any of the other handler phases. For all the other phases Apache/mod_perl automatically figures out if there's a handler installed and either runs perl code, or lets apache do its work. Why can't PerlHandler do the same? (as you can tell - I haven't dug into the internals of this - but I am curious). because Apache dispatches response handlers based on the modules' handler_rec (part of the module structure). the key Apache uses to do that lookup is r-handler, which if NULL, falls back to r-content_type. Right. So what's the point of PerlTypeHandler again?... ;-) Seriously though - Apache::MimeXML is the only PerlTypeHandler, as far as a quick search reveals, apart from your examples in the book. So maybe it would be worth investigating this further. there's nothing to investigate, Apache is working as it is designed. if you feel this is a design flaw, the the issue should be raise on [EMAIL PROTECTED] list. as i mentioned above, alternative to the FixupHandler workaround, if your TypeHandler wants to let mod_mime contribute, it can run a subrequest and copy the $subr-{handler,content_type} as you see fit. A fixup handler is an interesting solution... but can I stack FixupHandlers? (I run most of my mod_perl code from a FixupHandler). yes. Also, you didn't pick up on something I sent to the list in another thread... I have code that goes: if ($r-current_callback eq 'PerlFixupHandler') { $r-push_handlers('PerlHandler', \code); } else { code($r); } so that I can install the module as either a fixup or a PerlHandler. The fixup installed version is 4 times slower than calling the function directly - is that to be expected? (we're talking 20 requests/sec vs 80 here - a huge difference). i wouldn't expect that much of a difference. i'll look into it.
Re: $r-get_handlers bug/oversight?
On Tue, 25 Apr 2000, Geoffrey Young wrote: Hi all... I've noticed that get_handlers() will return the enabled handlers for a PerlPostReadRequestHandler, but not when it is specified as a PerlInitHandler (either by calling $r-get_handlers('PerlPostReadRequestHandler') or $r-get_handlers('PerlInitHandler'). It is the same with PerlHeaderParserHandler. An oversight? Also, I can't get anything for PerlCleanupHandlers, which kinda makes sense, since Cleanup isn't really a phase, per se (at least according to the book). Does it make sense to add this to get_handlers() as well? oversight. neither CleanupHandler nor InitHandlers is in the handler_table in Apache.xs. probably because those directives were added after get/set handlers was implemented, and the table was never updated. i'll see about fixing that.
Re: Passing POST Data to a SubRequest
On Thu, 20 Apr 2000, Chris D'Annunzio wrote: Is there a way to pass data into a SubRequest using the post method? no, you'll need to use GET and $r-args which can be made transparent with the module below, provided your code can deal with post POST and GET requests. That works great if the Content-Type of the POST is application/x-www-form-urlencoded. Is there a way to deal with other Content-Types like multipart/form-data? for something like that, you'd be better off using the $r-pnotes table to pass a CGI.pm or Apache::Request object to the subrequest. Apache::RequestNotes on cpan might be useful to you.
Re: [RFC] Transitioning from Apache::Registry to Apache handlers
On 20 Apr 2000, Randal L. Schwartz wrote: "Doug" == Doug MacEachern [EMAIL PROTECTED] writes: Doug why all the globals?? symbol table lookups are much slower than Doug lexicals. If I recall, the word lately is that they're much closer than they were. i take it back, the symbol table lookups for globals are done at compile time, 5.x has always done that, i think. by the looks of: perl -MO=Terse -e 'my $lex = 1; our $ogv = 1; $gv = 1' they still behave the same at runtime, though what happens during compile time might be different. But lexicals are still "cleaner", if I recall. indeed.
Re: mod_perl-1.99_01-dev
On Fri, 21 Apr 2000, Greg Cope wrote: Does this mean that we {will|may} be able to use the interpreter pool to set up X Perl interpreters (say 20 to service dynamic handlers) with Z apache (say 60 to handle static + dynamic content - assuming the dynamic content is passed to the Perl interpreters) children, and hence have significant memory savings as we can avoid (in some cases) the light / heavy httpd model ? yes, exactly.
Re: mod_perl 2.x/perl 5.6.x ?
On Sat, 22 Apr 2000, Leslie Mikesell wrote: So, does that still leave mod_perl serializing access until everything is rewritten to be thread-safe? no, -Dusethreads with 5.6.0 makes the Perl runtime (aka PerlInterpreter), re-entrant. all of Perl's internal globals (symbol table, stacks, etc.) become part of the PerlInterpreter structure, each interpreter clone has it's own copy of any writeable data (symbol table, stacks, etc.) the syntax tree is shared. this makes it possible to concurrently call subroutines in different threads, which was not possible with 5.005_03. this doesn't solve the problem of xs modules or c libraries that are not thread-safe, we'll have to fix any trouble makers as they pop up.
RE: mod_perl 2.x/perl 5.6.x ?
On Sun, 23 Apr 2000, Gunther Birznieks wrote: I agree... but to some degree I hope this has been done for many of the major modules and the major DBI modules (eg DBD sybase)... as they ended up having to work on ActiveState's PerlEx which uses a similar model. In a way, PerlEx's model has been a test for mod_perl 2.0. indeed. PerlEx uses PERL_OBJECT, which is similar in concept to USE_ITHREADS. we all owe a great deal of thanks to ActiveState for sponsoring Gurusamy Sarathy's work on 5.6.0. without the USE_ITHREADS implementation, mod_perl would be next to useless with threaded apache-2.0
RE: mod_perl 2.x/perl 5.6.x ?
On Sat, 22 Apr 2000, Eric Cholet wrote: mod_perl-2.0 requires perl 5.6 to be build with -Dusethreads, which turns on threading and multiplicity. just to be clear, as you mention below, -Dusetheads isn't required for mod_perl-2.0, but strongly suggested if you use an mpm other than prefork :) and i wouldn't say -Dusethreads "turns on threading", it simply makes the Perl runtime re-entrant (as explained in an earlier message) The biggest hurdle I've faced until now is that DBI won't build with this threaded perl. Hopefully DBI will be updated since the latest version is from july 99. it compiles with the patch below, not sure if it actually works though :) This is for using Apache 2.0's pthread MPM, of course you can build perl 5.6 non threaded and use apache 2.0's prefork model but then it's not as exciting :-) maybe not as exciting, but still very important, the 1.3.x model works quite well for many people, so mod_perl-2.0 will continue to support it. --- DBI.xs~ Sun Jul 11 19:04:27 1999 +++ DBI.xs Tue Apr 25 19:05:40 2000 @@ -9,6 +9,13 @@ #include "DBIXS.h" /* DBI public interface for DBD's written in C */ +#ifndef pTHX_ +#define aTHXo_ +#define CopFILEGV(cop) cop-cop_filegv +#define CopLINE(cop) cop-cop_line +#define get_sv perl_get_sv +#endif + #define MY_VERSION "DBI(" XS_VERSION ")" #if (defined USE_THREADS || defined PERL_CAPI || defined PERL_OBJECT) @@ -112,7 +119,7 @@ # if (PATCHLEVEL == 4) (SUBVERSION 68) # define dPERINTERP_SV \ -SV *perinterp_sv = perl_get_sv(MY_VERSION, FALSE) +SV *perinterp_sv = get_sv(MY_VERSION, FALSE) # else # define dPERINTERP_SV \ SV *perinterp_sv = *hv_fetch(PL_modglobal, MY_VERSION, \ @@ -121,7 +128,7 @@ # define dPERINTERP_PTR(T,name)\ T name = (T)(perinterp_sv SvIOK(perinterp_sv) \ - ? SvIVX(perinterp_sv) : NULL) + ? (T)SvIVX(perinterp_sv) : NULL) # define dPERINTERP\ dPERINTERP_SV; dPERINTERP_PTR(PERINTERP_t *, PERINTERP) # define INIT_PERINTERP \ @@ -189,13 +196,13 @@ DBIS-size= sizeof(*DBIS); DBIS-xs_version = DBIXS_VERSION; /* publish address of dbistate so dynaloaded DBD's can find it */ -sv_setiv(perl_get_sv(DBISTATE_PERLNAME,1), (IV)DBIS); +sv_setiv(get_sv(DBISTATE_PERLNAME,1), (IV)DBIS); DBISTATE_INIT; /* check DBD code to set DBIS from DBISTATE_PERLNAME*/ DBIS-logfp= stderr; DBIS-debug= 0; -DBIS-neatsvpvlen = perl_get_sv("DBI::neat_maxlen", GV_ADDMULTI); +DBIS-neatsvpvlen = get_sv("DBI::neat_maxlen", GV_ADDMULTI); sv_setiv(DBIS-neatsvpvlen, 400); /* store some function pointers so DBD's can call our functions*/ DBIS-getcom= dbih_getcom; @@ -613,7 +620,7 @@ if (imp_size == 0) { /* get size of structure to allocate for common and imp specific data */ char *imp_size_name = mkvname(imp_stash, "imp_data_size", 0); - imp_size = SvIV(perl_get_sv(imp_size_name, 0x05)); + imp_size = SvIV(get_sv(imp_size_name, 0x05)); if (imp_size == 0) imp_size = g_imp_maxsize + 64; } @@ -1450,16 +1457,16 @@ fprintf(logfp," during global destruction."); return; } -if (!curcop-cop_line) { +if (!CopLINE(curcop)) { fprintf(logfp," at unknown location!"); return; } -file = SvPV(GvSV(curcop-cop_filegv), len); +file = SvPV(GvSV(CopFILEGV(curcop)), len); if (trace_level=4) { if ( (sep=strrchr(file,'/')) || (sep=strrchr(file,'\\'))) file = sep+1; } -fprintf(logfp," at %s line %ld.", file, (long)curcop-cop_line); +fprintf(logfp," at %s line %ld.", file, (long)CopLINE(curcop)); } @@ -1751,7 +1758,7 @@ */ I32 markix = TOPMARK; CV *xscv = GvCV(imp_msv); - (void)(*CvXSUB(xscv))(xscv);/* Call the C code directly */ + (void)(*CvXSUB(xscv))(aTHXo_ xscv); /* Call the C code directly */ if (gimme == G_SCALAR) {/* Enforce sanity in scalar context */ if (++markix != stack_sp - stack_base ) { @@ -2130,7 +2137,7 @@ Fflush(DBILOGFP); } DBIS-debug = level; - sv_setiv(perl_get_sv("DBI::dbi_debug",0x5), level); + sv_setiv(get_sv("DBI::dbi_debug",0x5), level); } } OUTPUT: @@ -2226,7 +2233,7 @@ } if (type == '$') { /* lookup scalar variable in implementors stash */ char *vname = mkvname(DBIc_IMP_STASH(imp_xxh), meth, 0); - SV *vsv = perl_get_sv(vname, 1); + SV *vsv = get_sv(vname, 1); if (trace) fprintf(DBILOGFP,"- %s = %s\n", vname, neatsvpv(vsv,0)); ST(0) = sv_mortalcopy(vsv);
Re: Deep Recursion with File::Copy
On Tue, 25 Apr 2000, Jeremy Blumenfeld wrote: Hi. We are running Server Version: Apache/1.3.9 (Unix) mod_perl/1.21 on a Linux system. Having problems with a "Deep Recursion" when using the copy method of File::Copy. my guess is that you're using Perl 5.005_03 and have PerlFreshRestart On perl 5.6.0 fixes File::Copy so it can be reloaded (see Changes entry below). either turn FreshRestart Off or update File::Copy to 5.6.0's version [ 4753] By: gsar on 2000/01/05 06:48:22 Log: From: [EMAIL PROTECTED] (Andreas J. Koenig) Date: 03 Jan 2000 21:56:02 +0100 Message-ID: [EMAIL PROTECTED] Subject: Reloading File::Copy Branch: perl ! Changes lib/File/Copy.pm t/lib/filecopy.t
Re: Deep recursion on subroutine Apache::Constants::AUTOLOAD
On Tue, 25 Apr 2000, Martin Lichtin wrote: Doug MacEachern wrote: Anyone understand why perl -we 'use Apache::Constants; Apache::Constants::OK();' causes this problem? what version of mod_perl are you using? ' mod_perl 1.21, perl 5.00503 ok, well, i don't understand why you're getting this error on the command line, but Apache::Constants only works inside httpd anyhow. are you having a problem using it inside httpd?
Re: Modperl/Apache deficiencies... Memory usage.
On Sat, 15 Apr 2000 [EMAIL PROTECTED] wrote: Modperlers..., I'd like to start a discussion about the deficiences in Apache/modperl and get you feedback with regard to this issue. The problem as I see it is that the process model that Apache uses is very hard on modperl. mod_perl-2.0/apache-2.0 should solve this (fingers crossed :) It is very memory inneffecient basically. Each process of apache has it's registry which holds the compiled perl scripts in..., a copy of each for each process. This has become an issue for one of the companies that I work for, and I noted from monitoring the list that some people have apache processes that are upwards of 25Megs, which is frankly ridiculous. with 2.0, the syntax tree is shared (at the Perl level) however, padlists are not shared. as i mentioned, i'd like to look at using your "garbage collector" for 2.0. if it could run in it's own thread and examine the padlists of idle interpreters, it could be big win. i wouldn't want it to release all allocations in the padlist by default. maybe be configurable to only release things of a certain size. what i would personally like to see is one that just reports anything that's larger than X size, so i can fix the Perl code not copy large chunks of data, and/or figure out how to make large chunks of data shared between interpreters. i kinda started this with the B::Size hooks in Apache::Status, but you have to dig around the symbol table to find how big things are, there's no overall reporting mechanism. One of my concerns is that maybe the apache module API is simply too complex to pull something like this off. I don't know, but it seems like it should be able to handle something like this. if you need a model where the Perl engine is in a different process than Apache, that should be implemented with FastCGI or something else. the overhead of passing the request_rec (and everything it points to) between processes for all of the various phases (so mod_perl could still everything it can today) would be a nightmare.
Re: mod_perl-1.99_01-dev
I should have been more clear! nah, i realized right after i turned off my laptop, it was like 3am, i was dum. I meant backward compatibility to the mod_perl API. Will I be able to take a module that makes extensive use of Apache::* mod_perl core modules, and expect it to work? yes, the mod_perl Perl API will look exactly the same, with lots of new cool stuff of course :)
Re: Memory usage on reload and graceful -- still broken?
You got me! I have Perl sections ... but I didn't know it was such a crime. Pretty bizarre behavior if you ask me. it's not a crime, but if you're running Perl code during restart there's a strong chance you'll be growing the server size. i agree 1M is bizarre though.
Re: Problem with Apache::SIG
On Wed, 12 Apr 2000 [EMAIL PROTECTED] wrote: Hi All, Recently I installed Apache-1.3.12 with mod_perl-1.22. Standard installation. Everything seemed to work great. I'm using the directive PerlFixupHandler Apache::SIG because you have some 'alive' scripts that need to be killed if the user closes his browser. Well, everything seems to work fine, but in Apache error_log we get the message: [Mon Apr 10 22:27:01 2000] [error] at /usr/lib/perl5/site_perl/5.005/i386-linux /Apache/SIG.pm line 31. Line 31 is Apache::exit($s); Apache::exit() calls die() underneath to halt script execution. it tie's $@ so it appears empty to avoid such messages, somehow the magic was lost. so the message in this case is nothing more than annoying.
Re: detecting fd leaks (was Re: Apache::Request)
On Thu, 13 Apr 2000, Stas Bekman wrote: I have no real conclusion to reach, except that it seems to be leaking files. Well, I wanted to write Apache::FileLeak or an extension to Apache::VMonitor to show the opened file descriptors, the files and the processes that have opened them, but this requires a root access unless you want to see the information about the current process only. what i've found to be a nice solution for such a problem, is to use PlRPC, where the server is setuid root. access is limited to 127.0.0.1, which might not be enough, but is perfect for something like Audio-RaveMP (on cpan), it might also be a reasonable solution for your Apache::FileLeak.
Re: Avoiding redefining constant subs
Sorry--you're quite right... it's not a mandatory warning at all any more. I run all my scripts when developing under -w, so I still get the warning. I think it would be useful to specifically check that the sub is not already defined in the caller's namespace: if (!(defined {"${pkg}::$name"})) { import the const sub } This works fine for me... without it, it's very hard to notice many warnings which provide useful diagnostic information. Worse still, some people may just turn off -w altogether to avoid their logs filling up. this only happens when Apache::Registry re-compiles your script. you can avoid this by moving your subroutines into modules, which are only reloaded if FreshStart is on or Apache::StatINC is configured. both of which disable warnings when re-loading. the other solution would be subclass Apache::RegistryNG with just a compile method like so: sub compile { my $self = shift; local $^W = 0; $self-SUPER::compile(@_); } or hack Registry.pm like so: --- lib/Apache/Registry.pm 2000/04/05 06:19:34 1.31 +++ lib/Apache/Registry.pm 2000/04/20 20:26:14 @@ -173,6 +173,7 @@ sub compile { my $eval = shift; Apache-untaint($eval); +local $^W = 0; eval $eval; }
Re: apache_1.3.12 / mod_perl-1.22 ... install crash !
On Fri, 14 Apr 2000, Frédéric Schwien wrote: Hi, I'm using apache_1.3.12 / mod_perl-1.22 , on Suse 6.1 . when I try to install modperl, when perl Makefile.PL, I get the result before. After that, I can't make make test make install : make test crashes at listening to the port 8529. can we see your t/logs/error_log? apxs:Error: Sorry, no shared object support for Apache this is just a warning, fixed in the cvs tree.
Re: modperl and MIME::Parser?
On Sat, 15 Apr 2000, John S. Evans wrote: So digging a little deeper (and through the magic of trial and error), the offending module seems to be Mail::Field. It has a bunch of code to dynamically load perl classes for various types of fields (AddrList, Date, Content-Type, etc), and this code seems to do something that makes modperl (or apache) very unhappy. Basically, it seems to blow through the INC list, looking for a directory that matches Mail::Field. When it finds such a directory, it blows recursively through it, using "require" on every file it finds. you don't say what version of mod_perl you're using. 1.22 should fix this. turning PerlFreshRestart off will also fix.
Re: Segfault on DBI-Connect
On Sun, 16 Apr 2000, Jochen Wiedmann wrote: Btw, Doug, as I see the sigpipe thing: What do you recommend for the DBD::mysql driver? (Remember the "MySQL morning bug"?) Should we enable or disable SIGPIPE? apache no longer catches SIGPIPE as of 1.3.6, so it may not be an issue anymore if mysql throws/catches SIGPIPE. but, gut says it's best to avoid using SIGPIPE if possible, as somebody else might stomp on it.
Re: [Slightly OT] IPC::Open3 broken in mod_perl/perl 5.6.0?
On Mon, 17 Apr 2000, Richard Titmuss wrote: Hi, I have also had this problem. I checked the modperl-cvs archive and this problem has been fixed in the development release. yes, the cvs version implements Apache::OPEN I still have an problem using IPC::Open2. This can be demonstrated by: use IPC::Open2; $pid = open2(\*A, \*B, '/usr/bin/ls'); The error log shows: [error] Can't locate object method "FILENO" via package "Apache" at /usr/local/lib/perl5/5.6.0/IPC/Open3.pm line 183. does this fix it: sub Apache::FILENO { untie *STDOUT; fileno STDOUT; } ?
Re: XML::Parser causing SEGFAULT in Apache under mod_perl
On Tue, 18 Apr 2000, DeWitt Clinton wrote: On Tue, Apr 18, 2000 at 12:43:57PM -0400, Delaporta, Michael wrote: I'm currently using XML::Parser (2.28) under Apache (1.3.11) and mod_perl (1.21) and have noticed a fairly large number of segfaults in the Apache error_log. I noticed a discussion about this problem on the list about a week ago, but the only solution posted was as a Debian package (which I can't use). No mention of the actual problem/solution was mentioned. As Doug identified a month ago, the correct solution is to use "--disable-rule=EXPAT" during the apache configuration step. any status on XML::Parser hiding it's symbol's so they don't clash with apache's ? i'm considering having mod_perl's Makefile.PL disable EXPAT, which is only used by the 3rd-party mod_dav anyhow. if somebody wants mod_dav, they can override using APACI_ARGS=--enable-rule=EXPAT
Re: Passing POST Data to a SubRequest
On Tue, 18 Apr 2000, Chris D'Annunzio wrote: Is there a way to pass data into a SubRequest using the post method? no, you'll need to use GET and $r-args which can be made transparent with the module below, provided your code can deal with post POST and GET requests. package Apache::POST2GET; use Apache::Constants qw(M_GET); sub handler { my $r = shift; if ($r-method eq 'POST') { my $content = $r-content; $r-args($content); $r-method('GET'); $r-method_number(M_GET); $r-headers_in-unset('Content-length'); } } __END__ #httpd.conf PerlInitHandler Apache::POST2GET
Re: Core dump
On Tue, 18 Apr 2000, Robert Jenks wrote: Got a different code dump. I'm not sure if this one is mod_perl related though... My httpd.conf and startup.pl are the same as my 4/9/2000 post. #0 0x4089fbb6 in kputac () (gdb) where #0 0x4089fbb6 in kputac () #1 0x408bf8b6 in OCISessionEnd () #2 0x4046b388 in ora_db_disconnect () #3 0x40468399 in XS_DBD__Oracle__db_DESTROY () ... #14 0x4019f534 in perl_child_exit () this is happening when a child exits, and your persistent Apache::DBI is being disconnected. i don't have any insight into why DBD::Oracle is core dumping, unless you can compile it with -g, so filename/line numbers are shown. one bandaid would be to set the enviornment variable PERL_DESTRUCT_LEVEL to -1, in which case mod_perl will skip global destruction and the os will take care of closing your db socket.
Re: Perl Sections and Virtual Host
i've only skimmed this thread, but haven't seen any mention of chapter 8 online at http://modperl.com/ which covers Perl sections in detail.
Re: unsatisfied symbol - mod_perl 1.21/Apache 1.3.12
On Tue, 18 Apr 2000, Hugh Williams wrote: I've seen several make problems posted, so maybe someone has the answer to this one. mod_perl fails during the 'make' with an unsatisfied symbol; first a little background. I'm building on an HP J2240 running HP-UX 10.20. In the commands below: $SITE_DIR = /hfs/d1/development/built $APAC = apache_1.3.12 I've built Perl 5.005.03 statically (that is using 'make static' for all modules that handle it). I have included a number of modules, among them all the prerequisites for LWP, including Digest-MD5-2.09. the quick fix would be to edit your Perl's Config.pm and add Digest::MD5 to the list of static_ext='...', then rebuild mod_perl from scratch.
Re: ANNOUNCE: Apache-TicketAccess 0.10
On Tue, 18 Apr 2000, Michael J Schout wrote: Apache-TicketAccess-0.10.tar.gz cool, but, there's already a module named Apache::TicketAccess, listed in the apache-modlist.html: TicketAccessbdpOTicket based access/authentication MPB if it's something different than the example in the eagle book, please rename it to avoid confusion.
Re: perl in configs /perl
but localhost/server-info shows no such directive having taken effect... mod_info does it's own parsing of httpd.conf, it does not understand Perl sections.
Re: mod_perl DSO coexisting with mod_php DSO ?
On Wed, 19 Apr 2000, James Graham wrote: Now when I startup the httpd with both modules (php and perl) Load and Add Module'd in httpd.conf the parent starts but seems to hang; no children are spawned and nothing is logged under error_log either. If I comment out the Load/Add Module for mod-perl it if you could get a stacktrace (see SUPPORT for hints), that would help.
Re: modperl interfering with php
...so if I want to protect a directory with a custom Authen/Authz or Access handler, php won't parse! is this familiar territory for anyone? just remove 'SetHandler perl-script', you don't need that to run Authen/Authz handlers.
Re: Trouble with DSO/APXS.
On Thu, 20 Apr 2000, Robert B. Easter wrote: Will mod_perl work as a DSO using USE_APXS=1? with 1.22 it should work fine. child pid x exit signal Segmentation fault (11) any chance you're using XML::Parser? if so, configure apache with --disable-rule=EXPAT otherwise, we'll need a stacktrace to help, see the SUPPORT doc for hints.
Re: perl use of malloc()
This implies that on another OS, the system malloc() might be different? Right?? right. Now, does this mean that if usemyalloc='y', memory is not returned to the OS, no matter what the OS is yes.
Re: vanilla install failure 1.3.12/1.22/5.6.0
On Thu, 20 Apr 2000 [EMAIL PROTECTED] wrote: Hi, After much fast progress buiding a new machine, I'm stuck. This is a vanilla RH6.2 box with almost nothing on it.. no residue from RPM perl or httpd (deselected at machine blast time). I've built perl 5.6.0 (all tested out ok), also built apache 1.3.12 both with and without Ben-SSL (all tested out ok). The most basic Modperl 1.22 install attempt fails though: just with a simple perl Makefile.PL and let it build vanilla httpd next door. It builds a binary, and make test starts it, chucks a few requests and it core dumps. The trace is below, followed at the end by the perl -V output. The segfault comes in the third test .. "GET LoadClass.pm", just after it looks around for some .htaccess files if you could build mod_perl with PERL_DEBUG=1, then in mod_perl-1.22 run: % gdb ../apache-x.x.x/src/httpd (gdb) httpd and in another window in the mod_perl-1.22 directory run: % make run_tests then send the output of: (gdb) bt
Re: cvs commit: modperl-2.0/lib/ModPerl Code.pm
Orwant and friends in "Algorithms with Perl" page 28 claims the first form is slower. faster to *parse*, not faster to *run*. stas, your benchmarks don't test parse time. It seems that TIMTOWTDI is going to die soon as everybody tells me that I should code as shown in "OO Perl" and ""Algorithms with Perl" :( The books are cool, but why turning them into bibles? The book authors are great, but why rising them into gods? bibles? gods? i haven't touched either of these books. i'm using '' vs. "" because '' is faster for Perl to parse and faster for me to parse. i'm thinking about string usage more, rather than just slinging them around without a care. i'm trying to avoid interpolation, which turns into concatination, which uses more memory and is slower than using a list. if i see a '' string, i don't worry, if i see "", i want to look close and thing about how expensive it will turn out to be. there will be exceptions, like "\n", ' define' vs "\ndefine", i do prefer the later for readability. in fact, there's plenty of interpolation happening in those modules, i very much value readability, and the "\n", ' define' did make me cringe a bit. and i will probably change that one back. and, your benchmark of those shows "\ndefine" to be faster, because the string being copied is so tiny, it's less expensive than pushing an extra item onto the stack. when generating webpages, we generally don't deal with such tiny strings, do we? use Benchmark; open my $fh, '', '/dev/null'; my($one, $two, $three, $four) = map { $_ x 1000 } 'a'..'d'; timethese(300_000, { concat = sub { print $fh "$one$two$three$four"; }, list = sub { print $fh $one, $two, $three, $four; }, }); Benchmark: timing 30 iterations of concat, list... concat: 12 wallclock secs (10.83 usr + 0.67 sys = 11.50 CPU) @ 26086.96/s (n=30) list: 9 wallclock secs ( 6.75 usr + 0.59 sys = 7.34 CPU) @ 40871.93/s (n=30)
Re: DougM: my hero and yours, too.
On Wed, 12 Apr 2000, Jeffrey W. Baker wrote: A lengthy introduction to mod_perl on wdvl.com casts Doug as the savior of website development. http://wdvl.com/Authoring/Languages/Perl/PerlfortheWeb/forks.html#hero heh, "bright fellow" - who hasn't filed his taxes or figured out how to file for an extension
Re: Segfault in __pthread_mutex_lock
On Thu, 13 Apr 2000, Shevek wrote: I have a nasty feeling this might be the RULE_EXPAT thing, I didn't do a RULE_EXPAT=no when building Apache. Is there documentation describing the dirty details of the issue? Can anybody confirm? well, are you using XML::Parser? if so, why not confirm yourself by trying RULE_EXPAT=no?
Re: RedHat 6.1 apache 1.3.12 modperl 1.22 Makefile.pl errors and failed make test
Doug, I guess this is something that should be addressed as a Makefile.PL configuration parameter. I myself have encountered a few problems with the User/Group values picked by the build process in a complex NIS environment and have had to manually modify the httpd.conf used during the 'make start_httpd'. Having a way to provide your own choice of User/Group would be nice. no more Makefile.PL parameters, there are far too many. i wouldn't mind adding something like this though.. --- Makefile.PL 2000/04/03 03:56:11 1.155 +++ Makefile.PL 2000/04/13 23:15:52 @@ -871,8 +871,10 @@ #use only first value if $) contains more than one $gid =~ s/^(\d+).*$/$1/; -$User = $Is_Win32 ? "nobody" : (getpwuid($uid) || "#$uid"); -$Group = $Is_Win32 ? "nogroup" : (getgrgid($gid) || "#$gid"); +$User = $Is_Win32 ? "nobody" : + $ENV{APACHE_USER} || (getpwuid($uid) || "#$uid"); +$Group = $Is_Win32 ? "nogroup" : + $ENV{APACHE_GROUP} || (getgrgid($gid) || "#$gid"); if($User eq "root") { my $other = (getpwnam('nobody'))[0];
Re: [OT] Killing off children
Two followup questions: 1) Would truss show this -- or is there a way to test this? 2) Would you expect the child to survive a kill -9 while hanging? if the process is in a state where you can't kill -9 or attach with strace or gdb, etc., i have no idea exactly what triggered that. all i'm saying is, it's possible that something during Perl cleanup did. then again, the process may have already been in that state before you ran kill -HUP, which would make my suggestion worthless. next time, before you kill -HUP, check the process states with ps or top or something. if a process is already in this hosed state, maybe you can dig something useful out of /proc. i don't know of any tools to debug a process you can't kill -9 or attach to.
RE: Segfault with Embperl, Apache::Session
this copy-n-paste from ~/Mail/.sent-mail-dec-1999 might help: --- a few things could shed some more light: build a libperld.a and compile with PERL_DEBUG=1 (see SUPPORT doc) and/or, in gdb: (gdb) source mod_perl-1.21/.gdbinit (gdb) curinfo should tell you the line/filename of the offending Perl code add this to the .gdbinit (which is in the modperl cvs tree): define longmess set $sv = perl_eval_pv("Carp::longmess()", 1) printf "%s\n", ((XPV*) ($sv)-sv_any )-xpv_pv end (gdb) longmess should produce a Perl stacktrace
Re: missing modules/perl/libperl.a
USE-APACI=1 \ as stas mentioned, USE_APACI is the correct name, USE-APACI is ignored. it could be that stronghold does not support apaci.
Re: Apache::Request
On Tue, 11 Apr 2000, John S. Evans wrote: I'm using Solaris (SunOS 5.7, according to uname). The number of files varies, and I can control this if I know what the limits are. Is the 256 limit per process or for the entire machine? For instance, if I have 10 apache children going full bore, is the practical limit 25 per child, or 256 per child? i think it's per-child. I saw (in the code) that there's one open file per uploaded file. That should be fine. I just need to find out if they're getting closed correctly. What is "lsof"? look it up on freshmeat.net, it'll show you what files the process has open. should be useful to see if any files are not being closed.
Re: [OT] Killing off children
On Wed, 12 Apr 2000, Bill Moseley wrote: Hello, I noticed on the Apache server-status report a child that is stuck in "G" (Gracefully finishing) after a SIGUSR1 today. Twelve hours ago. this could be perl_destruct() hanging while trying to cleanup. this normally isn't a requirement, you can disable by setting the PERL_DESTRUCT_LEVEL environment variable to -1
Re: UndefOnReload problems with Apache::StatINC
On Wed, 12 Apr 2000, Scott Guelich wrote: I've run across a problem with UndefOnReload stomping on code in mod_perl/1.21, which I believe affects mod_perl/1.22 as well. I scanned through the mod_perl archives and found that others had similar problems a while back, leading to Apache::StatINC and Apache::Symbols::undef_function being modified so that they only undefine exported functions. UndefOnReload should be obsolete now that Perl 5.005+ does not spit out mandatory warnings when redefining constant subroutines. that's what UndefOnReload was introduced for. do you need it for something else?
Re: [newbie] diffs and cvs
If you don't want all that, you probably don't want the unreleased version in the first place. (assuming Doug will start releasing a little more often now :-) ) i thought i already start doing that :) =item 1.22 - March 22, 2000 =item 1.21_03 - March 15, 2000 =item 1.21_02 - March 6, 2000 =item 1.21_01 - March 5, 2000 1.23 coming soon..
Re: A better patch for Registry.pm
On Wed, 12 Apr 2000, Ask Bjoern Hansen wrote: On Wed, 12 Apr 2000, Tom Mornini wrote: [...] I'm going to have to work harder at getting on that credits list, it would seem! Nah. Doug didn't commit it yet so except if it was because he didn't want it and will back it out again, then you're on the list now. It was your idea after all, so keep let them come. :) i forgot to commit in a rush to get out the door. i was planning to give tom the credit though :)
Re: PLEASE HELP!!!!! I cannot get mod_perl/apache compiled
perl Makefile.PL make make test make install APACHE_SRC=/usr/src/apache_1.3.12/src APACHE_PREFIX=/data01/apache DO_HTTPD=1 with that config, mod_perl will build httpd for you and install with 'make install'. that's all you need. $ROOT_DIR/apache_1.3.12/configure \ --with-layout=/root/apache.config.layout:Sam-Layout \ --with-perl=src/modules/perl \ --enable-module=most \ --server-uid=wwwrun \ --server-gid==dosemu \ --enable-shared=max if you run this after, you've overwritten httpd with a new one that doesn't contain mod_perl. just skip this step and you should be all set.
Re: RedHat 6.1 apache 1.3.12 modperl 1.22 Makefile.pl errors and failed make test
On Wed, 12 Apr 2000, Adam Joffe wrote: Hi all, trying to set up a new linux box. real vanilla using apaci, everything=1, do_httpd=1, etc... "perl Makefile.PL" gives a bunch of "which: no apxs found" errors. Saw some threads about this in the list but none explained why the errors occur and how to get rid of them when doing a fresh install. it was explained as a warning that is fixed in the cvs tree. Make test fails at the "warming up" stage with Error "9". The httpd is actually running when the make test fails as I can telnet to port 8529 and do a "GET /". However, it returns a 403 permission denied message. I am doing all this as root. The server runs as user nobody, group is root, so I would think the server should be able to r/w from the test directory. try building again with fresh source trees as yourself (not root), then 'make install' as root.
Re: Problems with custom configuration handlers
On Wed, 12 Apr 2000, Kevin Murphy wrote: I've written an access handler which takes some custom configuration directives based on the instructions in chaper 8 of the Eagle book. Everything makes and installs fine, and I am able to load the module with a PerlModule directive, but when I try to use the directives defined in my module I get an error: "Invalid command 'WhiteListAllow', perhaps mis-spelled or defined by a module not included in the server configuration" package Emusic::WhiteList; what options did you give mod_perl's Makefile.PL? how to you load Emusic::WhiteList? PerlModule Emusic::WhiteList before WhiteListAllow should work. if not, try this in httpd.conf: Perl require Emusic::WhiteList; delete $INC{'Emusic/WhiteList.pm'}; #this is what mod_perl is supposed to do internally /Perl WhiteListAllow ...
Re: Segfault on DBI-Connect
this seems to becoming quite a common problem, i wonder if Jochen can shed some light? On Tue, 4 Apr 2000 [EMAIL PROTECTED] wrote: I've been seeing the same segfault-on-connect problem with Apache 1.2.12 + mod_perl 1.22 + DBI 1.13 + Msql-Mysql-modules 1.2211. The segfault is due to a null first argument being passed to mysql_real_connect(). Running Apache with a -X argument yields the following backtrace when my mod_perl module does a DBI-connect (str, username, passwd, { options }). Note the null mysql argument | V #0 0x80ef5b7 in mysql_real_connect (mysql=0x0, host=0x8a99db8 "hostname.brown.edu", user=0x8a9b550 "username", passwd=0x8a9b568 "password", db=0x8a99e40 "databasename", port=3306, unix_socket=0x0, client_flag=0) at libmysql.c:1125 #1 0x402d01fd in mysql_dr_connect () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #2 0x402d0540 in _MyLogin () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so The mysql_real_connect routine does a set_sigpipe(mysql), which triggers the segfault. This problem has only come up since I upgraded Apache/mod_perl from 1.3.9/1.21 to 1.3.12/1.22. Richard Goerwitz
Re: 1.22_01-dev: Modification of a read-only value ...
On Wed, 5 Apr 2000, Oleg Bartunov wrote: Yes ! It works now after I add Apache::Table to my startup.pl excellent. Apache::Table is now loaded by default if it's enabled (footprint is small), problem solved.
Re: Turning off experimental threads in mod_perl
On Tue, 4 Apr 2000, Chris Mason wrote: How do I keep mod_perl from trying to use the experimental thread feature in perl, even when I built perl with that option? Is this possible? See the build error that I get below. I'm using mod_perl 1.22, perl 5.005_63, and apache 1.3.12. try using Perl 5.005_03 or 5.6.0
Re: IO::File, mod_perl, and RedHat Secureweb
On Wed, 5 Apr 2000, Joe Bowman wrote: Has anyone encountered the following problem? I have a RedHat 6.0-based machine, using perl-5.00503, RedHat secureweb-3.1-2, and mod_perl 1.22. The problem I'm running into is that whenever I try to preload the IO::File module, secureweb segfaults. No error messages in error_log whatsoever. However, using IO::File outside of mod_perl (i.e. in a regular perl script run from the command line) works just fine. what does 'perl -V:usemymalloc' say? if 'y', try rebuilding Perl with 'Configure -des -Uusemymalloc', which is the default anyhow for linux. another option is building mod_perl static instead of dso, assuming you built as a dso?
Re: which handler?!?
On Wed, 5 Apr 2000, J. Horner wrote: I'm finally writing the web server intrusion system that I've planned for months. I have the skeleton for the URI comparing handler, but I'm a little unclear where it should really go. A handler is written to compare the URI against a source of known web server issues to alert the administrator to hacking attempts. Should the handler be installed at the PerlPostReadRequestHandler phase or the PerlTransHandler phase. The Eagle book says something like: "It is called once per transaction and is intended to allow modules to step in and perform special processing on the incoming data", which is what I want, but it goes on to say, "However, because there's no way for modules to step in and actually contribute to the parsing of the HTTP header, this phase is more often used just as a convenient place to do processing that must occur once per transaction." Is this last sentence not the negation that I read it to be? It seems to me that it is telling me that I really can't write a handler to actually do something useful on the incoming request header. keyword is `parsing', once the HTTP request is parsed, you can modify the $r-headers_in table in any phase. If I put the hander in at PerlTransHandler, it seems that I would interfere unnecessarily at the translation phase. I just want a place to put it where it can take the request, run a regexp against a list of known issues to check for a match, then, if we return a false, go on with the parsing and file mapping. you won't interfere if you return DECLINED from a PerlTransHandler.
Re: Quick question re: mod_perl
On Wed, 5 Apr 2000, Charles Aulds wrote: Doug, Can you tell me with a simple response, are the modules shown on my status page http://192.168.1.1/perl-status?inc all loaded by mod_perl when it starts? I have no PerlModule or PerlRequire directives in effect. Apache.pm and Apache::Constants are loaded by default, which in turn pulls in a few standard modules, Exporter, Carp, etc.
Re: Avoiding redefining constant subs
On Thu, 6 Apr 2000, Jeremy Howard wrote: Hi there, I've been getting frustrated by the mandatory warning created by 'use constant' under mod_perl, caused by constant subroutines being redefined when imported. In particular, with Archive::Zip this was adding hundreds of lines to my log every restart. what version of Perl are you using? the mandatory constant-sub-redefined warning went away in 5.004_66: [ 1015] By: TimBunce on 1998/05/19 20:07:01 Log: Title: "loosen const sub re-defined warnings" From: Doug MacEachern [EMAIL PROTECTED] Msg-ID: [EMAIL PROTECTED] Files: proto.h global.sym op.c pp.c sv.c Branch: maint-5.004/perl ! global.sym op.c pp.c proto.h sv.c
Re: missing modules/perl/libperl.a
On Thu, 6 Apr 2000, Todd Finney wrote: I'm attempting to recompile Stronghold with mod_perl, and I've run into a problem that no set of instructions (that I've seen) seem to help with. Any assistance/advice/RTFMs would be appreciated. mod_perl 1.21 Stronghold 2.42 glibc2.1 build 2412 Perl 5.005_03 This system has an existing mod_perl enabled httpd that I compiled with no problems. It is also 1.21, with apache 1.3.9. I'd rather not poon that instance while creating this one. with the same Perl version or an older one? In file included from mod_perl.h:41, from mod_perl.c:60: /usr/lib/perl5/5.00503/i686-linux/CORE/perl.h:2546: redefinition of `union semun' /usr/lib/perl5/5.00503/i686-linux/CORE/patchlevel.h:41: warning: `local_patches' defined but not use what kernel/distribution are you using? this same problem has come up with older 2.0.x kernels, i'm told upgrades have cured.
Re: confusion between scripts
On Thu, 6 Apr 2000, Marshall Dudley wrote: We have had banners servers running on 2 different boxes for years under mod_perl without any problems. Recently we moved two banner servers onto the same box, each under a different virtual domain. Now I cannot get them to run reliably. It appears that since the banners in each are run as /cgi-bin/banner.pl, mod_perl is getting them mixed up, and we end up having the script fail with errors like that all kinds of things have been redefined, when they have not. did you preload Apache::Registry in httpd.conf: PerlModule Apache::Registry ? that is reported to cure this problem. the cvs version of mod_perl has a fix so virtualhosts will not confuse Apache::Registry if it isn't pre-loaded.
Re: Apache::Registry error message?
On Fri, 7 Apr 2000, Jason Terry wrote: Does anybody know how to track down what is causing this error. It seems that Apache::Registry is trying to undefine some handler, but I don't know what handler or where. Any ideas? [Thu Apr 6 11:06:26 2000] [error] Can't undef active subroutine at /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Registry.pm line 102. what version of mod_perl and Apache are you using?
Re: Core dump on startup
On Sun, 9 Apr 2000, Robert Jenks wrote: I'm having problems with httpd core dumping during startup and have been completely unable to track it down. Sometimes it will start up fine and other times it will core dump. Any ideas, hints, etc.. would be GREATLY appreciated. i see a mention of 'xmlFile' in your startup.pl, does that mean you're using XML::Parser? if so, try configuring Apache with: RULE_EXPAT=no
Re: Apache::Cookie problems
But while Recovering the Cookie I got some errors: $cookie_ref = Apache::Cookie-fetch; any difference if you change that to: my $r = Apache-request; my $cookies = Apache::Cookie-new($r)-parse; ?
Re: A better patch for Registry.pm
On Mon, 10 Apr 2000, Tom Mornini wrote: I missed an opportunity to set $r-notes('error-notes') if there was an error at compile-time. This patch includes both run-time and compile-time patches. thanks tom. the patch below will set error-notes for all Perl*Handlers. $@ is also saved it $@{ $r-uri }, which was introduced before apache started saving errors in $r-notes('error-notes') --- src/modules/perl/mod_perl.c 2000/04/05 06:19:34 1.114 +++ src/modules/perl/mod_perl.c 2000/04/12 04:09:56 @@ -1635,6 +1635,9 @@ if(perl_eval_ok(r-server) != OK) { dTHRCTX; MP_STORE_ERROR(r-uri, ERRSV); +if (r-notes) { +ap_table_set(r-notes, "error-notes", SvPVX(ERRSV)); +} if(!perl_sv_is_http_code(ERRSV, status)) status = SERVER_ERROR; }
Re: Segfaults with RH6.1, mod_perl, perl 5.6.0, and apache 1.3.12
On Mon, 10 Apr 2000, Benjamin Reed wrote: I'm getting segfaults with a RedHat 6.1 system. I've tried mod_perl 1.22, as well as a CVS snapshot from today, and I pretty much get the same thing either way. I would appreciate it if anyone could help me out on this, it's driving me nuts. does 'make test' pass for you? if so, we'll need more details on what your server is doing, e.g. using XML::Parser?
Re: Can't locate object method BINMODE via package Apache
On Tue, 11 Apr 2000, Roca, Ignasi wrote: I'm using mod_perl-1.21 and testing GD-1.25. When calling any of the demos examples given by GD-1.25 I have the error "Can't locate object method BINMODE via package Apache". the mod_perl cvs snapshot defines a BINMODE stub (5.6.0 added this tied filehandle method). you don't need that to cure, remove the call to binmode or add this code to a startup file: sub Apache::BINMODE {}
Re: Can't locate object method BINMODE via package Apache
On Tue, 11 Apr 2000, Ken Williams wrote: Change that to binmode(STDOUT) and it should work. Since STDOUT is tied, I think Perl is interpreting that as STDOUT-binmode. that's not the problem, see my reply to Roca.
Re: Apache::Request
On Mon, 10 Apr 2000, John S. Evans wrote: I'm looking for some help/advice with Apache::Request. I'm currently using Apache::Request to parse the POST that is used to upload a bunch of files to our server. how many files? what os are you using? solaris has a 256 limit. The problem I'm running into is that I seem to be running out of file descriptors over a long period of time, if a large number of files (between 50 and 200) are posted at once. there will be an open FILE* for each file uploaded in a given request, none of which are closed until the request is over. try using lsof to see if any of them are not being closed after the request is done.
Re: memory leak during server graceful restarts
On Fri, 7 Apr 2000, Nikki Chumakov wrote: mod_perl probaly have memory leakage during rereading configs (e.g. on the apachectl graceful) do you have PerlFreshRestart On? if so, try turning it off. i think dso leaks on restart too, try linking static if that's the problem. a static httpd that doesn't have PerlFreshRestart On doesn't run any Perl code, so it can't leak. unless you have Perl sections in httpd.conf, do you?
Re: Error compiling mod_perl
On Tue, 11 Apr 2000, Sam Carleton wrote: This is the error message I got when I compiled mod_perl: Perl lib version (5.00503) doesn't match executable version (5.006) at /usr/lib/perl5/5.00503/i586-linux/Config.pm line 7. you either installed a new Perl after running mod_perl's Makefile.PL or have a broken Perl installation. try building mod_perl from a fresh source tree.
RE: What phase am I in
On Fri, 7 Apr 2000, Geoffrey Young wrote: of note, 1.21_01 introduced $r-notes('PERL_CUR_HOOK'), but why that was introduced when there is current_callback() I don't know (it's not in Changes as far as I can see) that's related to this Change: $r-current_callback now works properly when PerlHandler invokes subrequests, thanks to James Smith for the spot with that change, $r-current_callback is implemented using $r-notes('PERL_CUR_HOOK'), which might change in the future, so stick with $r-current_callback.
Re: site running mod_perl
thanks for sharing this Emmanuel! On Sun, 2 Apr 2000, Emmanuel PIERRE wrote: Hi, www.apr-job.com is a french leading related employment web site, wich is running mod_perl for 6 months right now. it is running Squid accelerator, apache 1.3.9+mod_perl, MySQL +DBI ersistant cnx. We have about 1 millions hits/week and 24000 unique IP/week. The machine config is a bi-p3 450 with 512 Mb RAM only mod_perl could make it happen on a single machine ! I've actually presented all this at linux-expo France http://www.apr-job.com/linux-expo2000/ and will soon do it (next week) in linux-expo north america. Regards, Emmanuel -- Emmanuel PIERRE A P R - J o b l'Emploi Sur Internet 32, rue Pierret, 92200 Neuilly Tel LD: 01 41 92 91 50 - Mob: 06 57 60 42 17 - Fax: 01 41 92 91 54 [EMAIL PROTECTED] www.apr-job.com "la prudence est une riche et vieille fille à qui l'incapacité fait la cour" William Blake
Re: modperl 1.22 and NameWithVirtualHost not working properly
On Tue, 4 Apr 2000, Jason Terry wrote: But, I don't want the virtual host information included. ALL of my scripts on this web server are GLOBAL and in order to save memory I only want to have one copy loaded and shared for multiple virtual hosts. It used to be that if you set $Apache::Registry::NameWithVirtualHost = 0; Then mod_perl would ignore the virtual host an use the same script for all users. However with 1.22 it doesn't seem to be doing that anymore. you can get the old behavior by backing out the 1.22 change, with this patch. i'll give this problem some attention for 1.23, which i plan to release soonish. --- mod_perl.c 2000/03/04 00:34:21 1.99 +++ mod_perl.c 2000/03/02 20:21:03 1.98 @@ -782,8 +782,10 @@ SAVETMPS; if((nwvh = ApachePerlRun_name_with_virtualhost())) { - SAVESPTR(nwvh); - sv_setiv(nwvh, r-server-is_virtual); + if(!r-server-is_virtual) { + SAVESPTR(nwvh); + sv_setiv(nwvh, 0); + } } if (gv) {
RE: Segmentation Fault: RedHat 6.[01] / Apache 1.3.12 / mod_perl 1.22 / perl 5.005_03 / IE 5
On Mon, 3 Apr 2000, Vivek Khera wrote: What if someone sets PerlFreshRestart No and has DSO enabled? Then they don't get what they think they do. right, the docs should be updated to reflect that.
Re: Apache::Filter headers
does mod_perl automatically send headers for PerlHandler routines? I know when to use it with Registry stuff, but as I move to handlers for lots of stuff I see that PerlHandlers seem ok without it. no, mod_perl will only send headers (by calling ap_send_http_header) if you have PerlSendHeader On.
Re: 1.22_01-dev: Modification of a read-only value ...
No, this doesn't fixed the problem. I applied your patch to current cvs hmm, does the problem go away if you add this to httpd.conf: PerlModule Apache::Table ? that's my only suspect, since the first time you access $r-headers_in it will 'require Apache::Table', which might confuse the stack pointer.
Re: Bug#61231: mod_perl segfaults child-processes in combinationwith XML::Parser::Expat
On Tue, 4 Apr 2000, Daniel Jacobowitz wrote: [mod_perl people - any comment? Please keep the Cc: list to the Debian bug tracking system.] When using the XML::Parser::Expat under mod_perl, this causes segmentation faults (quite random?) in the child-processes of httpd. The error message in the error.log of apache is: "[notice] child pid 28177 exit signal Segmentation fault (11)" yeah, try configuring Apache with: RULE_EXPAT=no otherwise, the symbols in XML::Parser clash with apache's. i've suggested several times that the XML::Parser author should consider making those symbols static or use a different prefix, but no idea if that's happened or not.
Re: Another Error in Apache::ASP and Perl 5.6.0
On Tue, 4 Apr 2000, Yu Di wrote: Hi, I did compile it statically. But currently for my program, I always get such errors. My Apache is 1.3.12, Perl is 5.6.0, mod_perl is 1.22. The relevant part in my httpd.conf is: any difference if you pre-load: PerlModule Apache::Registry Apache::ASP ?
Re: Error in Apache::ASP with Perl 5.6.0
On Tue, 4 Apr 2000, Yu Di wrote: Hi, there was an error with my mailbox and I can't open your mail and test the patch, could you please send it again? Thank you! sure.. --- src/modules/perl/mod_perl.c 2000/03/30 19:34:13 1.110 +++ src/modules/perl/mod_perl.c 2000/03/30 19:35:25 @@ -1557,6 +1557,7 @@ if(stash) /* check again */ is_method = perl_handler_ismethod(stash, method); #endif + SPAGAIN; /* reset stack pointer after require() */ } if(!is_method !defined_sub) {
RE: Set DocumentRoot from modperl
On Tue, 4 Apr 2000, Karyn Ulriksen wrote: Which handler would be appropriate to do the cleanup on this? you register the cleanup function from whatever handler changes document_root. that'll happen at the same time as PerlCleanupHandler, which is after PerlLogHandler. my $old_docroot = $r-document_root; $r-register_cleanup(sub { shift-document_root($old_docroot) });
Re: Apache::VMonitor
On Tue, 4 Apr 2000, Paul G. Weiss wrote: Has anyone succeeded in building this for Solaris? This sounds like an interesting module and I'd like to be able to use it. you'll have a whole lot of trouble with libgtop under solaris. last i tried with 1.0.2-ish, i had to patch the libgtop sources to get things kinda-sorta working. another release a few months ago stated that it broke solaris support in a big way. i haven't tried recently, i would suggest checking out: http://home-of-linux.org/gnome/libgtop/ try building and running some of the examples/ before going any further.
Re: Error in Apache::ASP with Perl 5.6.0
On Sun, 2 Apr 2000, Yu Di wrote: Hi, I installed Apache::ASP module with Perl 5.6.0 and mod_perl 1.22 and Apache 1.3.12. When I started to use it with any file, I got the error log: " [error] Can't upgrade that kind of scalar at /usr/lib /perl5/site_perl/5.6.0/Apache/ASP.pm line 1627." I changed the "MD5"'s in ASP.pm to "Digest::MD5" (two occurrences, both at the head of the file, one is "use MD5", the other is "$MD5 = new MD5()"), then the problem disappeared. try pre-loading Apache::ASP in httpd.conf: PerlModule Apache::ASP and/or try the cvs version of mod_perl which contains this fix: Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.445 diff -u -u -r1.445 Changes --- Changes 2000/03/30 00:44:39 1.445 +++ Changes 2000/03/30 19:35:12 @@ -10,6 +10,11 @@ =item 1.22_01-dev +reset the stack pointer after calling perl_require_module() in +perl_call_handler(). this fix will most likely cure the reports of +"Can't upgrade that kind of scalar at ..." +[Ben Cottrell [EMAIL PROTECTED]] + workaround use of Perl api functions that are no longer public with Perl 5.6.0 + win32, thanks to Randy Kobes for spotting Index: src/modules/perl/mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.110 diff -u -u -r1.110 mod_perl.c --- src/modules/perl/mod_perl.c 2000/03/30 19:34:13 1.110 +++ src/modules/perl/mod_perl.c 2000/03/30 19:35:25 @@ -1557,6 +1557,7 @@ if(stash) /* check again */ is_method = perl_handler_ismethod(stash, method); #endif + SPAGAIN; /* reset stack pointer after require() */ } if(!is_method !defined_sub) {
Re: request.t
applied to cvs, thanks Rick!
Re: 1.22_01-dev: Modification of a read-only value ...
On Sun, 2 Apr 2000, Oleg Bartunov wrote: Hi, With 1.22_01-dev I got an error: [Sun Apr 2 16:50:03 2000] [error] Modification of a read-only value attempted at /usr/local/apache/lib/perl/My/ProxyRemoteAddr.pm line 15, DATA chunk 1. hmm, 1.22_01-dev is supposed to fix that problem, does it make a difference if you backout this change? --- src/modules/perl/mod_perl.c 2000/03/31 05:16:05 1.112 +++ src/modules/perl/mod_perl.c 2000/04/03 04:19:53 @@ -1562,7 +1562,6 @@ if(stash) /* check again */ is_method = perl_handler_ismethod(stash, method); #endif - SPAGAIN; /* reset stack pointer after require() */ } if(!is_method !defined_sub) {
RE: Segmentation Fault: RedHat 6.[01] / Apache 1.3.12 / mod_perl 1.22 / perl 5.005_03 / IE 5
On Fri, 31 Mar 2000, Vivek Khera wrote: "DM" == Doug MacEachern [EMAIL PROTECTED] writes: DM mod_perl dso will do a full tear-down (perl_destruct()), regardless of DM PerlFreshRestart (which still behaves the same old way) Implying that PerlFreshRestart is ignored when mod_perl is DSO. Correct? right. If so, then it should be an error or warning to specify it when using DSO. well, it's still a FreshRestart, just fresher than static-modperl :)
Re: How do I modify the URI for standard access log?
the first patch had a copy-n-pasto, this one works fine. --- src/modules/perl/Apache.xs 2000/04/03 03:11:14 1.90 +++ src/modules/perl/Apache.xs 2000/04/03 04:32:22 @@ -1303,11 +1303,11 @@ RETVAL char * -the_request(r) +the_request(r, ...) Apache r CODE: -RETVAL = r-the_request; +get_set_PVp(r-the_request,r-pool); OUTPUT: RETVAL
Re: Segfault on DBI-Connect
On Sat, 1 Apr 2000, Valter Mazzola wrote: i've a mod_perl script that connect to a mysql db, but sometimes it segfault on DBI-connect. i'm using Apache::Registry Apache::DBI for persistend db connection, use strict and the script it's a package. i've read the docs but probably i'm missing something. if you could provide info the SUPPORT doc asks for (including stacktrace), that would help.