Re: Apache::DBI with mod_perl 2.0
Ok, still no luck. Every dependancy has more dependancies all of which go back and back to mod_perl 1 stuff already being in place My question is, can I download the Apache 1.3 source (don't make it), then run the mod_perl 1 build to get all the pm files in place, then rebuild my mod_perl 2 (against my installed Apache 2 source). Also, we mentioned the whole Bundle::Apache, will there be one of those for Apache 2 and will it contain all the mod_perl 1 AND mod_perl 2 stuff to allow running in Compat? Thanks, -Zac - Original Message - From: Stas Bekman [EMAIL PROTECTED] To: Zac Morris [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, June 25, 2002 12:26 PM Subject: Re: Apache::DBI with mod_perl 2.0 Zac Morris wrote: Ahhh, ok more clarity. :) Forgive me if I'm just not doing my detective work in poking around for documentation, but is there a doc that contains all the kludges or assumed modules I need to already have in place? All the docs that we have now are at http://perl.apache.org/release/docs/index.html Most of the kludges are documented here: http://perl.apache.org/release/docs/2.0/user/compat/compat.html There are much more to come, but it'll take time. For now there is more than enough docs to get yourself started. If something is unclear or missing please shout aloud. I'm assuming that the bulk of these things are handled via a CPAN Apache::bundle install, and because mod_perl2 is still beta we don't have that in place yet? yes, but Apache::Module is an XS module using mod_perl 1.0's API, so it won't be in the Apache::Bundle for 2.0. This patch may go in soon: Index: lib/Apache/compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.61 diff -u -r1.61 compat.pm --- lib/Apache/compat.pm 4 Jun 2002 12:40:53 - 1.61 +++ lib/Apache/compat.pm 25 Jun 2002 15:17:56 - @@ -91,7 +91,8 @@ } sub module { -require Apache::Module; +eval { require Apache::Module }; +die Please install Apache::Module from CPAN if $@; return Apache::Module::loaded($_[1]); } Thanks for all this info, learning more and more every day. :) cool :) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0
Zac Morris wrote: Ok, still no luck. Every dependancy has more dependancies all of which go back and back to mod_perl 1 stuff already being in place My question is, can I download the Apache 1.3 source (don't make it), then run the mod_perl 1 build to get all the pm files in place, then rebuild my mod_perl 2 (against my installed Apache 2 source). Sorry Zac, my diagnosis and patch were wrong. mod_perl 2.0's compat layer doesn't require mod_perl 1.0 to be installed, sorry for confusing people. Apache::Module *is* in 2.0. But for some reason it didn't work for you. So let's try to investigate why. It seems to me that you have Apache::Module for 1.0 installed and it gets loaded instead of 2.0's version. Can you list all Apache/Module found on your machine (pm, so, etc)? locate Apache/Module I'm certain that if you install mod_perl 2.0 into Apache2/ dirs (even though you don't have mod_perl 1.0 installed) this problem will go away. But I'd still like to figure out what kind of collission you have now. Also, we mentioned the whole Bundle::Apache, will there be one of those for Apache 2 and will it contain all the mod_perl 1 AND mod_perl 2 stuff to allow running in Compat? no, it'll contain only stuff needed for 2.0, which may include modules that work for both mod_perls, but definitely not mod_perl 1.0. Again I apologize for my mistake. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0
Yeah, so I've tried these suggestions: use Apache2(); use Apache::compat; and I'm still getting the errors: Undefined subroutine Apache::Module::loaded called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95. Compilation failed in require at ./db_connect_test.pm line 38. BEGIN failed--compilation aborted at ./db_connect_test.pm line 38. I think this boils down to something Per said earlier, I've never installed mod_perl1 only mod_perl2 on an apache 2 server... As I understand it the use Apache::compat just allows your script to utilize the mod_perl1 modules correct? Thanks, -Zac
Re: Apache::DBI with mod_perl 2.0
Zac Morris wrote: Yeah, so I've tried these suggestions: use Apache2(); use Apache::compat; and I'm still getting the errors: Undefined subroutine Apache::Module::loaded called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95. Compilation failed in require at ./db_connect_test.pm line 38. BEGIN failed--compilation aborted at ./db_connect_test.pm line 38. Apache::Module is not a part of the mod_perl 1.0 core, unfortunately you have to install it to get this thing working. We will see if there is a better solution for this kludge. I think this boils down to something Per said earlier, I've never installed mod_perl1 only mod_perl2 on an apache 2 server... you cannot install mod_perl 1.0 with apache 2 server. You probably mean within the same perl libs install, since you can have both versions reside under the same perl installation. As I understand it the use Apache::compat just allows your script to utilize the mod_perl1 modules correct? mod_perl 1.0's third party modules, yes. -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0
Ahhh, ok more clarity. :) Forgive me if I'm just not doing my detective work in poking around for documentation, but is there a doc that contains all the kludges or assumed modules I need to already have in place? I'm assuming that the bulk of these things are handled via a CPAN Apache::bundle install, and because mod_perl2 is still beta we don't have that in place yet? Thanks for all this info, learning more and more every day. :) -Zac - Original Message - From: Stas Bekman [EMAIL PROTECTED] To: Zac Morris [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, June 25, 2002 11:02 AM Subject: Re: Apache::DBI with mod_perl 2.0 Zac Morris wrote: Yeah, so I've tried these suggestions: use Apache2(); use Apache::compat; and I'm still getting the errors: Undefined subroutine Apache::Module::loaded called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95. Compilation failed in require at ./db_connect_test.pm line 38. BEGIN failed--compilation aborted at ./db_connect_test.pm line 38. Apache::Module is not a part of the mod_perl 1.0 core, unfortunately you have to install it to get this thing working. We will see if there is a better solution for this kludge. I think this boils down to something Per said earlier, I've never installed mod_perl1 only mod_perl2 on an apache 2 server... you cannot install mod_perl 1.0 with apache 2 server. You probably mean within the same perl libs install, since you can have both versions reside under the same perl installation. As I understand it the use Apache::compat just allows your script to utilize the mod_perl1 modules correct? mod_perl 1.0's third party modules, yes. -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0
Zac Morris wrote: Ahhh, ok more clarity. :) Forgive me if I'm just not doing my detective work in poking around for documentation, but is there a doc that contains all the kludges or assumed modules I need to already have in place? All the docs that we have now are at http://perl.apache.org/release/docs/index.html Most of the kludges are documented here: http://perl.apache.org/release/docs/2.0/user/compat/compat.html There are much more to come, but it'll take time. For now there is more than enough docs to get yourself started. If something is unclear or missing please shout aloud. I'm assuming that the bulk of these things are handled via a CPAN Apache::bundle install, and because mod_perl2 is still beta we don't have that in place yet? yes, but Apache::Module is an XS module using mod_perl 1.0's API, so it won't be in the Apache::Bundle for 2.0. This patch may go in soon: Index: lib/Apache/compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.61 diff -u -r1.61 compat.pm --- lib/Apache/compat.pm4 Jun 2002 12:40:53 - 1.61 +++ lib/Apache/compat.pm25 Jun 2002 15:17:56 - @@ -91,7 +91,8 @@ } sub module { -require Apache::Module; +eval { require Apache::Module }; +die Please install Apache::Module from CPAN if $@; return Apache::Module::loaded($_[1]); } Thanks for all this info, learning more and more every day. :) cool :) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI 0.89)
At 00:49 23.06.2002, Charles Aulds wrote: At 06:41 PM 6/21/02 +0200, Per Einar Ellefsen ([EMAIL PROTECTED]) wrote: As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat in your httpd.conf, before loading other modules (like Apache::DBI). I didn't expect Apache::DBI to work under mod_perl 2.0, at least not well, but was quite surprised. Today, I got it to work with this server: Great! Seems like Apache::compat is working as a charm. -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI 0.89)
At 06:41 PM 6/21/02 +0200, Per Einar Ellefsen ([EMAIL PROTECTED]) wrote: As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat in your httpd.conf, before loading other modules (like Apache::DBI). I didn't expect Apache::DBI to work under mod_perl 2.0, at least not well, but was quite surprised. Today, I got it to work with this server: Server Version: Apache/2.0.36 (Unix) mod_perl/1.99_03-dev Perl/v5.6.1 DAV/2 Using Per Ellesfsen's suggests, and also pre-loading the following startup.pl script (for compat.pm): #!/usr/bin/perl -w use strict; use Apache2(); use Apache::compat; 1; Rudimentary benchmarks, using a MySQL server, and very simple query, shows that Apache::DBI significantly reduces user response time, and increases the throughput of the server (a very limited single P200 MX system, with only 64MB RAM running RH 7.3): Table 8.2: Benchmarking Results Using Database Connection Sharing CGImod_perl Server Hostname192.168.1.1192.168.1.1 Server Port8080 Document Path/cgi-bin/zipcodes.cgi?zip=35801/perl/zipcodes.cgi?zip=35801 Concurrency Level1010 Elapsed Time258.722seconds63.691 seconds Complete Requests200200 Failed Requests00 Total Transferred127000 bytes131843 bytes HTML Transferred89200 bytes90200 bytes Requests per Second0.773.20 Median Connection Times 12518 ms424 ms Transfer Rate0.48Kbps received2.05Kbps received --- Charles Aulds, MCSE, MCP+I Voice: (256) 931-5593 Fax: (240) 352-8290 http://hiwaay.net/~caulds
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI 0.89)
At 06:41 PM 6/21/02 +0200, Per Einar Ellefsen ([EMAIL PROTECTED]) wrote: As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat in your httpd.conf, before loading other modules (like Apache::DBI). I didn't expect Apache::DBI to work under mod_perl 2.0, at least not well, but was quite surprised. Today, I got it to work with this server: Server Version: Apache/2.0.36 (Unix) mod_perl/1.99_03-dev Perl/v5.6.1 DAV/2 Using Per Ellesfsen's suggests, and also pre-loading the following startup.pl script (for compat.pm): #!/usr/bin/perl -w use strict; use Apache2(); use Apache::compat; 1; Rudimentary benchmarks, using a MySQL server, and very simple query, shows that Apache::DBI significantly reduces user response time, and increases the throughput of the server (a very limited single P200 MX system, with only 64MB RAM running RH 7.3): CGImod_perl Server Hostname192.168.1.1192.168.1.1 Server Port8080 Document Path/cgi-bin/zipcodes.cg /perl/zipcodes.cgi? zip=35801 zip=35801 Concurrency Level1010 Elapsed Time258.722seconds63.691 seconds Complete Requests200200 Failed Requests00 Total Transferred127000 bytes131843 bytes HTML Transferred89200 bytes90200 bytes Requests per Second0.773.20 Median Connection Times 12518 ms424 ms Transfer Rate0.48Kbps received2.05Kbps received --- Charles Aulds, MCSE, MCP+I Voice: (256) 931-5593 Fax: (240) 352-8290 http://hiwaay.net/~caulds
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI 0.89)
At 18:26 21.06.2002, Zac Morris wrote: I actually have a question along these lines I'm new to mod_perl myself, and I've just installed a new setup with Apache2 and the mod_perl2 beta. That's all working well and my old cgi-bin type stuff works under mod_perl great. Now I'm trying to get more into the mod_perl specific stuff and when I: use Apache::DBI I'm getting a can't find Apache.pm To use Apache::DBI do I need the old mod_perl 1 also installed running some kind of dual mode? Or is that not even an option since I'm running Apache2. I'm learning quick so if this is covered someplace just give me a quick pointer. As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat in your httpd.conf, before loading other modules (like Apache::DBI). You will probably also want to see the 2.0 docs at http://perl.apache.org/release/docs/ Good luck! -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI0.89)
Per Einar Ellefsen wrote: At 18:26 21.06.2002, Zac Morris wrote: I actually have a question along these lines I'm new to mod_perl myself, and I've just installed a new setup with Apache2 and the mod_perl2 beta. That's all working well and my old cgi-bin type stuff works under mod_perl great. Now I'm trying to get more into the mod_perl specific stuff and when I: use Apache::DBI I'm getting a can't find Apache.pm To use Apache::DBI do I need the old mod_perl 1 also installed running some kind of dual mode? Or is that not even an option since I'm running Apache2. I'm learning quick so if this is covered someplace just give me a quick pointer. As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat but first you need: PerlModule Apache2 or 'use Apache2' in startup.pl. see: http://perl.apache.org/release/docs/2.0/user/config/config.html#Accessing_the_mod_perl_2_0_Modules in your httpd.conf, before loading other modules (like Apache::DBI). You will probably also want to see the 2.0 docs at http://perl.apache.org/release/docs/ start here: http://perl.apache.org/release/docs/2.0/user/intro/start_fast.html but since it seems that you've it installed already, proceed here: http://perl.apache.org/release/docs/2.0/user/config/config.html#Enabling_mod_perl though I haven't tried, you should be able to use Apache::DBI with the compat layer and preforked mpm/ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI0.89)
but first you need: PerlModule Apache2 or 'use Apache2' in startup.pl. see: http://perl.apache.org/release/docs/2.0/user/config/config.html#Accessing_the_mod_perl_2_0_Modules Nope, he did a clean mod_perl 2 install, without MP_INST_APACHE2 I think... so doesn't have an Apache.pm because mod_perl 1 wasn't installed before. ah, ok then, but most likely MP_INST_APACHE2 is going to be the default, so if later you need to install mod_perl 1.0 you don't have to wipe your 2.0 install first. so better start getting used to it :) -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::DBI with mod_perl 2.0 (was Re: [ANNOUNCE] Apache::DBI 0.89)
At 19:46 21.06.2002, Stas Bekman wrote: Per Einar Ellefsen wrote: At 18:26 21.06.2002, Zac Morris wrote: I actually have a question along these lines I'm new to mod_perl myself, and I've just installed a new setup with Apache2 and the mod_perl2 beta. That's all working well and my old cgi-bin type stuff works under mod_perl great. Now I'm trying to get more into the mod_perl specific stuff and when I: use Apache::DBI I'm getting a can't find Apache.pm To use Apache::DBI do I need the old mod_perl 1 also installed running some kind of dual mode? Or is that not even an option since I'm running Apache2. I'm learning quick so if this is covered someplace just give me a quick pointer. As Apache::DBI hasn't been tested with mod_perl 2.0 yet, you will need to: 1) make sure you are using the prefork MPM for Apache (as Stas said, Apache::DBI can only work with that one) 2) You will probably need to run mod_perl 2.0 in compat mode: put PerlModule Apache::compat but first you need: PerlModule Apache2 or 'use Apache2' in startup.pl. see: http://perl.apache.org/release/docs/2.0/user/config/config.html#Accessing_the_mod_perl_2_0_Modules Nope, he did a clean mod_perl 2 install, without MP_INST_APACHE2 I think... so doesn't have an Apache.pm because mod_perl 1 wasn't installed before. -- Per Einar Ellefsen [EMAIL PROTECTED]