Re: RegistryLoader
> If I user RegistryLoader to preload a script, should it > show up in /perl-status?rgysubs (Apache::Status)?? Yes. Make sure that RegistryLoader didn't fail. (hint: watch the log) ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: RegistryLoader
Stas Bekman wrote: > > > If I user RegistryLoader to preload a script, should it > > show up in /perl-status?rgysubs (Apache::Status)?? > > Yes. > > Make sure that RegistryLoader didn't fail. (hint: watch the log) O.K. It doesn't show up in the error_log. === cat error_log [Mon Jan 31 11:10:29 2000] [notice] Apache/1.3.9 (Unix) mod_perl/1.21 configured -- resuming normal operations Here's the snippet from the startup.pl file: # # Preload certain scripts # # xyz scripts $Apache::Registry::Debug = 4; my $rbuyit = Apache::RegistryLoader->new('abc.xyz.com/cgi-bin/script', '/usr/local/www_sh/cgi-bin/xyz/script'); Here's the version info: $Apache::RegistryLoader::VERSION = '1.90'; Any sugguestions? Please let me know if more info is needed. Thanks. Bill begin:vcard n:Deegan;William tel;fax:650-413-1355 tel;work:650-598-3858 x-mozilla-html:FALSE url:http://www.iescrow.com org:iEscrow,Inc. version:2.1 email;internet:[EMAIL PROTECTED] title:Web Site Operations Manager note:http://www.orangefood.com/baddog adr;quoted-printable:;;2600 Bridge Parkway=0D=0ASuite 201;Redwood Shores;CA;94065; x-mozilla-cpt:;-30592 fn:William Deegan end:vcard
Re: RegistryLoader
> Stas Bekman wrote: > > > > > If I user RegistryLoader to preload a script, should it > > > show up in /perl-status?rgysubs (Apache::Status)?? > > > > Yes. > > > > Make sure that RegistryLoader didn't fail. (hint: watch the log) > > O.K. It doesn't show up in the error_log. > === > cat error_log > [Mon Jan 31 11:10:29 2000] [notice] Apache/1.3.9 (Unix) mod_perl/1.21 > configured -- resuming normal operations Before the server is started STDERR is not tied to error_log, all the log messages go to the console you start the httpd from. > Here's the snippet from the startup.pl file: > > # > # Preload certain scripts > # > # xyz scripts > $Apache::Registry::Debug = 4; > > my $rbuyit = Apache::RegistryLoader->new('abc.xyz.com/cgi-bin/script', >'/usr/local/www_sh/cgi-bin/xyz/script'); Hmm... Virtual hosts? I've never tried it with VH, I'm not sure it will work. Otherwise you shouldn't include the hostname in the first argument. What error message do you see? > > > > Here's the version info: > > $Apache::RegistryLoader::VERSION = '1.90'; > > > Any sugguestions? > Please let me know if more info is needed. > > Thanks. > > Bill ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: RegistryLoader
Stas Bekman wrote: > Before the server is started STDERR is not tied to error_log, all the log > messages go to the console you start the httpd from. O.K. I get no messages. > > > Here's the snippet from the startup.pl file: > > > > # > > # Preload certain scripts > > # > > # xyz scripts > > $Apache::Registry::Debug = 4; > > > > my $rbuyit = Apache::RegistryLoader->new('abc.xyz.com/cgi-bin/script', > >'/usr/local/www_sh/cgi-bin/xyz/script'); > > Hmm... Virtual hosts? I've never tried it with VH, I'm not sure it will > work. Otherwise you shouldn't include the hostname in the first argument. > > What error message do you see? I've changed the startup.pl script to be the following: === my $rl = Apache::RegistryLoader->new('/cgi-reg/UL', '/usr/local/www_sh/cgi-bin/UL'); This should eliminate the virtual host issue? Still the same. Start server. No error messages. Check "http://abc.xyz.com/perl-status?rgysubs", and there are no compiled modules listed. Any other sugguestions? The machine is running 4 virtual hosts. -Bill begin:vcard n:Deegan;William tel;fax:650-413-1355 tel;work:650-598-3858 x-mozilla-html:FALSE url:http://www.iescrow.com org:iEscrow,Inc. version:2.1 email;internet:[EMAIL PROTECTED] title:Web Site Operations Manager note:http://www.orangefood.com/baddog adr;quoted-printable:;;2600 Bridge Parkway=0D=0ASuite 201;Redwood Shores;CA;94065; x-mozilla-cpt:;-30592 fn:William Deegan end:vcard
Re: RegistryLoader
> Stas Bekman wrote: > > Before the server is started STDERR is not tied to error_log, all the log > > messages go to the console you start the httpd from. > > O.K. I get no messages. > > > > > > Here's the snippet from the startup.pl file: > > > > > > # > > > # Preload certain scripts > > > # > > > # xyz scripts > > > $Apache::Registry::Debug = 4; > > > > > > my $rbuyit = Apache::RegistryLoader->new('abc.xyz.com/cgi-bin/script', > > >'/usr/local/www_sh/cgi-bin/xyz/script'); > > > > Hmm... Virtual hosts? I've never tried it with VH, I'm not sure it will > > work. Otherwise you shouldn't include the hostname in the first argument. > > > > What error message do you see? > > I've changed the startup.pl script to be the following: > === > my $rl = Apache::RegistryLoader->new('/cgi-reg/UL', >'/usr/local/www_sh/cgi-bin/UL'); > > > This should eliminate the virtual host issue? > > Still the same. > > Start server. No error messages. > Check "http://abc.xyz.com/perl-status?rgysubs", and there are no > compiled > modules listed. 'script's not 'modules'... may be there is something different with VH? I see : Apache::ROOT::perl::test::test_2epl when I prelaod Apache::RegistryLoader->new->handler("/perl/test/test.pl", "/home/httpd/perl/test/test.pl"); Now I see your problem! You didn't call the handler() method!!! you should do: my $rl = Apache::RegistryLoader->new; $rl->handler('/cgi-reg/UL','/usr/local/www_sh/cgi-bin/UL'); Did you do 'perldoc Apache::RegistryLoader'? Now it should work. > > > Any other sugguestions? > The machine is running 4 virtual hosts. > > -Bill ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: RegistryLoader Segmentation fault
Hi there, On Fri, 1 Mar 2002, Fran Fabrizio wrote: > using Apache::RegistryLoader. I'm getting a seg fault when I attempt to > start apache. Read mod_perl/SUPPORT. Did you compile your own Perl, mod_perl and Apache? You might be better off with Perl version 5.6.1 instead. Are you using DSO? 73, Ged.
Re: RegistryLoader Segmentation fault
Ged, >>using Apache::RegistryLoader. I'm getting a seg fault when I attempt to >>start apache. >> > > Read mod_perl/SUPPORT. Ok I've looked through it. I've tried some of the quicker suggestions... gdb -core core and gdb httpd core tell me: Core was generated by `/usr/local/apache/bin/httpd'. Program terminated with signal 11, Segmentation fault. #0 0x80ca6b6 in Perl_gv_init () I'll try some of the more involved stuff here in a moment > Did you compile your own Perl, mod_perl and Apache? Yes. Perl 5.6.0, mod_perl 1.25, apache 1.3.19. > You might be better off with Perl version 5.6.1 instead. I will upgrade and see what happens. > Are you using DSO? No. Thanks for the pointers thus far! -Fran
Re: RegistryLoader Segmentation fault
whoops, forgot to CC the list, but it seems Ged stepped in with the same info... Fran Fabrizio wrote: > > Hello, > > I'm trying to follow the script in section 2.14 of the book "mod_perl > Developer's Cookbook" in order to pre-load my Apache::registry scripts > using Apache::RegistryLoader. I'm getting a seg fault when I attempt to > start apache. > I've never seen a segfault with RegistryLoader, but there are a few avenues that might help. see Recipe 9.19 for a general introduction into using gbd and getting a backtrace, as well as the SUPPORT document in the mod_perl sources maybe someone else has seen this before and can offer more help --Geoff
Re: RegistryLoader Segmentation fault
> see Recipe 9.19 for a general introduction into using gbd and getting > a backtrace, as well as the SUPPORT document in the mod_perl sources Here is the backtrace for now. I'm going to try Perl 5.6.1 and then try to see what the backtrace looks like with a PERL_DEBUG=1 enabled mod_perl. Thanks for the help thus far. -Fran (gdb) bt #0 0x80ca6b6 in Perl_gv_init () #1 0x80cb9d5 in Perl_gv_fetchpv () #2 0x80810dd in perl_section_hash_init () #3 0x8081403 in perl_section () #4 0x809aa40 in ap_clear_module_list () #5 0x809b598 in ap_handle_command () #6 0x809b635 in ap_srm_command_loop () #7 0x809ef2a in ap_limit_section () #8 0x809aa40 in ap_clear_module_list () #9 0x809b598 in ap_handle_command () #10 0x809b635 in ap_srm_command_loop () #11 0x809bd52 in ap_process_resource_config () #12 0x80a0cc7 in ap_exists_config_define () #13 0x809aadc in ap_clear_module_list () #14 0x809b598 in ap_handle_command () #15 0x809b635 in ap_srm_command_loop () #16 0x809bd52 in ap_process_resource_config () #17 0x809c695 in ap_read_config () #18 0x80a6e9f in main () #19 0x400a1b65 in __libc_start_main (main=0x80a6bb8 , argc=1, ubp_av=0xbaf4, init=0x80621d4 <_init>, fini=0x814a26c <_fini>, rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xbaec) at ../sysdeps/generic/libc-start.c:111
Re: RegistryLoader Segmentation fault
Fran Fabrizio wrote: > > Hello, > > I'm trying to follow the script in section 2.14 of the book "mod_perl > Developer's Cookbook" in order to pre-load my Apache::registry scripts > using Apache::RegistryLoader. I'm getting a seg fault when I attempt to > start apache. This was the problem I was having last Friday. Just wanted to post the results - the upgrade to Perl 5.6.1 solved the problem. PERL_DEBUG=1 on mod_perl compilation was also very helpful. Thanks to everyone for their help! -Fran
Re: RegistryLoader not loading?
> I have mod_perl 1.21 and am trying to preload some scripts. > > I can see them in my /perl-status page. But, when I load the script it is > not using mod_perl. What am I missing > > this is the startment in my startup.pl file. > $r->handler("/cgi-bin/admin.cgi", > "/home/jter/public_html/cgi-bin/admin.cgi"); > > and I am trying to connect to www.mysite.com/cgi-bin/admin.cgi RegistryLoader has nothing to do with mod_perl location configuration. Did you configure to be served by mod_perl? please, post the relevant section of you httpd.conf to the list. RegistryLoader, just saves the overhead of the first call to registry script per process and possibly sharing of the code between the processes. ___ Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: RegistryLoader not loading?
Actually I wasn't using the tag. I was trying to use this SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI But, I eventually gave up and got it working with Does anybody konw if I could actually get the tag to do what I wanted? Thanks -Jason - Original Message - From: "Stas Bekman" <[EMAIL PROTECTED]> To: "Jason Terry" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, December 30, 1999 12:15 AM Subject: Re: RegistryLoader not loading? > > I have mod_perl 1.21 and am trying to preload some scripts. > > > > I can see them in my /perl-status page. But, when I load the script it is > > not using mod_perl. What am I missing > > > > this is the startment in my startup.pl file. > > $r->handler("/cgi-bin/admin.cgi", > > "/home/jter/public_html/cgi-bin/admin.cgi"); > > > > and I am trying to connect to www.mysite.com/cgi-bin/admin.cgi > > RegistryLoader has nothing to do with mod_perl location configuration. Did > you configure to be served by mod_perl? please, post > the relevant section of you httpd.conf to the list. > > RegistryLoader, just saves the overhead of the first call to registry > script per process and possibly sharing of the code between the processes. > > ___ > Stas Bekmanmailto:[EMAIL PROTECTED] http://www.stason.org/stas > Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC > perl.apache.orgmodperl.sourcegarden.org perlmonth.comperl.org > single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: RegistryLoader and multiple virtualhosts
>Is there a way to RegistryLoader a single instance of a script >/cgi-bin/admin.cgi >and have this instance work across ALL virtual hosts. > >simply loading >$r->handler("/cgi-bin/admin.cgi", >"/home/jter/public_html/cgi-bin/admin.cgi"); Where are you calling the above? If they are the same script try using: $PerlRequire= '/cgi-bin/admin.cgi'; in your main servers config.
Re: RegistryLoader and multiple virtualhosts
On Thu, 30 Dec 1999, Jason Terry wrote: > Is there a way to RegistryLoader a single instance of a script > /cgi-bin/admin.cgi > and have this instance work across ALL virtual hosts. > > simply loading > $r->handler("/cgi-bin/admin.cgi", > "/home/jter/public_html/cgi-bin/admin.cgi"); > doesn't seem to work. It loads it, but if I check my processes after > running the script, I see multiple instances of it in the child processes, > one for each host. Yes, in your PerlRequire startup file set $Apache::Registry::NameWithVirtualHost to 0. Don't forget to see the guide http://perl.apache.org/guide/config.html#A_Script_from_one_virtual_host_c for possible problems when setting this value to 0. HTH, Radu Greab
Re: RegistryLoader causes "subroutine redefined" errors on import?
> I know this topic has been discussed to death, but I think I can add > something new. :-) > > Upon using Apache::RegistryLoader, I noticed my error logs started > filling up with the dreaded "subroutine redefined" error. These errors > occur at the moment my scripts scripts are preloaded using > Apache::RegistryLoader. > > I put together a minimalistic example to demonstrate the problem. > Consider the following module where function "foo" is exported by > default and "bar" is exported on request. I couldn't reproduce the warns you are talking about. I think your Apache::RegistryLoader just didn't load the file... Try the latest version from cvs (I've modified it to provide a better diagnostics on failure to preload). Try it first... I'm Apache/1.3.10-dev (Unix) mod_perl/1.21_01-dev (linux/perl5.005_03) > > ### > > package Foo; > > use strict; > use vars qw(@ISA @EXPORT @EXPORT_OK); > use Exporter (); > > @ISA = ('Exporter'); > @EXPORT = qw(foo); > @EXPORT_OK = qw(bar); > > sub foo { > return "foo"; > } > > sub bar { > return "bar"; > } > > 1; > > ### > > And consider the following script served by Apache::Registry: > > ### > > #!/usr/bin/perl -w > > use strict; > use CGI (); > use Foo (); # works okay, no error > #use Foo; # causes "Subroutine foo redefined..." error > #use Foo qw(bar); # causes "Subroutine bar redefined..." error > #use Foo qw(:DEFAULT bar); # causes errors for both foo and bar > > my $q = CGI->new(); > print $q->header(); > print "Hello World\n"; > > ### > > I tried the above script while "use"-ing Foo using the above techniques > (stopping and starting the server each time to retest > Apache::RegistryLoader.) Upon each server start, RegistryLoader kicked > out the error(s) shown commented above. So it seems to be the import > process causing the error. > > In all cases, the Apache::Registry script works fine. The error only > appears when the script is preloaded using Apache::RegistryLoader -- I > can suppress the error by not using RegistryLoader. > > So what's causing the error? Why is the subroutine being redefined? > > Thanks, > Matt > > apache 1.3.6 > mod_perl 1.21 > perl 5.00503 > Apache::Registry 2.01 > Apache::RegistryLoader 1.90 > > ___ 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