Segfaults with RH6.1, mod_perl, perl 5.6.0, and apache 1.3.12
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. Here's my system: RedHat 6.1 (with all updates) Apache 1.3.12 (compiled myself after having this happen with the rh-default apache) mod_perl 1.22 (and 1.22-dev, same thing either way) perl 5.6.0 (perl -V says:) -(snip!)- Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux, osvers=2.2.14, archname=i686-linux uname='linux router 2.2.14 #2 sat mar 4 10:01:12 cst 2000 i686 unknown ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='gcc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFS ET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 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, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under linux Compiled at Mar 26 2000 00:39:27 @INC: /usr/lib/perl5/5.6.0/i686-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i686-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.005 /usr/lib/perl5/site_perl . -(snip!)- When I run httpd under gdb, here's what I get: -(snip!)- Program received signal SIGSEGV, Segmentation fault. 0x40321094 in ?? () from /usr/local/libexec/libperl.so (gdb) bt #0 0x40321094 in ?? () from /usr/local/libexec/libperl.so #1 0x8062bda in run_method () #2 0x8062cc4 in ap_header_parse () #3 0x8070c1d in process_request_internal () #4 0x8070ec8 in ap_process_request () #5 0x806af38 in child_main () #6 0x806b077 in make_child () #7 0x806b178 in startup_children () #8 0x806b628 in standalone_main () #9 0x806bc21 in main () #10 0x400b71eb in __libc_start_main (main=0x806b9b0 , argc=2, argv=0xbcd4, init=0x804eb0c <_init>, fini=0x8099b6c <_fini>, rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbccc) at ../sysdeps/generic/libc-start.c:90 -(snip!)- Any ideas what's going on here? Thanks for any insight you can give. --- Ben Reed a.k.a. Ranger Rick [EMAIL PROTECTED] http://defiance.dyndns.org/
A better patch for Registry.pm
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. *** Registry.pm Tue Mar 14 23:55:28 2000 --- RegistryTom.pm Mon Apr 10 17:45:57 2000 *** *** 127,132 --- 127,133 compile($eval); $r->stash_rgy_endav($script_name); if ($@) { + $r->notes('error-notes' => $@); $r->log_error($@); $@{$uri} = $@; return SERVER_ERROR unless $Debug && $Debug & 2; *** *** 152,157 --- 153,159 } if($errsv) { + $r->notes('error-notes' => $errsv); $r->log_error($errsv); return SERVER_ERROR unless $Debug && $Debug & 2; return Apache::Debug::dump($r, SERVER_ERROR); -- -- Tom Mornini -- InfoMania Printing and Prepress
Apache::Request
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. 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. I've noticed that Apache::Request seems to take advantage of the Apache memory pools to do a lot of it's cleanup - all memory is allocated out of the pools, and the temp files it creates are attached to the pools (via ap_note_cleanups_for_file()) so they are closed when it terminates. I have, on occasion, gotten the error message "[libapreq] could not create tmpfile()" in my apache log file, and returned to my code by parse(). As time goes on, then number of POSTed files required to get the error message seems to decrease (currently it's around 10). Any clues? Here's what I can imagine might be happening (pick one, or suggest another): - the error condition (presumably caused by someone attempting to POST too many files at once) causes a "leak" of the files in that POST. - as the number of apache child processes increase, the max number of files each one can handle decreases. - none of the above. Anyway, I'd appreciate any pointers anyone can give. I've never used the C Apache Module API before, so I'm making a lot of assumptions here... Thanks! -jse
Apache::Request
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. 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. I've noticed that Apache::Request seems to take advantage of the Apache memory pools to do a lot of it's cleanup - all memory is allocated out of the pools, and the temp files it creates are attached to the pools (via ap_note_cleanups_for_file()) so they are closed when it terminates. I have, on occasion, gotten the error message "[libapreq] could not create tmpfile()" in my apache log file, and returned to my code by parse(). As time goes on, then number of POSTed files required to get the error message seems to decrease (currently it's around 10). Any clues? Here's what I can imagine might be happening (pick one, or suggest another): - the error condition (presumably caused by someone attempting to POST too many files at once) causes a "leak" of the files in that POST. - as the number of apache child processes increase, the max number of files each one can handle decreases. - none of the above. Anyway, I'd appreciate any pointers anyone can give. I've never used the C Apache Module API before, so I'm making a lot of assumptions here... Thanks! -jse
Re: IPC::Semaphore permission denied question
On Mon, 10 Apr 2000, Jeff Gleixner wrote: > Been running a mod_perl/Mason enabled server for a while, now I want to > change the owner of the process to "www", from "nobody". In doing so I > get: > > Permission denied at > /usr/local/lib/perl5/site_perl/5.005/Apache/Session/SysVSemaphoreLocker.pm > line 46. > > if (!$self->{sem}) { > $self->{sem} = new IPC::Semaphore($self->{sem_key}, > $self->{nsems}, > IPC_CREAT | S_IRWXU) || die "$!"; # this is line 46 > } > > > I've changed the ownership of every file that was previously owned by > nobody to www. Just wondering what I need to change to get it to work. You don't need to change file permissions, you need to change semaphore permissions. Use ipcs and ipcrm, as root, to fix the problem. Also try searching the archive for more info. -jwb
RE: Deprecated warnings in Apache::DBI
[EMAIL PROTECTED] (Paul G. Weiss) wrote: >Well if it is lexical shouldn't it suppress the warnings >anyhow? Remember that the 'use' is lexically inside the >BEGIN block where I have the pragma. Yeah, but the line producing the warning isn't, and that's what counts for lexicals. >Any in any case: > >BEGIN { >no warnings qw(deprecated); >local $^W=0; >use Apache::DBI (); >} > >doesn't suppress the error. That's kind of surprising. Someone with 5.6 will probably have to sort this out with you, or even better, patch Apache::DBI. As I said earlier, the warning is probably right - using defined on aggregates is seldom a good idea, and that's been true and documented for a really long time. See perlfunc(1): You may also use defined() to check whether a subroutine exists. On the other hand, use of defined() upon aggregates (hashes and arrays) is not guaranteed to produce intuitive results, and should probably be avoided. ... Currently, using defined() on an entire array or hash reports whether memory for that aggregate has ever been allocated. So an array you set to the empty list appears undefined initially, and one that once was full and that you then set to the empty list still appears defined. ... This counterintuitive behaviour of defined() on aggregates may be changed, fixed, or broken in a future release of Perl. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: OT: (sort of) AuthDBMUserFile
According to Stas Bekman: > On Mon, 10 Apr 2000, Bill Jones wrote: > > AuthDBMUserFile > > > > Is there a difference between DBM and GDBM? > > I always thought they were the same... > > > > I found sleepcat (DB) and GDBM, but where is DBM? > sleepycat == berkeley db (a product of sleepycat.com) > > gdbm == gnu dbm library > > dbm == a global name for all UNIX dbm implementations. This is the > name of the database type, like RDBMS or flat file are the names of the > relational DB implementations driven by SQL and simple text file > with line/record respectively... > > But this should go to the perl newsgroup the best... It turns out to be a long story, because both the gdbm and db libraries offer ndbm emulation, which is the interface that apache actually uses, so when you build mod_perl you end up with whichever library was linked first by the perl compile. If you build apache without mod_perl you end up with whatever appears to be be your ndbm library which will vary between systems, and especially Linux distributions. Some use gdbm - RedHat uses db but seems to have switched to the file-incompatible 2.x version in their 6.0 release. You may have to work a bit to get both apache and perl to use the same library and you are likely to have trouble copying the dbm file from one system to another or even using it after an upgrade. Les Mikesell [EMAIL PROTECTED]
IPC::Semaphore permission denied question
Been running a mod_perl/Mason enabled server for a while, now I want to change the owner of the process to "www", from "nobody". In doing so I get: Permission denied at /usr/local/lib/perl5/site_perl/5.005/Apache/Session/SysVSemaphoreLocker.pm line 46. if (!$self->{sem}) { $self->{sem} = new IPC::Semaphore($self->{sem_key}, $self->{nsems}, IPC_CREAT | S_IRWXU) || die "$!"; # this is line 46 } I've changed the ownership of every file that was previously owned by nobody to www. Just wondering what I need to change to get it to work. Thanks -- Jeff Gleixner What I've learned so far, from a kid's point of view : Don't tell a teacher your dog ate your homework, especially if you don't have a dog.
Re: OT: (sort of) AuthDBMUserFile
On Mon, 10 Apr 2000, Bill Jones wrote: > AuthDBMUserFile > > Is there a difference between DBM and GDBM? > I always thought they were the same... > > I found sleepcat (DB) and GDBM, but where is DBM? perldoc GDBM_File: DESCRIPTION GDBM_File is a module which allows Perl programs to make use of the facilities provided by the GNU gdbm library. perldoc DB_File: NAME DB_File - Perl5 access to Berkeley DB version 1.x sleepycat == berkeley db (a product of sleepycat.com) gdbm == gnu dbm library dbm == a global name for all UNIX dbm implementations. This is the name of the database type, like RDBMS or flat file are the names of the relational DB implementations driven by SQL and simple text file with line/record respectively... But this should go to the perl newsgroup the best... __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide/ mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
Re: Apache::Cookie problems
Hi! > get-cookie.html > -- > <% > use Apache::Cookie; > my $cookie_ref = Apache::Cookie->fetch; > my $conf_cookie = $cookie_ref->{conf}; > my %hash = $conf_cookie->value; ^^^ thats it, now I understand! many thanks, it was too late last night for me ;-) Nevertheless I now store the values in a tied Apache::Session-hash, because so nobody can access my internal variables by setting an own cookie :-) If someone want to relax from hard coing work: Visit http://www.assoziations-blaster.de/english/ (cookies are set for the user's config). It's an Non-Commercian net.art project, the main feature is real-time linking of Texts, completely written in mod_perl :-) Ciao Alvar -- Alvar Freude [EMAIL PROTECTED] Besuche den Assoziations-Blaster: http://www.assoziations-blaster.de/
A patch for Registry.pm (Against v1.22) (fwd)
Sorry for the repost. I typo'd in the Subject line(!) and I thought that the message might get skipped over. --- Original message Reading through the Handling Errors section of the Eagle book, I was unable to use $ENV{REDIRECT_ERROR_NOTES} to report on errors generated by registry scripts. This patch corrects the problem in a clean, standard Apache way. I don't think this will step on any toes, since in the case of a Registry error, $r->notes('error-notes') was empty anyway... I'm somewhat surprised that $r->log_error() doesn't set r->notes('error-notes') itself! Should it? I hope this helps others out. I really like the idea of giving something back (even something so small!) to this community from which I've received such utility and help. *** Registry.pm Tue Mar 14 23:55:28 2000 --- RegistryTom.pm Sun Apr 9 09:54:14 2000 *** *** 152,157 --- 152,158 } if($errsv) { + $r->notes('error-notes' => $errsv); $r->log_error($errsv); return SERVER_ERROR unless $Debug && $Debug & 2; return Apache::Debug::dump($r, SERVER_ERROR); -- -- Tom Mornini -- InfoMania Printing and Prepress
Re: [OT] anchoring regexp
"J. Horner" wrote: > Sorry, it is a Monday. I attached the right file. You're problem is that you have toomuch other junk in addition to the statements you're trying to compare. Also, the strings you're matching against are all so short that you wont see much difference between an anchored and unanchored regex. If you want to see the timing advantage demonstrated, try something like this instead: use Benchmark; my $iter = 1; my $listsize = 100; my @internals = (); sub make_rand_str (;$) { my $maxstr = shift || 200; my $str = ''; for (1 .. int(rand($maxstr)+1)) { $str .= chr( ord(' ') + int(rand(127-ord(' '))) ); } return $str; } for (1 .. $listsize) { push @internals, make_rand_str(); } sub unanchored { grep { /134\.167/ } @internals; } sub anchored { grep { /^134\.167/ } @internals; } timethese($iter, { unanchored => 'unanchored()', anchored => 'anchored()', }); -- Devin Ben-Hur | President / CTO | mailto:[EMAIL PROTECTED] The eMarket Group | eMerchandise.com | http://www.eMerchandise.com 503/944-5044 x228 | "Where do you want to go today?" "Confutatis maledictis, flammis acribus addictis" (The damned and accursed are convicted to the flames of hell)
Re: front end proxy and virtual hosts
On Mon, 10 Apr 2000, Eric Cholet wrote: > The front-end light server, serving static requests and proxying > dynamic requests to a back-end modperl server, is well documented, > except in the case of virtual hosts. How do you do it? Specifically, > do you setup virtual hosts on the backend server? Different IPs, or > different ports? Or just a flat url space, using mod_rewrite on the > front-end to translate the urls? I use static IP's and virtualhosts on the front-ends (we're investigating using our Foundry ServerIron load balancer to rewrite the HTTP headers to allow for name-based virtual servers on the front-ends). mod_rewrite handles proxying the dynamic requests and apparently mod_proxy automatically adds the correct headers for name-based virtual hosts on the back end. This all takes a while to setup, but it works flawlessly once it is done. -- -- Tom Mornini -- InfoMania Printing and Prepress
Re: [OT] anchoring regexp
"J. Horner" wrote: > Sorry, it is a Monday. I attached the right file. -- Devin Ben-Hur | President / CTO | mailto:[EMAIL PROTECTED] The eMarket Group | eMerchandise.com | http://www.eMerchandise.com 503/944-5044 x228 | "Where do you want to go today?" "Confutatis maledictis, flammis acribus addictis" (The damned and accursed are convicted to the flames of hell)
A path for Registry.pm (Against v1.22)
Reading through the Handling Errors section of the Eagle book, I was unable to use $ENV{REDIRECT_ERROR_NOTES} to report on errors generated by registry scripts. This patch corrects the problem in a clean, standard Apache way. I don't think this will step on any toes, since in the case of a Registry error, $r->notes('error-notes') was empty anyway... I'm somewhat surprised that $r->log_error() doesn't set r->notes('error-notes') itself! Should it? I hope this helps others out. I really like the idea of giving something back (even something so small!) to this community from which I've received such utility and help. *** Registry.pm Tue Mar 14 23:55:28 2000 --- RegistryTom.pm Sun Apr 9 09:54:14 2000 *** *** 152,157 --- 152,158 } if($errsv) { + $r->notes('error-notes' => $errsv); $r->log_error($errsv); return SERVER_ERROR unless $Debug && $Debug & 2; return Apache::Debug::dump($r, SERVER_ERROR); -- -- Tom Mornini -- InfoMania Printing and Prepress
Re: Newbie help - mod_perl use
On Mon, 10 Apr 2000, Ron Beck wrote: > What does the following do for you... > > > > SetHandler perl-script > PerlHandler Apache::Registry > Options ExecCGI > > > > The "Porting CGI Scripts" recommended including this in my httpd.conf > file. I assumed it was so I didn't have to put all my scripts into a > single directory. Is this not correct? > No, that should work. Did you run any benchmarks against your server before implementing mod_perl, and after to see if it does any good? J. J. Horner Linux, Apache, Perl, Unix, Stronghold [EMAIL PROTECTED] http://www.knoxlug.org System has been up: 9 days.
Re: [OT] anchoring regexp
On Mon, 10 Apr 2000, Devin Ben-Hur wrote: > $ diff first anchored > 1c1 > < sub first { > --- > > sub anchored { > 9a10 > > my $request = join(" ",$method,$uri); > > The only difference between your two benchmark subroutines are their > names, and that the anchored one also composes your $request variable. > Of course anchored will take a little longer -- it has one extra > statement. > > Sorry, it is a Monday. I attached the right file. J. J. Horner Linux, Apache, Perl, Unix, Stronghold [EMAIL PROTECTED] http://www.knoxlug.org System has been up: 9 days. #!/usr/bin/perl -w # # This script is used to benchmark various algorithms for checking the log file. # It uses the Benchmark module and some sloppy coding. use Benchmark; my @internals = ("192.168","ornl.gov","134.167","199.201","128.219","198.124","198.207","160.91","198.136","198.148","fueleconomy.gov","172.17","172.20"); sub first { my $i; my @fields = ("134.167.1.1","","","","","GET","/","HTTP/1.0","404",""); my $source = $fields[0]; $fields[5] =~ s/\"//; $fields[7] =~ s/\"//; my $method = $fields[5]; my $uri = $fields[6]; my $protocol = $fields[7]; my $status = $fields[$#fields-1]; for ($i = 0; $i <= $#internals ; $i++) { if ($source =~ /$internals[$i]/) { } } } sub anchored { my $i; my @fields = ("134.167.1.1","","","","","GET","/","HTTP/1.0","404",""); my $source = $fields[0]; $fields[5] =~ s/\"//; $fields[7] =~ s/\"//; my $method = $fields[5]; my $uri = $fields[6]; my $protocol = $fields[7]; my $status = $fields[$#fields-1]; for ($i = 0; $i <= $#internals ; $i++) { if ($source =~ /^$internals[$i]/) { } } } timethese(5000, { first => 'first()',anchored => 'anchored()', });
Re: windows 98 apache and perl
Harald, Randy Kobes has been keeping the Win32 mod_perl crowd happy for the last few months with his compile that is available at: ftp://theoryx5.uwinnipeg.ca/pub/other/ (the link is on the perl.apche.org home page as well :^) ). Jeffery Baker has a version as well, but it is not as up to date. Compiling on the Win98 is not an easy task and unless there is somthing specific you need to have compiled in I would recommend using one of the above. Someone please correct me if I am wrong, but Randy's is compiled with VC 6 and Jeffery's is compiled with VC 5.0, which if you have VC and want to compile in additional modules you would want to have the same compiler. I have compiled my own under NT with VC 5.0 and used it on 9x with no problem. I have also installed and tested both of the above in the past and they have worked very well. Aaron Johnson Light Software wrote: > Is it possible to install apache and perl succesfully on windows 98 ? > > I have tried and failed ! > > I want to run server-side perl script on apache... > > Is there anyone in this mailing list that has installed apache and perl > succesfully on windows 98 so that this is possible ? > > Please let me know... > > Please also send a copy of your reply to: > [EMAIL PROTECTED] > > Greetings > Harald > > __ > Get Your Private, Free Email at http://www.hotmail.com
Re: Newbie help - mod_perl use
What does the following do for you... SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI The "Porting CGI Scripts" recommended including this in my httpd.conf file. I assumed it was so I didn't have to put all my scripts into a single directory. Is this not correct? Ron "J. Horner" wrote: > > On Mon, 10 Apr 2000, Ron Beck wrote: > > > > > Hello all, > > I have built Apache 1.3.12 and mod_perl 1.22 and everything seems to be > > running fine. I have verified that mod_perl.c shows up as one of the > > compiled-in modules. How can I test or verify that my perl cgi scripts > > are actually running via mod_ perl rather than simply executing? Is > > there a section in some document you can point me to? > > > > In order for you to get full mod_perl speed, you will need to put all of > your mod_perl enabled cgi scripts into a directory and tell mod_perl to > interpret that directory and all perl scripts contained within. > Otherwise, you are just taking advantage of the built-in interpreter. > > Jon > > J. J. Horner > Linux, Apache, Perl, Unix, Stronghold > [EMAIL PROTECTED] http://www.knoxlug.org > System has been up: 9 days.
Re: [OT] anchoring regexp
"J. Horner" wrote: > On Mon, 10 Apr 2000, Jason Simms wrote: > > As to your problem, I doubt people can be of much assistance (though we'll > > see) without seeing the regex and sample data. Perhaps if you resent that?? > > > > In any case, good luck. And perhaps, stay in touch, or put me on a mailing > > list, or something. Thanks! > You have a good point. Sorry about the lack of code. > > Here is my analyzer_benchmark script that will show you the code. $ diff first anchored 1c1 < sub first { --- > sub anchored { 9a10 > my $request = join(" ",$method,$uri); The only difference between your two benchmark subroutines are their names, and that the anchored one also composes your $request variable. Of course anchored will take a little longer -- it has one extra statement. -- Devin Ben-Hur | President / CTO | mailto:[EMAIL PROTECTED] The eMarket Group | eMerchandise.com | http://www.eMerchandise.com 503/944-5044 x228 | "Where do you want to go today?" "Confutatis maledictis, flammis acribus addictis" (The damned and accursed are convicted to the flames of hell)
Re: Newbie help - mod_perl use
On Mon, 10 Apr 2000, Ron Beck wrote: > > Hello all, > I have built Apache 1.3.12 and mod_perl 1.22 and everything seems to be > running fine. I have verified that mod_perl.c shows up as one of the > compiled-in modules. How can I test or verify that my perl cgi scripts > are actually running via mod_ perl rather than simply executing? Is > there a section in some document you can point me to? Ron, The excellent guide covers this in detail. How can I tell whether mod_perl is running? http://perl.apache.org/guide/install.html#How_can_I_tell_whether_mod_perl_ Read it, Learn it, Bookmark it. - Baiju Thakkar http://www.perlmonth.comhttp://www.linuxmonth.com Just use Perl; #!/boot/linux
RE: Newbie help - mod_perl use
http://perl.apache.org/guide/install.html#How_can_I_tell_whether_mod_perl_ :) --Geoff > -Original Message- > From: Ron Beck [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 10, 2000 1:28 PM > To: modperl > Subject: Newbie help - mod_perl use > > > > Hello all, > I have built Apache 1.3.12 and mod_perl 1.22 and everything > seems to be > running fine. I have verified that mod_perl.c shows up as one of the > compiled-in modules. How can I test or verify that my perl > cgi scripts > are actually running via mod_ perl rather than simply executing? Is > there a section in some document you can point me to? > > Thanks & regards, > Ron >
Newbie help - mod_perl use
Hello all, I have built Apache 1.3.12 and mod_perl 1.22 and everything seems to be running fine. I have verified that mod_perl.c shows up as one of the compiled-in modules. How can I test or verify that my perl cgi scripts are actually running via mod_ perl rather than simply executing? Is there a section in some document you can point me to? Thanks & regards, Ron
OT: (sort of) AuthDBMUserFile
AuthDBMUserFile Is there a difference between DBM and GDBM? I always thought they were the same... I found sleepcat (DB) and GDBM, but where is DBM? ??? - FCCJ * 501 W State St * Jacksonville, Fl 32202 * 904/632-3089 -
Re: [OT] anchoring regexp
On Mon, 10 Apr 2000, Jason Simms wrote: > I have a question first, then some insight as to why you may be having the > problem... First, is this Knoxville, TN? I lived there for 17 years of my > life, and only recently (1.5 years ago) moved up to New York City. I left > due to lack of businesses in Knoxville using Linux / UNIX and Perl, along > with other more advanced Web technologies. I can say the market for > hardcore UNIX / perl (what I do) is much stronger up here than down htere, > but I am always interested in the possibility of moving back down there with > my skills. > > As to your problem, I doubt people can be of much assistance (though we'll > see) without seeing the regex and sample data. Perhaps if you resent that?? > > In any case, good luck. And perhaps, stay in touch, or put me on a mailing > list, or something. Thanks! Well, there isn't really anything in Knoxville, but Oak Ridge is pretty busy. You have a good point. Sorry about the lack of code. Here is my analyzer_benchmark script that will show you the code. J. J. Horner Linux, Apache, Perl, Unix, Stronghold [EMAIL PROTECTED] http://www.knoxlug.org System has been up: 9 days. #!/usr/bin/perl -w # # This script is used to benchmark various algorithms for checking the log file. # It uses the Benchmark module and some sloppy coding. use Benchmark; my @internals = ("192.168","ornl.gov","134.167","199.201","128.219","198.124","198.207","160.91","198.136","198.148","fueleconomy.gov","172.17","172.20"); sub first { my $i; my @fields = ("134.167","","","","","GET","/","HTTP/1.0","404",""); my $source = $fields[0]; $fields[5] =~ s/\"//; $fields[7] =~ s/\"//; my $method = $fields[5]; my $uri = $fields[6]; my $protocol = $fields[7]; my $status = $fields[$#fields-1]; for ($i = 0; $i <= $#internals ; $i++) { if ($internals[$i] =~ /$source/) { } } } sub anchored { my $i; my @fields = ("134.167","","","","","GET","/","HTTP/1.0","404",""); my $source = $fields[0]; $fields[5] =~ s/\"//; $fields[7] =~ s/\"//; my $method = $fields[5]; my $uri = $fields[6]; my $protocol = $fields[7]; my $request = join(" ",$method,$uri); my $status = $fields[$#fields-1]; for ($i = 0; $i <= $#internals ; $i++) { if ($internals[$i] =~ /$source/) { } } } timethese(5000, { first => 'first()',anchored => 'anchored()', });
[OT] anchoring regexp
I bought a new book this weekend: the wolf book. I'm enjoying it. I came from an engineering background, so anything that gives comp sci theory is good. I read in the book, and I've always suspected, that anchoring regular expressions will speed them up. I'm finding that after 5000 iterations, the unanchored is slightly faster (about 1/10th of a second). This isn't a significant problem, but when checking http logs that are 10 lines long for 18 different machines, it will add up to a few seconds. Can anyone give me a clue as to why this isn't true? By the way, with each book I buy from O'Reilly on Perl (starting with the Schwartz Bible), I learn more and more. I'm really pleased with the books. Thanks to all the authors who are reading (Randal, Doug, Lincoln, et al). J. J. Horner Linux, Apache, Perl, Unix, Stronghold [EMAIL PROTECTED] http://www.knoxlug.org System has been up: 9 days.
RE: front end proxy and virtual hosts
> EC> do you setup virtual hosts on the backend server? Different IPs, or > EC> different ports? Or just a flat url space, using mod_rewrite on the > EC> front-end to translate the urls? > > I think I posted this example earlier. This is just a snippet of the > relevant portions of the front/back end virtual configs. It is not a > cookie-cutter example! > > Basically, I use unique port number virtuals on the back-ends (so I > can redirect to localhost: bypassing some networking cruft) and > name-based virtuals on the front end, though any technique on the > front end will do. > > I set "Port 80" on the back-end so that any redirects don't get sent > directly to the back-end. Sometimes I also bind tightly to address > 127.0.0.1 to prevent any outside connections when the two are on the > same box. Vivek, Thanks a lot for your input. > ### > # > # Get "real" remote IP address from Proxy and set it as our connection's > # IP address so logging, etc., use that IP address. Uses mod_perl handler. > # For some reason, must be set per-virtual host. > # > ### > > PerlPostReadRequestHandler My::ProxyRemoteAddr This is no longer necessary with mod_perl >= 1.22, i.e. it can be put in the main server config and will be inherited (merged) in virtual hosts. -- Eric
Re: front end proxy and virtual hosts
> "EC" == Eric Cholet <[EMAIL PROTECTED]> writes: EC> do you setup virtual hosts on the backend server? Different IPs, or EC> different ports? Or just a flat url space, using mod_rewrite on the EC> front-end to translate the urls? I think I posted this example earlier. This is just a snippet of the relevant portions of the front/back end virtual configs. It is not a cookie-cutter example! Basically, I use unique port number virtuals on the back-ends (so I can redirect to localhost: bypassing some networking cruft) and name-based virtuals on the front end, though any technique on the front end will do. I set "Port 80" on the back-end so that any redirects don't get sent directly to the back-end. Sometimes I also bind tightly to address 127.0.0.1 to prevent any outside connections when the two are on the same box. Stas, feel free to incorporate this example. front end: ServerName www.morebusiness.com ServerAlias morebusiness.com RewriteEngine On RewriteOptions 'inherit' # handle GIF and JPG images directly RewriteRule \.(gif|jpg|png|css|txt|cgi)$ - [last] RewriteRule ^/cgi-bin - [last] # pass off everything but images to the heavy-weight server via proxy RewriteRule ^/(.*)$ http://localhost:4077/$1 [proxy] Alias /_homepage /web/morebusiness/docs/_homepage-default Alias /_pageparts /web/morebusiness/docs/_pageparts-default ServerName govcon.morebusiness.com RewriteEngine On RewriteOptions 'inherit' # handle GIF and JPG images directly RewriteRule \.(gif|jpg|png|css|txt|cgi)$ - [last] RewriteRule ^/cgi-bin - [last] # pass off everything but images to the heavy-weight server via proxy RewriteRule ^/(.*)$ http://localhost:4078/$1 [proxy] Alias /_homepage /web/morebusiness/docs/_homepage-govcon Alias /_pageparts /web/morebusiness/docs/_pageparts-govcon back-end: Port 80 Listen 4077 ServerName www.morebusiness.com Port 80 DirectoryIndex index.brc index.ibrc index.shtml index.html ### # # Get "real" remote IP address from Proxy and set it as our connection's # IP address so logging, etc., use that IP address. Uses mod_perl handler. # For some reason, must be set per-virtual host. # ### PerlPostReadRequestHandler My::ProxyRemoteAddr Alias /_homepage /web/morebusiness/docs/_homepage-default Alias /_pageparts /web/morebusiness/docs/_pageparts-default Listen 4078 ServerName govcon.morebusiness.com Port 80 DirectoryIndex index.brc index.ibrc index.shtml index.html PerlPostReadRequestHandler My::ProxyRemoteAddr Alias /_homepage /web/morebusiness/docs/_homepage-govcon Alias /_pageparts /web/morebusiness/docs/_pageparts-govcon
Re: ./httpd -l
> "JG" == James Gosnell <[EMAIL PROTECTED]> writes: JG> When I run ./httpd -l should I see mod_perl.c in the list of modules? Depends if you compiled it into your httpd... ;-) If you compiled mod_perl as a DSO module, then no. If you compiled mod_perl statically, then yet. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 PGP & MIME spoken herehttp://www.kciLink.com/home/khera/
RE: Deprecated warnings in Apache::DBI
Well if it is lexical shouldn't it suppress the warnings anyhow? Remember that the 'use' is lexically inside the BEGIN block where I have the pragma. >From the command line: perl -wc Apache/DBI.pm produces the error while perl -M-warnings=deprecated Apache/DBI.pm doesn't. Any in any case: BEGIN { no warnings qw(deprecated); local $^W=0; use Apache::DBI (); } doesn't suppress the error. -P -Original Message- From: Ken Williams [mailto:[EMAIL PROTECTED]] Sent: Monday, April 10, 2000 8:22 AM To: Paul G. Weiss Cc: '[EMAIL PROTECTED]' Subject: Re: Deprecated warnings in Apache::DBI I don't have 5.6 to test this, but isn't the warnings pragma lexical and not dynamic now? Which means it's doing the right thing. Also, it's probably right - shouldn't Apache::DBI be changed? Perhaps doing "local $^W;" instead of "no warnings qw(deprecated);" will be a bandaid for you. [EMAIL PROTECTED] (Paul G. Weiss) wrote: >In my startup.pl I have > >BEGIN >{ >no warnings qw(deprecated); >use Apache::DBI; >} > >yet when starting the server I always see > >defined(@array) is deprecated at >/usrl1/home/pweiss/perl-56/lib/site_perl/5.6.0/Apache/DBI.pm line 135. >(Maybe you should just omit the defined()?) > > >Shouldn't 'no warnings' suppress this? > >-P > ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: Deprecated warnings in Apache::DBI
I don't have 5.6 to test this, but isn't the warnings pragma lexical and not dynamic now? Which means it's doing the right thing. Also, it's probably right - shouldn't Apache::DBI be changed? Perhaps doing "local $^W;" instead of "no warnings qw(deprecated);" will be a bandaid for you. [EMAIL PROTECTED] (Paul G. Weiss) wrote: >In my startup.pl I have > >BEGIN >{ >no warnings qw(deprecated); >use Apache::DBI; >} > >yet when starting the server I always see > >defined(@array) is deprecated at >/usrl1/home/pweiss/perl-56/lib/site_perl/5.6.0/Apache/DBI.pm line 135. >(Maybe you should just omit the defined()?) > > >Shouldn't 'no warnings' suppress this? > >-P > ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: Segfault on DBI->Connect (was mod_perl and AuthenDBI headaches)
Hi, after some browsing of the [EMAIL PROTECTED] archives, I see now that my AuthDBI problem is the same as this thread (Segfault on DBI->Connect). I tried the workaround suggested by wil (*sock=0 before mysql_init(sock)) to no avail. Here's a backtrace from gdb httpd -X. Has any headway been made on this problem? If you need more information, let me know... Drew Starting program: /usr/local/apache/bin/httpd -X Program received signal SIGSEGV, Segmentation fault. mysql_close (mysql=0x0) at libmysql.c:1555 1555 end_server(mysql); (gdb) bt #0 mysql_close (mysql=0x0) at libmysql.c:1555 #1 0x403bf254 in __DTOR_END__ () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #2 0x403ac0dd in mysql_dr_connect () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #3 0x403ac420 in _MyLogin () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #4 0x403ac48f in mysql_db_login () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #5 0x403affd8 in XS_DBD__mysql__db__login () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so #6 0x80eba06 in Perl_pp_entersub () #7 0x81159ad in Perl_runops_standard () #8 0x80bddf1 in perl_call_sv () #9 0x4039ce81 in XS_DBI_dispatch () from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBI/DBI.so #10 0x80eba06 in Perl_pp_entersub () #11 0x81159ad in Perl_runops_standard () #12 0x80bddf1 in perl_call_sv () #13 0x806426b in perl_call_handler () #14 0x8063c1d in perl_run_stacked_handlers () #15 0x806295d in perl_handler () #16 0x807c013 in ap_invoke_handler () #17 0x808f559 in process_request_internal () #18 0x808f5bc in ap_process_request () #19 0x8086e5e in child_main () #20 0x8086fec in make_child () #21 0x8087149 in startup_children () #22 0x8087776 in standalone_main () #23 0x8087f03 in main () #24 0x400cc1eb in __libc_start_main (main=0x8087bbc , argc=2, argv=0xbd74, init=0x80605a4 <_init>, fini=0x8115a8c <_fini>, rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbd6c) at ../sysdeps/generic/libc-start.c:90 (gdb)
RE: Apache::URI port() problem
> Hello, > > It seems the method unparse() of Apache::URI does not take the port > value into the result string. For example, I have: > > my $uri = Apache::URI->parse($r, $r->uri); > $uri->scheme('http'); > $uri->hostname($r->get_server_name); > $uri->port(8080); > $uri->query(scalar $r->args); > > If I call $uri->unparse(), the string returned does not have port 8080 > in it. Can anyone shed some light? Thanks. > > Fred Xia Can you try this patch? Index: URI.xs === RCS file: /home/cvs/modperl/src/modules/perl/URI.xs,v retrieving revision 1.5 diff -b -u -u -r1.5 URI.xs --- URI.xs 1998/11/13 03:27:52 1.5 +++ URI.xs 2000/04/10 10:57:54 @@ -183,6 +183,9 @@ CODE: get_set_PVp(uri->uri.port_str,uri->pool); +if (items > 1) { +uri->uri.port = (int)SvIV(ST(1)); +} OUTPUT: RETVAL -- Eric
Deprecated warnings in Apache::DBI
In my startup.pl I have BEGIN { no warnings qw(deprecated); use Apache::DBI; } yet when starting the server I always see defined(@array) is deprecated at /usrl1/home/pweiss/perl-56/lib/site_perl/5.6.0/Apache/DBI.pm line 135. (Maybe you should just omit the defined()?) Shouldn't 'no warnings' suppress this? -P
Re: windows 98 apache and perl
Light Software wrote: > > Is it possible to install apache and perl succesfully on windows 98 ? > > I have tried and failed ! > > I want to run server-side perl script on apache... > > Is there anyone in this mailing list that has installed apache and perl > succesfully on windows 98 so that this is possible ? I've been using Randy Kobes' binary distribution of apache/perl/modperl/embperl for Win98 without (real) problems for a year or so: ftp://theoryx5.uwinnipeg.ca/pub/other/ - Robert
front end proxy and virtual hosts
Hi, The front-end light server, serving static requests and proxying dynamic requests to a back-end modperl server, is well documented, except in the case of virtual hosts. How do you do it? Specifically, do you setup virtual hosts on the backend server? Different IPs, or different ports? Or just a flat url space, using mod_rewrite on the front-end to translate the urls? The modperl guide is sadly lacking any information in this area, so your input will be valuable. Thanks, -- Eric
windows 98 apache and perl
Is it possible to install apache and perl succesfully on windows 98 ? I have tried and failed ! I want to run server-side perl script on apache... Is there anyone in this mailing list that has installed apache and perl succesfully on windows 98 so that this is possible ? Please let me know... Please also send a copy of your reply to: [EMAIL PROTECTED] Greetings Harald __ Get Your Private, Free Email at http://www.hotmail.com
RE: internal_redirect
> Hi All > > I have a module that displays a selection of FORMs for the user to pick > from. The FORMs have TARGET='_BLANK'. The submitted form data is sent to a > different module which parses the data and uses 'open' to call an external > perl script to generate a file and returns the full disk path of the file > via STDOUT back to the module. The module then converts that pathname to a > local URI which it verifies using $r->lookup_uri($outfile_uri). The module > then calls > > $r->internal_redirect($outfile_uri); > return OK; > > The browser (Netscape 4.7) just spins until it times out with a messages > saying "document returned no data". If I paste the URI into a new browser > window, the generated file appears as expected. > > If I set FORM ACTION=/cgi-bin/printenv, for example, the output appears in > a new browser window normally. I'm about to try it with IE and also without > the TARGET='_BLANK', but I don't expect either of those two changes to > help. Does anyone have any suggestions as to which step in this process > might be dropping the ball? > > Thanks in advance > Bill Are you using POST in the form by any chance? In which case before you redirect you have to turn that into a GET: if ($r->method eq 'POST') { $r->method('GET'); $r->method_number(M_GET); $r->headers_in->unset('Content-Length'); } -- Eric