libapreq2-2.06-dev apreq_xs_postperl.h
perl Makefile.PL --with-apache2-apxs=/usr/local/apache2/bin/apxs is succes. but make failed, cc -c -I/root/.cpan/build/libapreq2-2.06-dev/glue/perl/xs -I/root/.cpan/build/libapreq2-2.06-dev/include -I/root/.cpan/build/libapreq2-2.06-dev/glue/perl/xsbuilder -I/usr/include/apache2 -I/usr/include/apache2 -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/lib/perl5/5.8.3/i586-linux-thread-multi/CORE -DMOD_PERL -DMP_COMPAT_1X -DLINUX=2 -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -Wall -pipe -DVERSION=\"2.06-dev\" -DXS_VERSION=\"2.06-dev\" -fPIC "-I/usr/lib/perl5/5.8.3/i586-linux-thread-multi/CORE" Apache2.c In file included from Apache2.xs:39: /root/.cpan/build/libapreq2-2.06-dev/glue/perl/xsbuilder/apreq_xs_postperl.h:21:34: modperl_perl_unembed.h: No such file or directory /root/.cpan/build/libapreq2-2.06-dev/glue/perl/xsbuilder/apreq_xs_postperl.h:24:33: modperl_common_util.h: No such file or directory In file included from Apache2.xs:45: /root/.cpan/build/libapreq2-2.06-dev/glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h:1:22: mod_perl.h: No such file or directory Apache2.c: In function `XS_APR__Request__Apache2_handle': Apache2.c:65: warning: implicit declaration of function `modperl_xs_sv2request_rec' Apache2.c:65: warning: initialization makes pointer from integer without a cast make[6]: *** [Apache2.o] Error 1 where these .h could be found? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
hardware prerequisite
My machine which cpu is celeron 266Mhz is running Debian 3.1, and apche2 modperl2 are configured for running the content manager program WebGUI which needs modperl2. Now my issue is the performance is very bad and very slow even I click edit a link. The question is what is hardware prereuisite for modperl2 and apache2 ? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: hardware prerequisite
I could run WebGUI with apache very well before, but apache2 is very slow, so I doubt some bugs in apache2 or modperl2, but I can't finger this out. On 2/2/06, Mark Galbreath <[EMAIL PROTECTED]> wrote: > I wasn't aware you could run any modern software on a CPU that slow. Use > that machine for a doorstop, dude, and upgrade to something manufactured in > the last 3 years. > > mark > > >>> Ken Perl <[EMAIL PROTECTED]> 02-Feb-06 04:15 AM >>> > > My machine which cpu is celeron 266Mhz is running Debian 3.1, and > apche2 modperl2 are configured for running the content manager program > WebGUI which needs modperl2. > Now my issue is the performance is very bad and very slow even I click > edit a link. > The question is what is hardware prereuisite for modperl2 and apache2 ? > > -- > perl -e 'print > unpack(u,"62V5N\"FME;G\!E ")' > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
debug modperl program
hi, Debuging a perl program at command line is using -d option, but this can't be used in a modperl program, any doc or examples on this topic about how to debug a modperl program? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
MP2 dir_config
sub handler { my $r = shift; my $s = Apache2::ServerUtil->server; $s->dir_config('WRoot'); $r->dir_config('WConfig'); } which module api doc that I could find description about the two dir_config? I want to know more info about them. -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
reload or restart httpd
When code is updated during developing period, httpd progress must be reload or restart so that to see the change. If is it possible to see the change without reload httpd? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: reload or restart httpd
Yes, I am using Apache2, the doc is very useful. in httpd.conf file, I use PerlInitHandler example.pm's handler() as starting point, when I update the code in handler(), I didn't see the updates, so I asked previous question. After I read the head of the doc, I make sense that I need to modify the global %INC after server is started. I am going to do like this sub handler { my $r = shift; my $s = Apache2::ServerUtil->server; my $WRoot = $s->dir_config('WRoot'); use lib "$FindBin::Bin/$WRoot"; } Am I correct? On 2/6/06, Sean Davis <[EMAIL PROTECTED]> wrote: > > On 2/6/06 7:10 AM, "Ken Perl" <[EMAIL PROTECTED]> wrote: > > > When code is updated during developing period, httpd progress must be > > reload or restart so that to see the change. If is it possible to see > > the change without reload httpd? > > > You didn't say which version of mod_perl you are using, but try looking > here: > > <http://search.cpan.org/~pgollucci/mod_perl-2.0.2/docs/api/Apache2/Reload.po > d> > > Sean > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
interactive debuging modperl2 using Apache::DB
Hi, I configured Apache::DB in my modperl2 and got a notice message in apache2 startup error.log, [notice] Apache::DB initialized in child 1123 I think I have setuped it successfully. And I also see the debugger welcome message, Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. But I don't know to interactive with modperl to debug my program, I can only see DB<1> prompt symbol in the log file. -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
timestamp of Apache::DB
when Apache::DB is initialized it will write a line of log into error.log, but without a timestamp, [notice] Apache::DB initialized in child 1957 May I add one? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
[MP2] set breakpoint
hi, I'd like to set a breakpoint at the first line in the module's handler, sub handler { my $r = shift; <-- here ... ... $r->set_handlers(PerlResponseHandler => \&contentHandler); } So, I tried PerFixupHandler, PerlHandler and PerlInitHander respectively in below Location directive, but all didn't stop at the point I wanted, instead, It always stopped at the line of '&contentHandler', PerlInitHandler +Apache::DB what I did wrong? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: [MP2] set breakpoint
No IDE for me too, I am using vi on a Debian terminal too. warn is easy and good, I also want a more common and more powerful interactive debugger tool, now I am trying Apache::DB and have this trouble. On 2/7/06, John ORourke <[EMAIL PROTECTED]> wrote: > What sort of IDE, debugger, and platform are you using? > > Personally for debugging handlers I find it easier to just stick a line > like: warn "got here, r=$r\n" > > then just tail -f the error_log. Proper old school. Then again I > develop with vi on an 80x24 terminal, am I missing out on something? > > John > > Ken Perl wrote: > > >hi, > >I'd like to set a breakpoint at the first line in the module's handler, > >sub handler { > >my $r = shift; <-- here > > ... ... > > $r->set_handlers(PerlResponseHandler => \&contentHandler); > >} > > > >So, I tried PerFixupHandler, PerlHandler and PerlInitHander > >respectively in below Location directive, but all didn't stop at the > >point I wanted, instead, It always stopped at the line of > >'&contentHandler', > > > >PerlInitHandler +Apache::DB > > > > > >what I did wrong? > > > >-- > >perl -e 'print unpack(u,"62V5N\"FME;G\!E >")' > > > > > > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: timestamp of Apache::DB
Cool, I guess you mean add these lines into the conf file, use CGI::Carp; Thanks, It works. On 2/7/06, John Doe <[EMAIL PROTECTED]> wrote: > Ken Perl am Dienstag, 7. Februar 2006 07.44: > > when Apache::DB is initialized it will write a line of log into > > error.log, but without a timestamp, > > [notice] Apache::DB initialized in child 1957 > > May I add one? > > > > -- > > perl -e 'print unpack(u,"62V5N\"FME;G\!E > ")' > > yes, by putting the line > > use CGI::Carp > > into the httpd.conf file :-) > > hth, > joe > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: reload or restart httpd
tried adding the two lines to the conf file, didn't work. On 2/6/06, Sean Davis <[EMAIL PROTECTED]> wrote: > > > > On 2/6/06 9:06 AM, "Ken Perl" <[EMAIL PROTECTED]> wrote: > > > Yes, I am using Apache2, the doc is very useful. > > in httpd.conf file, I use PerlInitHandler example.pm's handler() as > > starting point, when I update the code in handler(), I didn't see the > > updates, so I asked previous question. > > After I read the head of the doc, I make sense that I need to modify > > the global %INC after server is started. > > I am going to do like this > > sub handler { > > my $r = shift; > > my $s = Apache2::ServerUtil->server; > > my $WRoot = $s->dir_config('WRoot'); > > use lib "$FindBin::Bin/$WRoot"; > > } > > Unless I am misunderstanding what you are trying to do, I think you just > need to add these two lines to your httpd.conf to have any changed modules > reloaded: > > PerlModule Apache2::Reload > PerlInitHandler Apache2::Reload > > I don't think you have to do anything special with %INC. > > Sean > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: reload or restart httpd
I also turned the debug on, but didn't see any debug message in the error.log, anyone knows why? PerlSetVar ReloadDebug On On 2/7/06, Ken Perl <[EMAIL PROTECTED]> wrote: > tried adding the two lines to the conf file, didn't work. > > On 2/6/06, Sean Davis <[EMAIL PROTECTED]> wrote: > > > > > > > > On 2/6/06 9:06 AM, "Ken Perl" <[EMAIL PROTECTED]> wrote: > > > > > Yes, I am using Apache2, the doc is very useful. > > > in httpd.conf file, I use PerlInitHandler example.pm's handler() as > > > starting point, when I update the code in handler(), I didn't see the > > > updates, so I asked previous question. > > > After I read the head of the doc, I make sense that I need to modify > > > the global %INC after server is started. > > > I am going to do like this > > > sub handler { > > > my $r = shift; > > > my $s = Apache2::ServerUtil->server; > > > my $WRoot = $s->dir_config('WRoot'); > > > use lib "$FindBin::Bin/$WRoot"; > > > } > > > > Unless I am misunderstanding what you are trying to do, I think you just > > need to add these two lines to your httpd.conf to have any changed modules > > reloaded: > > > > PerlModule Apache2::Reload > > PerlInitHandler Apache2::Reload > > > > I don't think you have to do anything special with %INC. > > > > Sean > > > > > > > > > -- > perl -e 'print unpack(u,"62V5N\"FME;G\!E ")' > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: [MP2] set breakpoint
You catched my problem, I didn't load debugger before this handler, thanks. After I changed the order in the httpd config file, my problem is solved, It stopped at the point I wanted, my $r = shift; Thanks again. On 2/8/06, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Tue, 2006-02-07 at 16:10 +0800, Ken Perl wrote: > > hi, > > I'd like to set a breakpoint at the first line in the module's handler, > > sub handler { > > my $r = shift; <-- here > > ... ... > >$r->set_handlers(PerlResponseHandler => \&contentHandler); > > } > > > > So, I tried PerFixupHandler, PerlHandler and PerlInitHander > > respectively in below Location directive, but all didn't stop at the > > point I wanted, instead, It always stopped at the line of > > '&contentHandler', > > > > PerlInitHandler +Apache::DB > > > > > > what I did wrong? > > Did you load this handler before you loaded the debugger? You should > call Apache::DB->init() explicitly before loading any of the code you > want to debug, or it won't get debugging symbols. See the documentation > for Apache::DB. > > - Perrin > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
module bug?
I see a info in the error.log when I access the uri / and works fine, [Wed Feb 08 13:22:35 2006] [info] [client 10.0.0.1] Module bug? Request filename is missing for URI / Is the info reported by modperl2? anything wrong? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: module bug?
Sounds reasonable. Based on your anaIysis, I added warn "reach last line of WebGUI.pm"; into the handler before the last line. sub handler{ ... ... else { $r->set_handlers(PerlResponseHandler => \&contentHandler); $r->set_handlers(PerlTransHandler => sub { return Apache2::Const ::OK}); } warn "reach last line of WebGUI.pm"; return Apache2::Const::DECLINED; } then I got these two lines of log message like this, [Wed Feb 8 20:45:57 2006] -e: got last line of WebGUI.pm at /data/WebGUI/lib/WebGUI.pm line 65. [Wed Feb 08 20:45:57 2006] [info] [client 10.0.0.1] Module bug? Request filename is missing for URI / You may notice that the "Module bug?" message written out after the debug message I added, so I think, the info is not caused by PerlTransHander. True? On 2/8/06, Torsten Foertsch <[EMAIL PROTECTED]> wrote: > On Wednesday 08 February 2006 07:13, Ken Perl wrote: > > I see a info in the error.log when I access the uri / and works fine, > > [Wed Feb 08 13:22:35 2006] [info] [client 10.0.0.1] Module bug? > > Request filename is missing for URI / > > > > Is the info reported by modperl2? anything wrong? > > You have written a translation handler that doesn't set $r->filename and > returns OK, right? > > The info you are seeing is generated by the core-maptostorage handler. You can > avoid it either > > a) by setting $r->filename prior to maptostorage or > > b) by returning DECLINED from your translation handler and thus letting the > core translation handler figure the filename out or > > c) by inserting a PerlMapToStorage handler that returns OK and thus skipping > the core-maptostorage handler. > > Torsten > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: timestamp of Apache::DB
That helps already, but need to add the statement into the directory and works fine! On 2/8/06, John Doe <[EMAIL PROTECTED]> wrote: > Perrin Harkins am Dienstag, 7. Februar 2006 18.45: > > On Tue, 2006-02-07 at 08:56 +0100, John Doe wrote: > > > Ken Perl am Dienstag, 7. Februar 2006 07.44: > > > > when Apache::DB is initialized it will write a line of log into > > > > error.log, but without a timestamp, > > > > [notice] Apache::DB initialized in child 1957 > > > > May I add one? > > > > > > yes, by putting the line > > > > > > use CGI::Carp > > > > > > into the httpd.conf file :-) > > > > Huh? How is that going to help? > > It doesn't help in this early startup phase; I misread the question. :-( > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: module bug?
And I found just now, I got the info message before the root / page is returned. On 2/8/06, Ken Perl <[EMAIL PROTECTED]> wrote: > Sounds reasonable. > Based on your anaIysis, I added > > warn "reach last line of WebGUI.pm"; > > into the handler before the last line. > > sub handler{ >... ... >else { >$r->set_handlers(PerlResponseHandler => \&contentHandler); >$r->set_handlers(PerlTransHandler => sub { return > Apache2::Const > ::OK}); >} >warn "reach last line of WebGUI.pm"; >return Apache2::Const::DECLINED; > } > > then I got these two lines of log message like this, > [Wed Feb 8 20:45:57 2006] -e: got last line of WebGUI.pm at > /data/WebGUI/lib/WebGUI.pm line 65. > [Wed Feb 08 20:45:57 2006] [info] [client 10.0.0.1] Module bug? > Request filename is missing for URI / > > You may notice that the "Module bug?" message written out after the > debug message I added, so I think, the info is not caused by > PerlTransHander. True? > > > On 2/8/06, Torsten Foertsch <[EMAIL PROTECTED]> wrote: > > On Wednesday 08 February 2006 07:13, Ken Perl wrote: > > > I see a info in the error.log when I access the uri / and works fine, > > > [Wed Feb 08 13:22:35 2006] [info] [client 10.0.0.1] Module bug? > > > Request filename is missing for URI / > > > > > > Is the info reported by modperl2? anything wrong? > > > > You have written a translation handler that doesn't set $r->filename and > > returns OK, right? > > > > The info you are seeing is generated by the core-maptostorage handler. You > > can > > avoid it either > > > > a) by setting $r->filename prior to maptostorage or > > > > b) by returning DECLINED from your translation handler and thus letting the > > core translation handler figure the filename out or > > > > c) by inserting a PerlMapToStorage handler that returns OK and thus skipping > > the core-maptostorage handler. > > > > Torsten > > > > > > > > > -- > perl -e 'print unpack(u,"62V5N\"FME;G\!E ")' > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
the modperl book link is broken
Hi, The page http://perl.apache.org/docs/offsite/books.html#The_mod_perl_Developer_s_Cookbook introduces two books, their links http://modperlbook.org/ and http://www.modperlcookbook.org/ are both broken now, Does anyone have these two ebooks? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: the modperl book link is broken
I still can't connect the site, : -( I prefer e-book and appreciate that if anyone who have those two books could send me the e-book copy. On 2/8/06, Perrin Harkins <[EMAIL PROTECTED]> wrote: > Ken Perl wrote: > > The page > > http://perl.apache.org/docs/offsite/books.html#The_mod_perl_Developer_s_Cookbook > > introduces two books, their links http://modperlbook.org/ and > > http://www.modperlcookbook.org/ are both broken now > > Those links both work fine for me. Maybe there's a network problem on > your end. If you network is too unreliable to read them on-line, you > can purchase both of these books in print. > > - Perrin > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Apache2::SizeLimit with non-threaded MPMs
I know Apache2:SizeLimit works ony with non-threaded MPMs, but I don't know how to fix the issue, any comments? [Thu Feb 09 13:46:21 2006] [error] [client 221.219.202.148] failed to resolve handler `Apache2::SizeLimit': Apache2::SizeLimit at the moment works only with non-threaded MPMs at /usr/share/perl/5.8/CGI/Carp.pm line 314.\nBEGIN failed--compilation aborted at /usr/lib/perl5/Apache2/SizeLimit.pm line 97.\nCompilation failed in require at (eval 913) line 3.\n -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
debugger command always return IO::Handle::DESTROY
I am using Apache::DB as debugger to debug my modperl2 program. No breakpoints are defined, I input many 'r' and the return is always like below, and the home page can't be displayed in the debug mode while turning off debug mode it home page can be rendered as normal. DB<1> r void context return from IO::Handle::DESTROY IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): 75: sub DESTROY {} DB<1> r void context return from IO::Handle::DESTROY Apache2::SizeLimit::handler(/usr/lib/perl5/Apache2/SizeLimit.pm:248): 248:my $r = shift; Anybody knows about the problem in it? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
detecting server start, stop, graceful in startup.pl
>From the Apache2::ServerUtil API doc, to do something only when server restarts (httpd -k start or httpd -k graceful), check whether restart_count() is bigger than 1: my $cnt = Apache2::ServerUtil::restart_count(); do_something() if $cnt > 1; However, the API doesn't work as above. I tried to add some debug code to my startup.pl script and tried all the command options of apache2ctl, start, stop, graceful, the $cnt is always equal 1. I also tried to write the value $cnt to a /tmp/out file just like in the API doc and got same result, that is % apache2ctl -k start cnt: 1 cnt: 2 % apache2ctl -k graceful cnt: 1 cnt: 3 % apache2ctl -k graceful cnt: 1 cnt: 4 % apache2ctl -k stop cnt: 1 But, I can't detecting start, stop, graceful in startup.pl coding just like in the API doc, Could you give me some comments? thanks. -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: debugger command always return IO::Handle::DESTROY
And I also can't quit Apache::DB by entering many 'q' commands, DB<5> q IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): 75: sub DESTROY {} DB<5> q IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): 75: sub DESTROY {} DB<5> q IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): 75: sub DESTROY {} DB<5> q the last 'q' command hang there, any comments? On 2/9/06, Ken Perl <[EMAIL PROTECTED]> wrote: > I am using Apache::DB as debugger to debug my modperl2 program. No > breakpoints are defined, I input many 'r' and the return is always > like below, and the home page can't be displayed in the debug mode > while turning off debug mode it home page can be rendered as normal. > > DB<1> r > void context return from IO::Handle::DESTROY > IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): > 75: sub DESTROY {} > DB<1> r > void context return from IO::Handle::DESTROY > Apache2::SizeLimit::handler(/usr/lib/perl5/Apache2/SizeLimit.pm:248): > 248:my $r = shift; > > Anybody knows about the problem in it? > > -- > perl -e 'print unpack(u,"62V5N\"FME;G\!E ")' > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: detecting server start, stop, graceful in startup.pl
No, I want to do something in the startup.pl script. When apache start, I also want to say my modperl program is starting and started, when stop, I want to say my modperl program is stopping and stopped. When graceful, I want to say reloading and reloaded. But I didn't find a API could help, any ideas? On 2/12/06, Frank Wiles <[EMAIL PROTECTED]> wrote: > On Sun, 12 Feb 2006 15:02:38 +0800 > Ken Perl <[EMAIL PROTECTED]> wrote: > > > >From the Apache2::ServerUtil API doc, to do something only when > > >server > > restarts (httpd -k start or httpd -k graceful), check whether > > restart_count() is bigger than 1: > > > > my $cnt = Apache2::ServerUtil::restart_count(); > > do_something() if $cnt > 1; > > > > However, the API doesn't work as above. > > > > [...snip...] > > > > But, I can't detecting start, stop, graceful in startup.pl coding just > > like in the API doc, Could you give me some comments? thanks. > > I think you are misreading what the docs are saying. > Apache2::ServerUtil::restart_count() is just that a count of the > number of times the server was restarted. So a start will show a > count of two and gracefuls would be greater than two. > > The server restarts itself at least once during start up and you > typically do not want to do anything during that initial restart. > > - > Frank Wiles <[EMAIL PROTECTED]> > http://www.wiles.org > - > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: detecting server start, stop, graceful in startup.pl
I add your code to my startup.pl, but it doesn't work. # apache2ctl -k start Program is starting Stopping... #apache2ctl -k graceful # apache2ctl -k stop On 2/13/06, Frank Wiles <[EMAIL PROTECTED]> wrote: > On Mon, 13 Feb 2006 09:17:57 +0800 > Ken Perl <[EMAIL PROTECTED]> wrote: > > > No, I want to do something in the startup.pl script. > > When apache start, I also want to say my modperl program is starting > > and started, when stop, I want to say my modperl program is stopping > > and stopped. When graceful, I want to say reloading and reloaded. > > But I didn't find a API could help, any ideas? > > Hi Ken, > > I haven't tested this, but it should work. In your startup.pl do > something like this: > > my $started = 0; > my $cnt = Apache2::ServerUtil::restart_count(); > > if( !$started and $cnt == 1 ) { > $started = 1; > print "Program is starting\n"; > } > > if( $cnt > 2 ) { > print "Restarting"; > } > > if( $started and $cnt == 1 ) { > print "Stopping..."; > } > > - > Frank Wiles <[EMAIL PROTECTED]> > http://www.wiles.org > - > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: debugger command always return IO::Handle::DESTROY
I tried to stop apache by issuing apache2ctl -k stop in another terminal, the command exit without any output, but the debugger is still hung there. I have to send signal KILL to the process. On 2/12/06, Frank Wiles <[EMAIL PROTECTED]> wrote: > On Sun, 12 Feb 2006 18:55:13 +0800 > Ken Perl <[EMAIL PROTECTED]> wrote: > > > And I also can't quit Apache::DB by entering many 'q' commands, > > DB<5> q > > IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): > > 75: sub DESTROY {} > > DB<5> q > > IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): > > 75: sub DESTROY {} > > DB<5> q > > IO::Handle::DESTROY(/usr/lib/perl/5.8/IO/Handle.pm:75): > > 75: sub DESTROY {} > > DB<5> q > > > > the last 'q' command hang there, any comments? > > I believe you have to stop Apache to exit the debugger when using it. > If that doesn't fix it let me know. > > - > Frank Wiles <[EMAIL PROTECTED]> > http://www.wiles.org > - > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: debugger command always return IO::Handle::DESTROY
Normaly, ctrl +c works for a simple modperl program, I am trying to debug a more complex modperl program. I'd like to provide all info you need, maybe I need some guide on what's needed. What I want to do is stepping into the modperl2 WebGUI program(https://svn.webgui.org/svnroot/WebGUI/ and fix some bugs. When I request the home page, I get the prompt of the debugger, then I input command 'r' to let debugger return from the contentHandler(), and input many other 'r' to return too, I just want to see if I can see the home page under debugging mode, but I can't, only lots of IO::Handle::DESTROY, and finally, hang there, I can't input any more debugger command, kill the apache2 process is the only thing left could be done. And on the browser side, I see from the status bar it is still waiting to dowload the .gif images, however, if trun the debugging mode off, home page can be displayed smoothly. In my httpd.conf, I enabled Apache2::Reload and Apache2::Status. Anything I missed or anything you want to know, please let me know. On 2/13/06, Perrin Harkins <[EMAIL PROTECTED]> wrote: > Ken Perl wrote: > > I tried to stop apache by issuing apache2ctl -k stop in another > > terminal, the command exit without any output, but the debugger is > > still hung there. I have to send signal KILL to the process. > > That will work, but the usual way to stop is to hit Ctrl-C in the > debugger terminal. The apache2ctl script probably fails because you are > running with a single process so the PID file isn't there or isn't accurate. > > I haven't seen your IO::Handle issue before, but I suspect the debugger > is just informing you about some code that ran after your return. The > real issue is why your home page doesn't display as you expect. To help > you with that, you need to give us more details about what happens and > what was supposed to happen. > > - Perrin > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: debugger command always return IO::Handle::DESTROY
Yes, my browser gets most of the home page back if I input lots of 'r', except some images are still waiting for downloading. If starting server with -X only the page could be retrieved complete successfully. On 2/14/06, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Mon, 2006-02-13 at 14:27 +0800, Ken Perl wrote: > > Normaly, ctrl +c works for a simple modperl program, I am trying to > > debug a more complex modperl program. > > I don't see how that would a make difference. You're just trying to > send a signal to the httpd process by hitting Ctrl-C. > > > I'd like to provide all info you need, maybe I need some guide on what's > > needed. > > Your previous message said that it didn't work, but didn't say what > would have happened if it did work, or what it actually did. The > information you gave here is better. > > > When I request the home page, I get the prompt of the debugger > > That's good. > > > then I > > input command 'r' to let debugger return from the contentHandler(), > > and input many other 'r' to return too, I just want to see if I can > > see the home page under debugging mode, but I can't > > Your browser never gets anything back? Try using telnet or lwp-get to > test it, so you can see if anything gets sent back. You don't need to > test the images. > > > only lots of > > IO::Handle::DESTROY, and finally, hang there, > > I can't input any more debugger command, kill the apache2 process is > > the only thing left could be done. > > And on the browser side, I see from the status bar it is still waiting > > to dowload the .gif images, however, if trun the debugging mode off, > > home page can be displayed smoothly. > > What happens if you run the server with -X but don't add the debugger? > Can you get the page then? > > - Perrin > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: detecting server start, stop, graceful in startup.pl
Better than before, but only 'start' works. debian:~/WebGUI# apache2ctl -k start [Fri Feb 17 22:34:21 2006] preload.perl: Program is starting Loading WebGUI.conf debian:~/WebGUI# apache2ctl -k graceful [Fri Feb 17 22:34:55 2006] preload.perl: Program is starting Loading WebGUI.conf [Fri Feb 17 22:34:57 2006] -e: I am shutting down at /root/WebGUI/sbin/preload.perl line 33. debian:~/WebGUI# apache2ctl -k stop [Fri Feb 17 22:35:28 2006] preload.perl: Program is starting Loading WebGUI.conf [Fri Feb 17 22:35:29 2006] -e: I am shutting down at /root/WebGUI/sbin/preload.perl line 33. On 2/17/06, Philippe M. Chiasson <[EMAIL PROTECTED]> wrote: > Ken Perl wrote: > > I add your code to my startup.pl, but it doesn't work. > > Change 'print' to warn and you should see the expected behaviour. > > The only exception is stop, that doesn't go thru a restart cycle, so the > correct way to detect a shutdown is to register a server_shutdown callback > like this : > > Apache2::ServerUtil::server_shutdown_cleanup_register(sub { warn "I am > shutting down" }); > > > # apache2ctl -k start > > Program is starting > > Stopping... > > > > #apache2ctl -k graceful > > > > > > # apache2ctl -k stop > > > > > > On 2/13/06, Frank Wiles <[EMAIL PROTECTED]> wrote: > > > >>On Mon, 13 Feb 2006 09:17:57 +0800 > >>Ken Perl <[EMAIL PROTECTED]> wrote: > >> > >> > >>>No, I want to do something in the startup.pl script. > >>>When apache start, I also want to say my modperl program is starting > >>>and started, when stop, I want to say my modperl program is stopping > >>>and stopped. When graceful, I want to say reloading and reloaded. > >>>But I didn't find a API could help, any ideas? > >> > >> Hi Ken, > >> > >> I haven't tested this, but it should work. In your startup.pl do > >> something like this: > >> > >> my $started = 0; > >> my $cnt = Apache2::ServerUtil::restart_count(); > >> > >> if( !$started and $cnt == 1 ) { > >> $started = 1; > >> print "Program is starting\n"; > >> } > >> > >> if( $cnt > 2 ) { > >> print "Restarting"; > >> } > >> > >> if( $started and $cnt == 1 ) { > >> print "Stopping..."; > >> } > >> > > > Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : > 88C3A5A5 > http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 > 88C3A5A5 > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: detecting server start, stop, graceful in startup.pl
Though it will write to the log and it is wrong as the console. On 2/18/06, Philippe M. Chiasson <[EMAIL PROTECTED]> wrote: > Ken Perl wrote: > > Better than before, but only 'start' works. > > > > debian:~/WebGUI# apache2ctl -k start > > [Fri Feb 17 22:34:21 2006] preload.perl: Program is starting > > Loading WebGUI.conf > > debian:~/WebGUI# apache2ctl -k graceful > > [Fri Feb 17 22:34:55 2006] preload.perl: Program is starting > > Loading WebGUI.conf > > [Fri Feb 17 22:34:57 2006] -e: I am shutting down at > > /root/WebGUI/sbin/preload.perl line 33. > > debian:~/WebGUI# apache2ctl -k stop > > [Fri Feb 17 22:35:28 2006] preload.perl: Program is starting > > Loading WebGUI.conf > > [Fri Feb 17 22:35:29 2006] -e: I am shutting down at > > /root/WebGUI/sbin/preload.perl line 33. > > the restarts should show up too in your error_log, not on the console. > > -- > Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : > 88C3A5A5 > http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 > 88C3A5A5 > > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
due core cpu
Will a modperl2 program run faster on a cue core cpu machine than a single cpu machine if we assume their speeds are same? In other words, should I buy a new due core cpu machine? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
clusters
Is it possible to make a modperl application to run in cluster? if yes, how to do that? any doc? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: clusters
Do you mean that the pound work great with apache 2.0 and apache 1.3 both? On 5/9/06, Harmen <[EMAIL PROTECTED]> wrote: On Tue, May 09, 2006 at 04:47:14PM +0800, Ken Perl wrote: > Is it possible to make a modperl application to run in cluster? if > yes, how to do that? any doc? Take a few mod_perl servers and put one pound (http://www.apsis.ch/poung/) reverse proxy in front of them. Works great. -- The Moon is Waxing Gibbous (85% of Full) -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
how to use Apache::DBI
I've configured the Apache::DBI in httpd.conf like this, PerlModule Apache::DBI I didn't have Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr) in startup.pl since we don't use startup.pl. and the doc says to config it in httpd.conf is OK. my question is I can not find any persistent connections for my CGI script. any usage error here? -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: how to use Apache::DBI
I didn't run it under ModPerl::Registry, is there any risk to use the module? maybe I have to run lots of testing to the existing scripts. Could I just run use the previous connections via DBI->connect_cache instead of the Apache::DBI in one single cgi script(but the script will call other modules which may make new db connections with same db password and attributes)? In my testing, I saw some different database handlers returned instead of the same hash reference address. On 7/30/07, Clinton Gormley <[EMAIL PROTECTED]> wrote: > On Mon, 2007-07-30 at 18:21 +0800, Ken Perl wrote: > > I've configured the Apache::DBI in httpd.conf like this, > > > > PerlModule Apache::DBI > > > > I didn't have Apache::DBI->connect_on_init($data_source, $username, > > $auth, \%attr) in startup.pl since we don't use startup.pl. and the > > doc says to config it in httpd.conf is OK. > > > > my question is I can not find any persistent connections for my CGI > > script. any usage error here? > > Persistent connections will not work for straight CGI scripts, because > CGI is not persistent. > > For each CGI request, a new perl interpreter is loaded, your script is > compiled, run, and the Perl process exits. > > mod_perl IS persistent, as are your CGI scripts run via > ModPerl::Registry etc. > > You don't need connect_on_init to work, but you do need mod_perl > > Clint > > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: how to use Apache::DBI
OK, got it. Is it possible to use the same db connections in one request? if yes, could you please show me how to implement this if a cgi script calls many times other perl modules which requests db connections to work. On 7/31/07, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On 7/30/07, Ken Perl <[EMAIL PROTECTED]> wrote: > > I didn't run it under ModPerl::Registry > > Did you run it under some other mod_perl module, like > ModPerl::PerlRun? If it's a CGI script, and you aren't running it > through something like this, then you aren't running it through > mod_perl and you won't be able to use persistent connections. > > > Could I just run use the previous connections via DBI->connect_cache > > instead of the Apache::DBI in one single cgi script > > Not if you aren't running it through mod_perl. CGI scripts exit after > each request, so they can't do persistent connections. > > - Perrin > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: how to use Apache::DBI
ok, I'll try connect_cached too. On 8/1/07, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On 7/31/07, Clinton Gormley <[EMAIL PROTECTED]> wrote: > > What you could do instead is to use DBI's connect_cached method, which > > provides similar functionality. I actually use this instead of > > Apache::DBI, even when running under mod_perl. > > I also use connect_cached in many cases. Just be aware of what you're > missing out on, because Apache::DBI does some extra things to protect > you. > > Here are the main differences: > - Apache::DBI doesn't require code changes. connect_cached() does. > - Apache::DBI will avoid caching a connection that you open during > server startup, so that you don't accidentally try to use the same > connection in multiple processes (due to forking). > - Apache::DBI issues an automatic rollback at the end of every > request, so that if your code dies while it has a transaction going, > that will be freed before the next request. (This is only if you open > your handles with AutoCommit off though.) > > Hmm, maybe this should be in the Apache::DBI documentation. > > - Perrin > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E
Re: how to use Apache::DBI
it is really good gotchas and should be included to the ModPerl::Registry document. thanks a lot. On 7/31/07, Clinton Gormley <[EMAIL PROTECTED]> wrote: > On Tue, 2007-07-31 at 10:09 +0800, Ken Perl wrote: > > I didn't run it under ModPerl::Registry, is there any risk to use the > > module? maybe I have to run lots of testing to the existing scripts. > > > > > There is a risk to using this module, but also a significant benefit: > speed. > > The risks come from: > > - the fact that your script has been written to run one and then exit, >so you may have a number of variables that aren't initialised >properly - this can produce unexpected errors > > - ModPerl::Registry wraps your script in another sub, which may produce >unexpected closures (you would see warnings about variables not >remaining shared in your log) > > So if you move to using Registry, then you will need to check your > scripts. > > However, using Registry means that your script is loaded and compiled > once, avoiding this performance hit for subsequent requests - hence it > runs faster. > > Have a look at this post that I wrote about gotchas under Registry, it > may help you migrate: > http://www.gossamer-threads.com/lists/modperl/modperl/94203#94203 > > Clint > > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E