embperl beginner
Can somebody help me for telling steps that embperl works. I saw a code in the example page like: [$ while ($k, $v) = each (%ENV) $] [+ $k +] = [+ $v +] [$ endwhile $] How can I use it? Should I save it as test.pl and compile with command perl test.pl? I went over the embperl web but still don't understand... I have apache1.3.9, mod_perl1.21, IRIX6.4, perl5.00502 in my machine. Thanks in advance, --apple
Re: module for pushing?
On Mon, 4 Oct 1999, Jim Serio wrote: > Is it possible to write > a Perl module to automatically push content which > is controlled via a CGI? Yeah. You don't even need to use a Perl module, or mod_perl to do it. A plain CGI will work fine. I could never get it to work in IE, though, or find any docs for IE as to how to do it... http://fishcam.netscape.com/assist/net_sites/pushpull.html tells you how. -- Michael Allen Plump | Snorks + Kr0n = yip yip yip! | [EMAIL PROTECTED] "Salsa jazz music reminds me of the time my grandpa ate his left ear." --Joe Dietz
Re: MOD_PERL question
Have any of you guys used "Sempaphores" in Perl or MOD_PERL. Thanks a lot for all the help. I used IPC::Shareable module and it works fine. Thanks Mahesh K. Ganesan Tom Christiansen wrote: > >> Can you kindly explain the above with an example. > > >I've never used IPC::Shareable. "perldoc IPC::Shareable" should tell you > > Here's my perennial example: > > use IPC::Shareable; > > $handle = tie $buffer, 'IPC::Shareable', undef, { destroy => 1 }; > $SIG{INT} = sub { die "$$ dying\n" }; > > for (1 .. 10) { > unless ($child = fork) {# i'm the child > die "cannot fork: $!" unless defined $child; > squabble(); > exit; > } > push @kids, $child; # in case we care about their pids > } > > while (1) { > print "Buffer is $buffer\n"; > sleep 1; > } > die "Not reached"; > > sub squabble { > my $i = 0; > while (1) { > next if $buffer =~ /^$$\b/o; > $handle->shlock(); > $i++; > $buffer = "$$ $i"; > $handle->shunlock(); > } > } > > I've had problems with the build of IPC::Shareable on my current > system. Its "make test" fails, and true enough, the Apache::SpeedLimit > module conseuqently fails. Some random linux and/or glibc bug, perhaps. > > --tom > > Summary of my perl5 (revision 5.0 version 5 subversion 56) configuration: > Platform: > osname=linux, osvers=2.0.36, archname=i686-linux > uname='linux jhereg.perl.com 2.0.36 #1 tue oct 13 22:17:11 edt 1998 i686 unknown >' > config_args='' > hint=recommended, useposix=true, d_sigaction=define > usethreads=undef useperlio=undef d_sfio=undef > use64bits=undef usemultiplicity=undef > Compiler: > cc='cc', optimize='-O2', gccversion=2.7.2.3 > cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' > ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' > 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 > alignbytes=4, usemymalloc=n, prototype=define > Linker and Libraries: > ld='cc', 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.so.6, 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): > Built under linux > Compiled at Mar 13 1999 12:08:09 > %ENV: > PERL_READLINE_NOWARN="1" > @INC: > /usr/local/perl/lib/i686-linux > /usr/local/perl/lib > /usr/local/site_perl/i686-linux > /usr/local/site_perl > .
Changing apachectl Defaults
Greetings, Is there an easy way to change where apachectl looks for the apache httpd and config files short of recompiling modperl? Per the Apache Modules book pg 26, I copied the httpd by hand from the Apache source directory to my server root directory. Thank you, John Kent
Re: Apache::EmbperlFilter - Subtle Problem Solved
On Mon, 4 Oct 1999, Owen Stenseth wrote: > First thanks to Mike for figuring out how to use Embperl with > Apache::Filter. A couple of subtle things are still causing problems. I > have a solution for one but not for the others. > > The following line needs to be added as part of the params sent to > Execute: > > $param{inputfile} = $r->filename; This is true, and it *is* in my handler. Actually though, this will *fail* if the input that your are filtering is actually generated dynamically (e.g.: a Registry script that spits out html with embperl commands in it). This is because of the caching mechanism of embperl. In my case, I can get away with it by setting the $param{mtime} because all of the files I am filtering are from real files. However, the value of $param{inputfile} can really be any random string. This is how you can force a recompile. Before I release my module, I plan to implement some mechanism to force a recompile. I will probably resort to some PerlSetEnv directive to set EMBPERL_FILTER_RECOMPILE or something and if that variable is set, then I'll just generate some random string and pass that as the inputfile parameter. > Onto the unsolved problems: > > 1. I get Stack Underflow errors every once in a while from Embperl on > pages that work fine on a reload. This sounds like a caching problem to me. Make sure you test with httpd -X so you are getting the same server process for each request. > 2. If I change the order of Apache::SSI and Apache::EmbperlFilter in the > PerlHandler section of my configuration Apache::SSI outputs the server > side includes and prints them to the browser instead of to Embperl. This > is with Filter On. I am unsure what is going on here. Apache::SSI needs to be the last module (someone else pointed this out already). Mike
Re: your mail
Perl's "-T" flag turns on taint checking. Check out the perlsec manpage for more info. Briefly, though, taint checking tells perl (among other things) not to trust environment variables such as $ENV{PATH}, and warn you if you make any implicit use of them when you run UNIX commands. You can avoid this error by explicitly setting the PATH before you execute external commands: $ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin"; -Rob von Behren On Sat, 2 Oct 1999, Pepi wrote: > Greetings, > > Does anyone now what that server error suggests: > > Insecure $ENV{PATH} while running with -T switch at > /home/web/perl/contact.pl line 46. > > > Close to this line in this source file I have: > > open (SENDMAIL, "| /usr/sbin/sendmail -oi -t") > or unexpected("contact.pl: Can't open sendmail process: $!\n"); > > print SENDMAIL "To:support\@findmax.com\n"; > print SENDMAIL "From:".$input{'email'}."\n"; > print SENDMAIL "Subject: [contact form]".$input{'subject'}."\n\n"; > print SENDMAIL $input{'message'}."\n"; > > close (SENDMAIL) > or intecept("contact.pl: Sendmail did not finish w/ success: $!"); > > > Thank you! > > > __ > Petar Maymounkov Cell: (617) 283-2401 > 166 Quincy Mail CenterHome: (617) 493-3106 > Cambridge, MA 02138Page: [EMAIL PROTECTED] > > >
Re: extra '0' when printing to files other than STDOUT?
Tom Brown <[EMAIL PROTECTED]> writes: > Anyone seen anything like this? > > running modperl 1.21 on linux with a work around for the corrupted PATH > environment variable issue... perl 5.004_05 ... > > write(5, "HELO localhost\nONEX\nMAIL FROM: [EMAIL PROTECTED]\n0RCPT > TO: [EMAIL PROTECTED]\n0RCPT TO: [EMAIL PROTECTED]\n0DATA\nTo: > [EMAIL PROTECTED],[EMAIL PROTECTED]\nFrom: > [EMAIL PROTECTED]\nSubject: Warning, tbrown paid an invoice (7851) > and has held virtuals\n\nWarning, tbrown paid an invoice (7851)\nand has > the following held or scheduled held virtuals:\n\nathleteschoice.net - > 1999-08-02\n\n.\nQUIT\n0", 411) = 411 > close(5)= 0 Is it possible another function or script is doing something like: $\ = 0; It seems to fit the symptoms. If you can locate the code, slap a "local" in front of the assignment and things should work properly. To test if that's the problem, add "local $\ = undef" right before your code. If that fixes it, you know that it's this pesky variable. For more info on $\ and friends, check "man perlvar" for far more than you ever wanted to know about Awk compatibility ;) A minor note -- have you considered a module for your SMTP code instead of hard-coding it? Net::SMTP should work. It handles all the pesky RFC details as well. Plus chances are it'll end up being more portable in the long run. Chip -- Chip Turner [EMAIL PROTECTED] Programmer, ZFx, Inc. www.zfx.com PGP key available at wwwkeys.us.pgp.net
RE: new for embperl...
> > Can somebody help me for telling steps that embperl works. I saw a code in > the example page like: > > [$ while ($k, $v) = each (%ENV) $] > [+ $k +] = [+ $v +] > [$ endwhile $] > > How can I use it? Should I save it as test.pl and compile with command > perl test.pl? I went over the embperl web but still don't understand... > I you like to use it under mod_perl, then you have to modify your httpd.conf: For example (Taken from the "perldoc HTML::Embperl"): SetEnv EMBPERL_DEBUG 2285 Alias /embperl /path/to/embperl/eg SetHandler perl-script PerlHandler HTML::Embperl Options ExecCGI Now restart your server and you can request for example a document "/path/to/embperl/eg/x/loop.htm" with http://localhost/embperl/x/loop.htm Gerald
new for embperl...
Can somebody help me for telling steps that embperl works. I saw a code in the example page like: [$ while ($k, $v) = each (%ENV) $] [+ $k +] = [+ $v +] [$ endwhile $] How can I use it? Should I save it as test.pl and compile with command perl test.pl? I went over the embperl web but still don't understand... Thanks in advance, --apple
extra '0' when printing to files other than STDOUT?
Anyone seen anything like this? running modperl 1.21 on linux with a work around for the corrupted PATH environment variable issue... perl 5.004_05 ... This code: open( MAIL, "| $MAILER" ) || die "can't open $MAILER"; print MAIL <<"EOM"; HELO localhost ONEX MAIL FROM: $from EOM foreach (split(/,/,$to)) { print MAIL <<"EOM"; RCPT TO: $_ EOM } print MAIL <<"EOM"; DATA To: $to From: accounts\@baremetal.com Subject: $subject $body . QUIT EOM close MAIL || die "couldn't close mailer"; is producing the following output when traced: write(5, "HELO localhost\nONEX\nMAIL FROM: [EMAIL PROTECTED]\n0RCPT TO: [EMAIL PROTECTED]\n0RCPT TO: [EMAIL PROTECTED]\n0DATA\nTo: [EMAIL PROTECTED],[EMAIL PROTECTED]\nFrom: [EMAIL PROTECTED]\nSubject: Warning, tbrown paid an invoice (7851) and has held virtuals\n\nWarning, tbrown paid an invoice (7851)\nand has the following held or scheduled held virtuals:\n\nathleteschoice.net - 1999-08-02\n\n.\nQUIT\n0", 411) = 411 close(5)= 0 There's an extra 0 before the two RCPT TO lines, the DATA line, and after the QUIT line. Needless to say, the messages aren't getting out when the relevent SMTP commands are getting corrupted... The "sendmail -bs" technique is usefull when the return envelope address needs to be specified and can't be trusted on the command line. (and isn't really the issue here anyway.) If I kill -HUP the webserver the issue will go away for a while. Anyone have any ideas? I rewrote a major section of the invoice generation code to buffer up the output and use one print statement... in that section it reduced the number of extraneous zeros to one, but that's still ugly... The code is "use strict" and perl -w friendly. everything is my()'d and properly initialized ... That said, those points seem irrelevent, this looks like something nasty inside the perl or mod_perl guts The app was written under mod_perl, and I can post or mail the whole thing if need be. Unfortunately, it takes a while to get the problem to appear, although it's constant once it does. The application does "use CGI;" and proceeds to send all it's normal output to STDOUT as compared to using $cgi->print or anything funky... The box is "internal use only" so I can take it apart and rebuild PERL or whatever, but I'd really rather not have to, since we do use mod_perl on production servers and the advantage has always been that it is so easy to setup... (although perhaps not so easy to code for :-) -Tom
Re: DB connection pooling
According to Stefan Reitshamer: > > Sorry if this is in a FAQ, but I dug through a lot of FAQs and archives and > couldn't find it: > > Is there any database connection pooling built into mod_perl, or DBI? Not exactly, but you can use Apache::DBI to make the connections persistent, and you can greatly reduce the number of httpd's holding connections by using a non-mod_perl front end httpd that uses ProxyPass or RewriteRules to direct the requests that need database service to a mod_perl backend. Les Mikesell [EMAIL PROTECTED]
RE: syntax error parsing httpd.conf
At the risk of irritating you by pressing the issue, I have to agree with Doug, and I've had the same problem with the exact same errors. My null device worked fine for me but the permissions were changed on it so that certain other processes couldn't use it (i.e. apache). Until I cornered the process that was changing the perms on it, I had to remove it and mknod it again. --Jeff Jeff Beard Web Systems Engineer World Wide Web Associates Web: http://wwwa.com Phone: 303.545.2399 :-Original Message- :From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On :Behalf Of Dmitry Beransky :Sent: Monday, October 04, 1999 3:48 PM :To: [EMAIL PROTECTED] :Subject: Re: syntax error parsing httpd.conf : : :Nay, my null device works just fine, but I still keep occasionally getting :these errors for most of mod_perl config directives. One additional piece :of information: it seems that every time this problem shows up, I can get :rid of it simply by rerunning apache's autoconf. : :I can't see any physical connection between the two, but then again, I :don't know much about autoconf. I would appreciate if anyone could point :out what the connection is. : :Regards :Dmitry : : :At 11:55 AM 9/21/99 , Doug MacEachern wrote: :>no, but I've seen it before, your /dev/null device is broken. :>try: :> :>% sudo echo > /dev/null :> :>On Wed, 15 Sep 1999, Dmitry Beransky wrote: :> :> > Hi, :> > :> > My apache/mod_perl combo had been running just fine until :yesterday when :> > all of a sudden (I can't recall making any changes to the setup) all :> > configuration lines containing commands Perl*Handler and PerlModule :> started :> > giving me the following error message: :> > :> > root# apachectl configtest :> > syntax error at /dev/null line 1, near "line arguments:" :> > Execution of /dev/null aborted due to compilation errors. :> > parse: Undefined error: 0 :> > :> > Any ideas what might have caused this?
Re: syntax error parsing httpd.conf
Nay, my null device works just fine, but I still keep occasionally getting these errors for most of mod_perl config directives. One additional piece of information: it seems that every time this problem shows up, I can get rid of it simply by rerunning apache's autoconf. I can't see any physical connection between the two, but then again, I don't know much about autoconf. I would appreciate if anyone could point out what the connection is. Regards Dmitry At 11:55 AM 9/21/99 , Doug MacEachern wrote: >no, but I've seen it before, your /dev/null device is broken. >try: > >% sudo echo > /dev/null > >On Wed, 15 Sep 1999, Dmitry Beransky wrote: > > > Hi, > > > > My apache/mod_perl combo had been running just fine until yesterday when > > all of a sudden (I can't recall making any changes to the setup) all > > configuration lines containing commands Perl*Handler and PerlModule > started > > giving me the following error message: > > > > root# apachectl configtest > > syntax error at /dev/null line 1, near "line arguments:" > > Execution of /dev/null aborted due to compilation errors. > > parse: Undefined error: 0 > > > > Any ideas what might have caused this?
Re: module for pushing?
Writing the server side of this is fairly easy except... Piece of cake with netscape but MS IE does not support this very well. someone asked this question last month. you might want to look into the archives, find out who it was, and how their research went. cliff rayman genwax.com Jim Serio wrote: > Here's my problem > > We are in the process of delivering a Web Cast > and we would like to "control" the delivery of > pages to the browser. For example, let's say you > visit a Web Cast and you only need to load the > first page. Subsequent pages are automatically > pushed from the server. While is sounds like a > "meta refresh" solution, the time between > refreshes will vary. Is it possible to write > a Perl module to automatically push content which > is controlled via a CGI? I doubt it's possible on > the server side but my experience with server > push is limited so maybe some of you experts know. > > Jim > -- > Jim Serio - [EMAIL PROTECTED] > Producer, World of Coasters
Re: proxypass with dynamic DocumentRoot
Perhaps what you're looking for resembles this: RewriteRule ^/(images|static)/ - [S=1] RewriteRule (.+) http://backend$1 [P,L] John D Groenveld wrote: > > I've been using mod_proxy > to proxypass my static content away from my /modperl > directories. Now, I'd like to make my root > dynamic and thus pass everything except /images and > /static. > I've looked at the guide and tuning docs, as well > as the mod_proxy docs, but I must be missing > something. > Thanks, > John > [EMAIL PROTECTED] -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (561) 619-0995
Re: Problems Using DBI / DBD::mysql Within Apache::ASP / mod_perl
Being an Apache module has nothing to do with it, it's who the webserver is as running and what machine the database is hosted on versus what you have in your conenct string. Just because a DBI connection works from your shell doesn't mean it will work identically when run by a web server. [EMAIL PROTECTED] wrote: > > The kicker is that this only becomes a problem while using it as an Apache > module... > > [EMAIL PROTECTED] wrote: > > > Apache mod_perl List, > > > > I am attempting to use DBI / DBD::mysql within Apache::ASP under mod_perl > > and am constantly receiving the following error: > > > > Access denied for user: 'dealerdb@localhost' (Using password: YES) > > > > Should I be using a different module than `use DBI;`? Any help, > > suggestions, or prior experience would be appreciated. Thanks, in > advance. -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (561) 619-0995
proxypass with dynamic DocumentRoot
I've been using mod_proxy to proxypass my static content away from my /modperl directories. Now, I'd like to make my root dynamic and thus pass everything except /images and /static. I've looked at the guide and tuning docs, as well as the mod_proxy docs, but I must be missing something. Thanks, John [EMAIL PROTECTED]
module for pushing?
Here's my problem We are in the process of delivering a Web Cast and we would like to "control" the delivery of pages to the browser. For example, let's say you visit a Web Cast and you only need to load the first page. Subsequent pages are automatically pushed from the server. While is sounds like a "meta refresh" solution, the time between refreshes will vary. Is it possible to write a Perl module to automatically push content which is controlled via a CGI? I doubt it's possible on the server side but my experience with server push is limited so maybe some of you experts know. Jim -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters
RE: Problems Using DBI / DBD::mysql Within Apache::ASP / mod_perl
The kicker is that this only becomes a problem while using it as an Apache module... -Original Message- From: Joshua Chamas [mailto:[EMAIL PROTECTED]] Sent: Friday, October 01, 1999 6:36 PM [EMAIL PROTECTED] wrote: > Apache mod_perl List, > > I am attempting to use DBI / DBD::mysql within Apache::ASP under mod_perl > and am constantly receiving the following error: > > Access denied for user: 'dealerdb@localhost' (Using password: YES) > > Should I be using a different module than `use DBI;`? Any help, > suggestions, or prior experience would be appreciated. Thanks, in advance. There is no problem using DBD::* in mod_perl or Apache::ASP. Perhaps you are not using the right DBI connect strict, maybe the username / password isn't right ? Maybe the database is on another machine ? This is more of a DBI Users <[EMAIL PROTECTED]> or MySQL <[EMAIL PROTECTED]> question. If you can connect to the database via the mysql program, then you should be able to connect to the database via DBD::mysql
Re: DB connection pooling
On Mon, 4 Oct 1999, Stefan Reitshamer wrote: > Is there any database connection pooling built into mod_perl, or DBI? There is no "pooling", but you can get persistent database connections. Have a look at http://perl.apache.org/guide/performance.html#Persistent_DB_Connections for more. - Perrin
Re: DB connection pooling
Stefan Reitshamer wrote: > > Hello, > > Sorry if this is in a FAQ, but I dug through a lot of FAQs and archives and > couldn't find it: > > Is there any database connection pooling built into mod_perl, or DBI? Not really. You could take a run at DBD::Proxy. -jwb -- Jeffrey W. Baker * [EMAIL PROTECTED] Critical Path, Inc. * we handle the world's email * www.cp.net 415.808.8807
DB connection pooling
Hello, Sorry if this is in a FAQ, but I dug through a lot of FAQs and archives and couldn't find it: Is there any database connection pooling built into mod_perl, or DBI? Thanks, - Stefan Reitshamer [EMAIL PROTECTED]
RE: Embperl make test need help...
> > Thank you very much. I got it run already. I can start my http but I still > get some errors. What should I do? Can I ignore these errors or I have > to fix them? --Thanks > > ... > Use of uninitialized value at (eval1218) line 1. > Starting httpd... pid = 5764 ok > > Testing mod_perl mode... > > ascii... > 5764:/opt/local/download/apache_1.3.9/src/httpd: rld: Fatal Error: > attempted access to unresolvable symbol in Apache does not export any symbols. You need to rebuild your Apache with symbols exported. Look in the FAQ for some hints. Gerald
RE: Embperl make test need help...
On Mon, 4 Oct 1999, Gerald Richter wrote: > > Starting httpd... [Mon Oct 4 15:06:44 1999] [crit] (125)Address > > already in use: make_sock: could not bind to port 8529 > > Cannot open test/tmp/httpd.pid at test.pl line 953. > > > There is already a Apache running on port 8529. Stop it and rerun the test. Thank you very much. I got it run already. I can start my http but I still get some errors. What should I do? Can I ignore these errors or I have to fix them? --Thanks ... Use of uninitialized value at (eval1218) line 1. Starting httpd... pid = 5764 ok Testing mod_perl mode... ascii... 5764:/opt/local/download/apache_1.3.9/src/httpd: rld: Fatal Error: attempted access to unresolvable symbol in blib/arch/auto/HTML/Embperl/Embperl.so: mod_perl_sent_header ERR:unexpected EOF before status line seen Input: test/html/ascii Output: test/tmp/out.htm Compared to:test/cmp/error.htm Log:test/tmp/test.log ERRORS detected! NOT all test have been passed successfully Callback called exit. END failed--cleanup aborted. *** Error code 9 (bu21) > > Gerald >
RE: Embperl make test need help...
> Starting httpd... [Mon Oct 4 15:06:44 1999] [crit] (125)Address > already in use: make_sock: could not bind to port 8529 > Cannot open test/tmp/httpd.pid at test.pl line 953. > There is already a Apache running on port 8529. Stop it and rerun the test. Gerald
Embperl make test need help...
I cannot run make test in Embperl which I get the errors like: apple 970# make test PERL_DL_NONLAZY=0 /usr/sbin/perl -Iblib/arch -Iblib/lib -I/usr/freeware/lib/perl5/5.00502/irix-n32 -I/usr/freeware/lib/perl5/5.00502 test.pl loading...ok Testing offline mode... ascii... ok pure.htm... ok plain.htm... ok plain.htm... ok plain.htm... ok plainblock.htm... ok plainblock.htm... ok error.htm... ok error.htm... ok error.htm... ok unclosed.htm... ok notfound.htm... ok noerr/noerrpage.htm...ok errdoc/errdoc.htm... ok rawinput/rawinput.htm... ok var.htm...ok varerr.htm... ok varerr.htm... ok escape.htm... ok tagscan.htm...ok tagscan.htm-d 1 ... ok if.htm... ok ifperl.htm... ok loop.htm... ok loopperl.htm... ok table.htm... ok table.htm-d 1 ... ok lists.htm... ok mix.htm...ok nesting.htm...ok object.htm... ok discard.htm...ok input.htm... ok hidden.htm... ok java.htm... ok inputjava.htm... ok include.htm...ok includeerr1.htm...ok includeerr2.htm...ok callsub.htm...ok callsub.htm...ok importsub.htm... ok importsub.htm... ok importsub2.htm... ok importmodule.htm... ok recursexec.htm... ok nph/div.htm...ok nph/npherr.htm... ok nph/nphinc.htm... ok sub.htm...ok sub.htm...ok chdir.htm... ok chdir.htm... ok allform/allform.htm...ok stdout/stdout.htm... ok nochdir/nochdir.htm...ok div.htm...ok ofunc/div.htm... ok safe/safe.htm... ok safe/safe.htm... ok safe/safe.htm... ok opmask/opmask.htm... ok opmask/opmasktrap.htm... ok Testing Execute function... div.htm from file... ok div.htm from memory...ok div.htm to memory... ok div.htm from/to memory... ok error.htm to memory...ok Use of uninitialized value at (eval 1218) line 1. Starting httpd... [Mon Oct 4 15:06:44 1999] [crit] (125)Address already in use: make_sock: could not bind to port 8529 Cannot open test/tmp/httpd.pid at test.pl line 953. Test terminated with fatal error Cannot open test/tmp/httpd.pid: No such file or directory Callback called exit. END failed--cleanup aborted. *** Error code 2 (bu21) Machine : origin 200 OS : IRIX6.4 Apache : 1.3.9 mod_perl : 1.21 What should I do? Best regards, --apple = Jearanai Vongsaard Graduate Research Assistant Tel(703)993-4322 Computational Science Institute Fax(703)993-1980 George Mason University [EMAIL PROTECTED] = " Copy from one, it's plagiarism; copy from two, it's research " --Wilson Mizner 1876-1933
RE: Parse::ePerl::Execute
> > BTW, what's the future of ePerl? Development has been quiet for over a > year. Is Ralph Engelschall still the maintainer? And it's sad to see > that perl.apache.org doesn't mention ePerl anymore, while it mentions > HTML::Embperl. > Ralf told me, that he will still do bugfixes to ePerl, but no further development. Apache::ASP, HTML::Embperl and HTML::Mason are mentioned on perl.apache.org, because they are the three ones most people use. Gerald
Q: Parse::ePerl::Execute
Hi, I'm trying to figure out what's wrong: I have a cgi script running under mod_perl. I want this script to call a ePerl document. I have other ePerl documents running under mod_perl, and it's running fine. So, on the command line, my script works fine with Parse::ePerl::Expand. But when running within mod_perl, I can't get Parse::ePerl::Evaluate to work. (Since I was having some problem, I've used the two-steps Translate-Evaluate instead of Expand). Parse::ePerl::Translate is working fine, but I've end up using eval($script) to make things work. When trying to use Expand, I got no errors in my logs, even with Error specified. I simply get an empty file. If I put some print statements after Expand, they don't even work. So I have three questions: 1) What could be the reason for Parse::ePerl::Evaluate not to work? 2) Except the additional functionalities (cwd, Env, etc), is there any other differences, especially impact on caching and precompiling? How should I choose 3) How should I choose if I should precompile my script (and using &$script instead) or not? BTW, what's the future of ePerl? Development has been quiet for over a year. Is Ralph Engelschall still the maintainer? And it's sad to see that perl.apache.org doesn't mention ePerl anymore, while it mentions HTML::Embperl. Here is some version info: LinuxPPC R5 (RH 6.0 derivative, glibc 2.1 based) Apache 1.3.6 mod_perl 1.19 ePerl 2.2.14 Cheers, Simon Piette
cannot start apache
I cannot run "apachectl start" which I got errors as belows: I use apache1.3.9 and mod_perl1.21 which run in Origin200 IRIX6.4 with perl 5.00502. I ever run the start before I installed perl5.00502(my previous perl is perl5.004.4). Somebody help apple 325# apachectl start [Mon Oct 4 14:12:59 1999] [error] [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: Can't load '/usr/freeware/lib/perl5/5.00502/irix-n32/auto/DB_File/DB_File.so' for module DB_File: 6425:/usr/local/apache/bin/httpd: rld: Fatal Error: Cannot Successfully map soname 'libdb.so' under any of the filenames /usr/freeware/lib/perl5/5.00502/irix-n32/CORE/libdb.so:/usr/freeware/lib32/libdb.so:/usr/lib32/libdb.so:/usr/lib32/internal/libdb.so:/lib32/libdb.so:/opt/lib32/libdb.so: at /usr/freeware/lib/perl5/5.00502/irix-n32/DynaLoader.pm line 168. [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: at /usr/local/apache//conf/startup.pl line 19 [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: BEGIN failed--compilation aborted at /usr/local/apache//conf/startup.pl line 19. Syntax error on line 872 of /usr/local/apache/conf/httpd.conf: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: Can't load '/usr/freeware/lib/perl5/5.00502/irix-n32/auto/DB_File/DB_File.so' for module DB_File: 6425:/usr/local/apache/bin/httpd: rld: Fatal Error: Cannot Successfully map soname 'libdb.so' under any of the filenames /usr/freeware/lib/perl5/5.00502/irix-n32/CORE/libdb.so:/usr/freeware/lib32/libdb.so:/usr/lib32/libdb.so:/usr/lib32/internal/libdb.so:/lib32/libdb.so:/opt/lib32/libdb.so: at /usr/freeware/lib/perl5/5.00502/irix-n32/DynaLoader.pm line 168. [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] DB_File.pm: [Mon Oct 4 14:12:59 1999] Hash.pm: at /usr/local/apache//conf/startup.pl line 19 [Mon Oct 4 14:12:59 1999] startup.pl: [Mon Oct 4 14:12:59 1999] startup.pl: BEGIN failed--compilation aborted at /usr/local/apache//conf/startup.pl line 19. .//apachectl start: httpd could not be started apple 326# Best regards, --apple = Jearanai Vongsaard Graduate Research Assistant Tel(703)993-4322 Computational Science Institute Fax(703)993-1980 George Mason University [EMAIL PROTECTED] = " Copy from one, it's plagiarism; copy from two, it's research " --Wilson Mizner 1876-1933
Re: Comparison PHP,clean mod_perl script,Apache::ASP,HTML::Embperl
According to BeerBong: > Huh, another test > test.epl According to BeerBong: > test.epl > -- > use DBI; > $dbh = DBI->connect("DBI:Oracle:SIMain","test","test"); > PHP3 and mod_perl script with DBD::Oracle - 24 Requests per second Is this with or without Apache::DBI loaded? Les Mikesell [EMAIL PROTECTED]
Re: Comparison PHP,clean mod_perl script,Apache::ASP,HTML::Embperl
Sergey, You can crank up Apache::ASP's speed by setting StateDir to somehting like /tmp/asp, or setting NoState to 1. Please check out http://www.nodeworks.com/asp/tuning.html When well tuned, Apache::ASP scripts will still be slower than tuned Embperl & modperl, but not as much as shown in your testing. For other benchmarks, check out: http://www.chamas.com/hello_world.html -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NODEWORKS >> free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-562-683-2142 BeerBong wrote: > > Huh, another test > > test.epl > -- > > DBTest > > > [- > use DBI; > > $dbh = DBI->connect("DBI:Oracle:SIMain","test","test"); > $sth = $dbh->prepare("select login,fio from test where login like ?"); > $sth->bind_param(1,"Be%"); > $sth->execute; > $sth->bind_columns(\$login,\$fio); > local $^W=0; > $escmode =0; > -] > [$ while ($sth->fetchrow_arrayref) $] > [+ $login +] - [+ $fio +] > [$ endwhile $] > > > > -- > ./ab -n 1000 -c 10 http://apache/test.epl > 19 Requests per second... > PHP3 and mod_perl script with DBD::Oracle - 24 Requests per second > And I still don't know why PHP3 has the same speed as DBD::Oracle, DBI is > neccessary layer, and PHP hasn't it and directly calls to OCI. I guess if > Tim Bunce rewrite PHP it will be safer and faster :) > Apache::ASP - 7 Requests per second, but Apache::ASP was installed and works > without any troubles, EmbPerl has them... I still dont know why error log > doesnt work, though it is not neccessary feature, and why my > PerlPostReadRequestHandler stops the rewriting Remote IP :( > -- > Sergey Polyakov (BeerBong) > Chief of Web Lab (http://www.mustdie.ru/~beerbong)
Re: Chaining and redirection
next point release of embperl. cliff rayman genwax.com Dirk Lutzebaeck wrote: > Cliff Rayman writes: > > > the exit is broken in some contexts. > > if this is part of a subroutine or called from an execute that may be the > > problem. > > Hmm, in my case there is no execute for sub envolved. I'm using > > [- > use Apache; > use Apache::Constants qw(REDIRECT); > > $r = Apache->request; > > $r->err_header_out("Location" => "/x.html"); > $r->status(REDIRECT); > Apache::exit(); > -] > > > this is going to be fixed in the next release > > what kind of release do you mean? > > Dirk
Re: using shared memory.
On Mon, Oct 04, 1999 at 12:41:45PM +0200, Stas Bekman wrote: > > Preloading has nothing todo with shared memory. The idea is to load as much > > as possible in the parent process. Now, when a child is forked, all childs > > have the same modules loaded. Since Unix only copies the memory when a write > > to a memory loactaion takes place, the preloaded modules will actually share > > the same memory location, as long as they not write to the memory. > > Gerald, are you sure that it works that way? If it's, why top() reports a > bigger size of the shared memory when more modules were preloaded at the > server startup? The word shared has multiple meanings. There's "shared memory" in the sense of "SysV IPC" that the IPC::Shareable modules uses, then there's also "shared memory pages" from forking or from loading shared objects. How tools like ps and top show "memory usage" in these circumstances can be a tricky issue. Tim.
[Fwd: CGI / multipart pages]
Ok, here is what you see in thge browser's window: HTTP/1.0 200 OK Content-Type: multipart/x-mixed-replace;boundary=TeilTrenner --TeilTrenner HTTP/1.1 200 OK Date: Mon, 04 Oct 1999 23:01:24 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 mod_ssl/2.4.2 OpenSSL/0.9.4 Connection: close Content-Type: text/html 2 --TeilTrenner HTTP/1.1 200 OK Date: Mon, 04 Oct 1999 23:01:24 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 mod_ssl/2.4.2 OpenSSL/0.9.4 Connection: close Content-Type: text/html 1 --TeilTrenner HTTP/1.1 200 OK Date: Mon, 04 Oct 1999 23:01:24 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 mod_ssl/2.4.2 OpenSSL/0.9.4 Connection: close Content-Type: text/html Boom! --TeilTrenner-- Obviously there´s a lot of information nobody wants to be displayed... regards -Sebastian- --- Achtung, die Tel.-Nr. haben sich geändert --- Sebastian Ahrens Ruhr-Universitaet Bochum Dez. 2 - BIF D-44780 Bochum Tel.: 0234/322-6182 Mobil: 0170/2865291 Fax : 0234/3214-684 EMail: [EMAIL PROTECTED] WWW: http://www.ruhr-uni-bochum.de/rub-bif Hi folks, I´ve got some problems here with an example taken from my personal Perl-Bible (by M. Schilli) and I dont know what the problem is: package ServerPush; use CGI qw/:standard/; use Postgres; sub new { my ($class, $sep) = shift; my $self = {}; $sep = "TeilTrenner"; $self->{seperator} = $sep; $self->{header_sent} = 0; # Erster Header gesendet? $| = 1;# Ausgabe entpuffern bless($self, $class); } sub server_push { my ($self, $content, $terminate) = @_; if(!$self->{header_sent}) { print header('-nph' => 1, '-type' => "multipart/x-mixed-replace;boundary=$self->{seperator}"); print "\n--$self->{seperator}\n"; $self->{header_sent} = 1; } print header(), "$content\n"; print "\n--$self->{seperator}", defined $terminate ? "--" : "", "\n"; } The only thing that happens correctly is the repost of this page; somehow there is a problem with the headers, because the multipart-header is displayed. I tried to solve this by starting the pager with a $cgi->header(); and it worked, but only for the main header; the other multipart headers are displayed again thanks for any kind of help regards -Sebastian- -- --- Achtung, die Tel.-Nr. haben sich geändert --- Sebastian Ahrens Ruhr-Universitaet Bochum Dez. 2 - BIF D-44780 Bochum Tel.: 0234/322-6182 Mobil: 0170/2865291 Fax : 0234/3214-684 EMail: [EMAIL PROTECTED] WWW: http://www.ruhr-uni-bochum.de/rub-bif
CGI / multipart pages
Hi folks, I´ve got some problems here with an example taken from my personal Perl-Bible (by M. Schilli) and I dont know what the problem is: package ServerPush; use CGI qw/:standard/; use Postgres; sub new { my ($class, $sep) = shift; my $self = {}; $sep = "TeilTrenner"; $self->{seperator} = $sep; $self->{header_sent} = 0; # Erster Header gesendet? $| = 1;# Ausgabe entpuffern bless($self, $class); } sub server_push { my ($self, $content, $terminate) = @_; if(!$self->{header_sent}) { print header('-nph' => 1, '-type' => "multipart/x-mixed-replace;boundary=$self->{seperator}"); print "\n--$self->{seperator}\n"; $self->{header_sent} = 1; } print header(), "$content\n"; print "\n--$self->{seperator}", defined $terminate ? "--" : "", "\n"; } The only thing that happens correctly is the repost of this page; somehow there is a problem with the headers, because the multipart-header is displayed. I tried to solve this by starting the pager with a $cgi->header(); and it worked, but only for the main header; the other multipart headers are displayed again thanks for any kind of help regards -Sebastian- -- --- Achtung, die Tel.-Nr. haben sich geändert --- Sebastian Ahrens Ruhr-Universitaet Bochum Dez. 2 - BIF D-44780 Bochum Tel.: 0234/322-6182 Mobil: 0170/2865291 Fax : 0234/3214-684 EMail: [EMAIL PROTECTED] WWW: http://www.ruhr-uni-bochum.de/rub-bif
Re: using shared memory.
> > Preloading has nothing todo with shared memory. The idea is to load as much > > as possible in the parent process. Now, when a child is forked, all childs > > have the same modules loaded. Since Unix only copies the memory when a write > > to a memory loactaion takes place, the preloaded modules will actually share > > the same memory location, as long as they not write to the memory. > > Gerald, are you sure that it works that way? If it's, why top() reports a > bigger size of the shared memory when more modules were preloaded at the > server startup? > mod_perl_tunning.pod says: The biggest benefit here is that the child process never needs to recompile the code, so it is faster to start, and the child process actually shares the same physical copy of the code in memory due to the way the virtual memory system in modern operating systems works. "the way the virtual memory system in modern operating systems works" means they copy only on write. There was a discussion about that a long time ago when Vivek started the writing of mod_perl_tunning pod. I don't know when this actually was, but it must be more then 2 years ago... Gerald > I know that the main idea behind the shared memory is for dynamically > linked apps, which share freezed text memory segments and not the heap > memory Perl uses for its compiled code. > > Memory management gurus (Vivek? Frank?), will you please step in and > explain this issue once and forever? There is a lot of confusion goes > around the "sharing" term. Thanks a million! > > ___ > Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas > Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC > www.apache.org & www.perl.com == www.modperl.com || perl.apache.org > single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com >
Mandrake 6.1 and Apache::Util loadproblem..
Hello... and Help... I've been trying to install mod_perl and Apache_1.3.9 on my mandrake distribution, but thinga are not alle that well.. I've installed these packages (in this order) libnet-1.0606 MIME-Base64-2.11 URI-1.04 HTML-Parser-2.23 Digest-MD5-2.09 libwww-perl-5.44 DBI-1.13 Compiled apache and mod_perl (dso) with no problem... however.. If I use the ``use Apache::Util qw(:all);''-statement, I get this in my error_log: [Mon Oct 4 08:23:12 1999] [error] Can't locate loadable object for module Apache::Util in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . /usr/local/apache_1.3.9/ /usr/local/apache_1.3.9/lib/perl) at /usr/lib/perl5/site_perl/5.005/i386-linux/mod_perl.pm line 14 BEGIN failed--compilation aborted at /export/home/bogeskov/public_html/tmpl.pl line 5. and line 14 of /usr/lib/perl5/site_perl/5.005/i386-linux/mod_perl.pm is: if ($ENV{MOD_PERL}) { I just can't see what it is trying to load there... Could somebody point me in the right direction? # perl -V Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=linux, osvers=2.2.9-chmou1, archname=i386-linux uname='linux kenobi.mandrakesoft.com 2.2.9-chmou1 #13 smp wed jul 7 17:05:22 cest 1999 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2', gccversion=pgcc-2.91.66 19990314 (egcs-1.1.2 release) cppflags='-Dbool=char -DHAS_BOOL' ccflags ='-Dbool=char -DHAS_BOOL' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=, 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): Built under linux Compiled at Jul 12 1999 15:35:18 @INC: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . -- Yours Morten Bøgeskov (email: [EMAIL PROTECTED]) "Men and women will get along much better when one gender realizes that the other gender knows more. Now, which is which, I'm not saying." And thus spoke Silent Bob.
Re: using shared memory.
> Preloading has nothing todo with shared memory. The idea is to load as much > as possible in the parent process. Now, when a child is forked, all childs > have the same modules loaded. Since Unix only copies the memory when a write > to a memory loactaion takes place, the preloaded modules will actually share > the same memory location, as long as they not write to the memory. Gerald, are you sure that it works that way? If it's, why top() reports a bigger size of the shared memory when more modules were preloaded at the server startup? I know that the main idea behind the shared memory is for dynamically linked apps, which share freezed text memory segments and not the heap memory Perl uses for its compiled code. Memory management gurus (Vivek? Frank?), will you please step in and explain this issue once and forever? There is a lot of confusion goes around the "sharing" term. Thanks a million! ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org & www.perl.com == www.modperl.com || perl.apache.org single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: Embperl virtual log and mod_perl handlers
> Doesn't looks so good :-( > > BTW which version of mod_perl you are using? 1.21 Embperl 1.1.1 has problems with > newer mod_perl versions, because of changes in the handling of $ENV inside > mod_perl. So your problem may result from that,maybe... > > I would suggest to test 1.2b9. It's a really stable version. The only thing > that's missing to call it 1.2, is Apache::Session 1.04 on CPAN, but I hope > Jeff will upload it soon. I installed it, and no problems while make test, 1.1.1 had them. But all troubles remain ;( Huh, I'm going away on business right now, and I can give you login-password to uncover the problems... If you need it, reply right now :)
Re: Embperl virtual log and mod_perl handlers
Doesn't looks so good :-( BTW which version of mod_perl you are using? Embperl 1.1.1 has problems with newer mod_perl versions, because of changes in the handling of $ENV inside mod_perl. So your problem may result from that,maybe... I would suggest to test 1.2b9. It's a really stable version. The only thing that's missing to call it 1.2, is Apache::Session 1.04 on CPAN, but I hope Jeff will upload it soon. Gerald - Original Message - From: BeerBong <[EMAIL PROTECTED]> To: ModPerl <[EMAIL PROTECTED]> Sent: Montag, 4. Oktober 1999 11:50 Subject: Re: Embperl virtual log and mod_perl handlers > > For the Logfile problem try: > > > > PerlSetEnv EMBPERL_VIRTLOG /embperl > > > > and > > > > > > > > note the slash before embperl > > Yes, and > 195.209.67.50 - - [04/Oct/1999:13:48:13 +0500] "GET /embperl?803283&19801 > HTTP/1..0" 404 270 > 1 > 195.209.67.50 - - [04/Oct/1999:13:48:16 +0500] "GET > /embperl?803283&19801&SRC: HTTTP/1.0" 404 270 > 1 > > NOT FOUND > > > > > For the other problem I would try > > > > > > SetHandler perl-script > > PerlHandler HTML::Embperl > > Options ExecCGI > > PerlPostReadRequestHandler My::ProxyRemoteAddr > > > > Apache said > PerlPostReadRequestHandler My::ProxyRemoteAddr > not allowed here... > (EmbPerl 1.1.1) > >
RE: rwrite returned -1 (again) mod_perl 1.21
On Monday, October 04, 1999 11:02 AM, Jay J [SMTP:[EMAIL PROTECTED]] wrote: > A search of the archive revealed things like: > > ... Sep 1998: "It may be worth noting that I've so far only seen this > behavior on SSL connections" > ... Oct 1998: "It means the client connection was broken. No cause for > alarm. With Apache 1.3.x you won't see that message unless LogLevel is set > to debug." > ... May 1999: "This bug has been fixed in the CVS tree" > > The http://perl.apache.org/guide mentions it as well.. > > Indeed I've got Loglevel's of debug/info .. but, should this still be > appearing? > > Would it be of any interest that this request may* have been mod_rewrite'd > (like the guide example but SSL)? > > I'll just turn down the logging and tell my users to quit aborting > connections ;-) > -Jay J Your LogLevel is either "debug" or "info". "debug" logs everything, "info" is the next level, which doesn't include debug messages. The error message is logged at "debug" level, so you might want to set LogLevel Info on your production server. I don't think you can stop users from aborting connections, I know I can't! -- Eric
Comparison PHP,clean mod_perl script,Apache::ASP,HTML::Embperl
Huh, another test test.epl -- DBTest [- use DBI; $dbh = DBI->connect("DBI:Oracle:SIMain","test","test"); $sth = $dbh->prepare("select login,fio from test where login like ?"); $sth->bind_param(1,"Be%"); $sth->execute; $sth->bind_columns(\$login,\$fio); local $^W=0; $escmode =0; -] [$ while ($sth->fetchrow_arrayref) $] [+ $login +] - [+ $fio +] [$ endwhile $] -- ./ab -n 1000 -c 10 http://apache/test.epl 19 Requests per second... PHP3 and mod_perl script with DBD::Oracle - 24 Requests per second And I still don't know why PHP3 has the same speed as DBD::Oracle, DBI is neccessary layer, and PHP hasn't it and directly calls to OCI. I guess if Tim Bunce rewrite PHP it will be safer and faster :) Apache::ASP - 7 Requests per second, but Apache::ASP was installed and works without any troubles, EmbPerl has them... I still dont know why error log doesnt work, though it is not neccessary feature, and why my PerlPostReadRequestHandler stops the rewriting Remote IP :( -- Sergey Polyakov (BeerBong) Chief of Web Lab (http://www.mustdie.ru/~beerbong)
rwrite returned -1 (again) mod_perl 1.21
A search of the archive revealed things like: ... Sep 1998: "It may be worth noting that I've so far only seen this behavior on SSL connections" ... Oct 1998: "It means the client connection was broken. No cause for alarm. With Apache 1.3.x you won't see that message unless LogLevel is set to debug." ... May 1999: "This bug has been fixed in the CVS tree" The http://perl.apache.org/guide mentions it as well.. Indeed I've got Loglevel's of debug/info .. but, should this still be appearing? Would it be of any interest that this request may* have been mod_rewrite'd (like the guide example but SSL)? I'll just turn down the logging and tell my users to quit aborting connections ;-) -Jay J (( First message )) [Mon Oct 4 02:22:36 1999] [info] [client xxx.xxx.xxx.xxx] (32)Broken pipe: client stopped connection before rwrite completed (( 28 times )) [Mon Oct 4 02:22:36 1999] [debug] Apache.xs(355): (32)Broken pipe: mod_perl: rwrite returned -1 (fd=4, B_EOUT=8) (( 4830 times )) [Mon Oct 4 02:22:36 1999] [debug] Apache.xs(355): mod_perl: rwrite returned -1 (fd=4, B_EOUT=8) ... [Mon Oct 4 02:23:09 1999] [debug] Apache.xs(355): mod_perl: rwrite returned -1 (fd=4, B_EOUT=8) Server: Apache/1.3.6 (Unix) mod_perl/1.21 mod_ssl/2.3.6 OpenSSL/0.9.3a httpd.conf: LogLevel debug SSLLogLevel info Compiled-in modules: http_core.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_status.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c mod_actions.c mod_userdir.c mod_proxy.c mod_alias.c mod_rewrite.c mod_access.c mod_auth.c mod_setenvif.c mod_ssl.c mod_perl.c Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration: Platform: osname=linux, osvers=2.0.36, archname=i686-linux uname='linux localhost 2.0.36 #1 tue oct 13 22:17:11 edt 1998 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2', gccversion=2.7.2.3 cppflags='-Dbool=char -DHAS_BOOL' ccflags ='-Dbool=char -DHAS_BOOL' 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 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=, 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): Built under linux Compiled at Jan 26 1999 09:59:09 @INC: /usr/lib/perl5/5.00502/i686-linux /usr/lib/perl5/5.00502 /usr/lib/perl5/site_perl/5.005/i686-linux /usr/lib/perl5/site_perl/5.005
Re: Embperl virtual log and mod_perl handlers
> For the Logfile problem try: > > PerlSetEnv EMBPERL_VIRTLOG /embperl > > and > > > > note the slash before embperl Yes, and 195.209.67.50 - - [04/Oct/1999:13:48:13 +0500] "GET /embperl?803283&19801 HTTP/1..0" 404 270 1 195.209.67.50 - - [04/Oct/1999:13:48:16 +0500] "GET /embperl?803283&19801&SRC: HTTTP/1.0" 404 270 1 NOT FOUND > > For the other problem I would try > > > SetHandler perl-script > PerlHandler HTML::Embperl > Options ExecCGI > PerlPostReadRequestHandler My::ProxyRemoteAddr > Apache said PerlPostReadRequestHandler My::ProxyRemoteAddr not allowed here... (EmbPerl 1.1.1)
Re: Embperl virtual log and mod_perl handlers
For the Logfile problem try: PerlSetEnv EMBPERL_VIRTLOG /embperl and note the slash before embperl For the other problem I would try SetHandler perl-script PerlHandler HTML::Embperl Options ExecCGI PerlPostReadRequestHandler My::ProxyRemoteAddr Gerald
Re: Apache::EmbperlFilter - Subtle Problem Solved
> Onto the unsolved problems: > > 1. I get Stack Underflow errors every once in a while from Embperl on > pages that work fine on a reload. > I guess your problem occures when the input of Embperl changes. I have already discussed that problem with Miachel. You need to change the mtime parameter, everytime you feed a new source to embperl, because Embperl needs to know, when it must recompile the source. If you change the source, but do not change mtime, you get strange results. Another possibilty is to set mtime to zero, then Embperl will recompile the source everytime. > 2. If I change the order of Apache::SSI and Apache::EmbperlFilter in the > PerlHandler section of my configuration Apache::SSI outputs the server > side includes and prints them to the browser instead of to Embperl. This > is with Filter On. I am unsure what is going on here. > I think Joshua already gave you an anwer to that problem Gerald
Re: using shared memory.
Preloading has nothing todo with shared memory. The idea is to load as much as possible in the parent process. Now, when a child is forked, all childs have the same modules loaded. Since Unix only copies the memory when a write to a memory loactaion takes place, the preloaded modules will actually share the same memory location, as long as they not write to the memory. Gerald - Original Message - From: randyboy <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sonntag, 3. Oktober 1999 23:15 Subject: using shared memory. > hi, > > so, i read all this stuff about using shared memory, preloading stuff to > each child doesn't have it's own copy. so i went ahead and compile sysV > shared memory into my kernel. however, ipcs tells me that nothing is > using shared memory: > > server# ipcs -m > Shared Memory: > T ID KEYMODE OWNERGROUP > > despite the fact that teh webserver is up and running: > > server# usefulps | head -1 ; usefulps | grep httpd > %CPU %MEM NVCSW NIVCSW NSWAP VSZ RSS RSZ TSIZ PID PPID COMMAND > 0.0 4.7 360 86 0 6016 4480 4480 312 6893 1 httpd > 0.0 4.8 1 1 0 6016 4564 4564 312 6894 6893 httpd > 0.0 4.8 1 0 0 6016 4564 4564 312 6895 6893 httpd > 0.0 4.8 1 0 0 6016 4564 4564 312 6896 6893 httpd > 0.0 4.8 1 1 0 6016 4564 4564 312 6897 6893 httpd > 0.0 4.8 1 0 0 6016 4564 4564 312 6898 6893 httpd > > This is my startup script: > > use Apache::Registry(); > use HTML::Embperl(); > 1; > > Environment: > FreeBSD 3.2 > Apache 1.3.9 > mod_perl 1.21 > > > So, am I totally missing something here? Does shared memory have to be > compiled into the kernel before I compile Apache? Does shared memory > mean something outside the context of sysV IPCS? Do I need semaphores and > messages as well, or is shared memory alone ok? > > tia. > r. >
Jeff's guide to mod_perl database performance
Hi guys, I was hacking tonight and I got the idea that I should share with you some of my database performance tricks. I hope this will be a good reference for when people are designing their web application architectures. I will eventually post this on my website alongside my DBI tutorial. Maybe Stas will put it in the guide (wink wink). Mail suggestions and comments to me at [EMAIL PROTECTED] Enjoy, Jeffrey Analysis of the Problem A common web application architecture is one or more application servers which handle requests from client browsers by consulting one or more database servers and performing a transform on the data. When an application must consult the database on every request, the interaction with the database server becomes the central performance issue. Spending a bit of time optimizing your database access can result in significant application performance improvements. In this analysis, a system using Apache, mod_perl, DBI, and Oracle will be considered. The application server uses Apache and mod_perl to service client requests, and DBI to communicate with a remote Oracle database. In the course of servicing a typical client request, the application server must retrieve some data from the database and execute a stored procedure. There are several steps that need to be done to complete the request: 1: Connect to the database server 2: Prepare a SQL SELECT statement 3: Execute the SELECT statement 4: Retrieve the results of the SELECT statement 5: Release the SELECT statement handle 6: Prepare a PL/SQL stored procedure call 7: Execute the stored procedure 8: Release the stored procedure statement handle 9: Commit or rollback 10: Disconnect from the database server In this document, an application will be described which achieves maximum performance by eliminating some of the steps above and optimizing others. Optimizing Database Connections A naive implementation would perform steps 1 through 10 from above on every request. A portion of the source code might look like this: # ... my $dbh = DBI->connect('dbi:Oracle:host', 'user', 'pass') || die $DBI::errstr; my $baz = $r->param('baz'); eval { my $sth = $dbh->prepare(qq{ SELECT foo FROM bar WHERE baz = $baz }); $sth->execute; while (my @row = $sth->fetchrow_array) { # do HTML stuff } $sth->finish; my $sph = $dbh->prepare(qq{ BEGIN my_procedure( arg_in => $baz ); END; }); $sph->execute; $sph->finish; $dbh->commit; }; if ($@) { $dbh->rollback; } $dbh->disconnect; # ... In practice, such an implementation would have hideous performance problems. The majority of the execution time of this program would likely be spent connecting to the database. An examination shows that step 1 is comprised of many smaller steps: 1: Connect to the database server 1a: Build client-side data structures for an Oracle connection 1b: Look up the server's alias in a file 1c: Look up the server's hostname 1d: Build a socket to the server 1e: Build server-side data structures for this connection The naive implementation waits for all of these steps to happen, and then throws away the database connection when it is done! This is obviously wasteful, and easily rectified. The best solution is to hoist the database connection step out of the per-request lifecycle so that more than one request can use the same database connection. This can be done by connecting to the database server once, and then not disconnecting until the Apache child process exits. The Apache::DBI module does this transparently and automatically with little effort on the part of the programmer. Apache::DBI intercepts calls to DBI's connect and disconnect methods and replaces them with its own. Apache::DBI caches database connections when they are first opened, and it ignores disconnect commands. When an application tries to connect to the same database, Apache::DBI returns a cached connection, thus saving the significant time penalty of repeatedly connecting to the database. A full treatment of Apache::DBI doesn't belong in this document, but you can find more information in Stas Beckman's mod_perl guide at http://perl.apache.org/guide/ . When Apache::DBI is in use, none of the code in the example needs to change. The code is upgraded from naive to respectable with the use of a simple module! The first and biggest database performance problem is quickly dispensed with. Utilizing the Database Server's Cache Most database servers, including Oracle, utilize a cache to improve the performance of recently seen queries. The cache is keyed on the SQL statement. If a statement is identical to a previously seen statement, the execution plan for the previous statement i