Re: [mp2] executing subprocesses from mod_perl

2003-09-04 Thread Haroon Rafique
On Yesterday at 2:06pm, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB 
SB Also you may want to use Apache::SubProcess to stress it out and see
SB if there is something that we need to fix, if it's not used we might
SB not be aware of existings bugs that the tests don't catch. You can
SB always switch to IPC::Run if you encounter some problems.
SB 

Apache::SubProcess it is then. I will keep the list posted in case of 
problems.
--
Haroon Rafique
[EMAIL PROTECTED]



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



[mp2] executing subprocesses from mod_perl

2003-09-03 Thread Haroon Rafique
Hi listers,

Just needed a quick opinion:

http://perl.apache.org/docs/2.0/api/Apache/SubProcess.html
suggests that Apache::SubProcess be used for executing subprocesses.

Howerver, in an earlier list message,
http://marc.theaimsgroup.com/?l=apache-modperlm=102541721726752w=2
Stas had suggested that either IPC::Run or Apache::SubProcess could be 
used.

I have 2 versions of a mod_perl script using either of the modules. Which 
one would be preferred and why?

Some reasons come to mind right away, e.g.,

* IPC::Run may be more mature (version 0.75), so use it.
* IPC::Run is a separate install, so don't use it.
* Apache::SubProcess is distributed with mod_perl, so use it.
etc...

Thanks in advance,
--
Haroon Rafique
[EMAIL PROTECTED]



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: Another newbie question: SetPerlVar

2003-07-17 Thread Haroon Rafique
On Today at 6:47pm, WHvH=Walter H. van Holst [EMAIL PROTECTED]...:

WHvH Hello,
WHvH  
WHvH  If I use SetPerlVar in my apache-perl httpd.conf by just plainly
WHvH stating.
WHvH 
WHvH SetPerlVar Foo Bar
WHvH 

Try PerlSetVar instead.

For 1.0
http://perl.apache.org/docs/1.0/guide/config.html#PerlSetVar_and_PerlAddVar

For 2.0
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlSetVar_

--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] Apache::DBI

2003-07-14 Thread Haroon Rafique
On Yesterday at 10:01pm, BEC=Beau E. Cox [EMAIL PROTECTED] wrote:

BEC 
BECShould I use 'connect' in my startup.pl?
BEC 
BEC Have any of you sucessfully installed and used ADBI under
BEC mod_perl 2? Any advice on what I'm missing?
BEC 

Hi Beau,

I'm using apache 2.0.46, mod_perl 1.9909, perl v5.8.0, Apache::DBI 0.91 on 
a Gentoo kernel 2.4.20-ck6 without any problems in production. I have had 
no problems with using connect_on_init either. I have:

use Apache::compat ();

as my first use statement in my mod_perl startup.pl file.

Further down the script, I have:

use Apache::DBI;
DBI-install_driver(mysql);
Apache::DBI-connect_on_init(..fill in here..);

If I set $Apache::DBI::DEBUG = 2 in my startup file I do see connects on 
init as the new apaches come up. Of course, I commented out that line when 
in production.

Dunno about how to track your make test problems. Now that you know that 
someone has it working, you can retrace your steps and see if you missed 
something.

I do however use this patch which is in cvs for Apache::DBI which skips 
use of uninitialized variable warnings upon server startup.

--- DBI.pm  17 Feb 2003 13:04:19 -  1.6
+++ DBI.pm  4 Apr 2003 10:58:53 -   1.7
@@ -81,7 +81,7 @@
 # won't be useful after ChildInit, since multiple processes trying to
 # work over the same database connection simultaneously will receive
 # unpredictable query results.
-if ($Apache::ServerStarting == 1) {
+if ($Apache::ServerStarting and $Apache::ServerStarting == 1) {
 print STDERR $prefix skipping connection during server startup, 
read the docu !!\n if $Apache::DBI::DEBUG  1;
 return $drh-connect(@args);
 }

Good luck,
--
Haroon Rafique
[EMAIL PROTECTED]


Re: submit input truncation

2003-06-25 Thread Haroon Rafique
On Today at 4:37pm, BM=Bill Marrs [EMAIL PROTECTED] wrote:

BM 
BM I use CGI.pm, mod_perl 2, Apache 2, and the standard RH9 Perl (which is 
BM threaded) - I think that's all the relevant stuff.
BM 

I think you should take a look at the list archives for this thread:
http://mathforum.org/epigone/modperl/bindondrei

Secondly, you should also post the version numbers for all of the 
above-mentioned packages. As mentioned in one of the emails this was fixed 
in mod_perl 1.99_09.

--
Haroon Rafique
[EMAIL PROTECTED]


Re: [RELEASE CANDIDATE] Apache::Test 1.03-dev

2003-06-18 Thread Haroon Rafique
On Today at 7:13pm, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB Please try it out:
SB http://www.apache.org/~stas/Apache-Test-1.03-dev.tar.gz
SB 

1) Gentoo Linux 1.4 (2.4.20-ck6), perl 5.8.0, apache 2.0.46, mod_perl 
1.9909
2) Redhat Linux 8.0 (2.4.18), perl 5.8.0, apache 2.0.44, mod_perl 1.9908

All tests successful.
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails with 1.99_10-dev sources on redhat

2003-06-12 Thread Haroon Rafique
On Today at 6:58pm, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB please try this patch against the current cvs. I did some testing and
SB it seems to work. Test it on your old setup where you still have this
SB problem.
SB 
SB [...patch snipped...]
SB 
SB 

I applied your suggested patch to the 2 files and voila I have 100% 
success in both batches of tests. Just for completeness, I did a make 
clean afterwards and then with the same patched files, built again against 
my locally installed perl and it passed both batches of tests at a 100% 
success rate as well.

Apache::Filter is now found at:
/home/haroon/src/build/modperl-2.0/blib/lib/Apache/Filter.pm
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails with 1.99_10-dev sources on redhat

2003-06-10 Thread Haroon Rafique
On Today at 12:38am, PH=Perrin Harkins [EMAIL PROTECTED] wrote:

PH On Mon, 2003-06-09 at 09:55, Haroon Rafique wrote:
PH  Now onto serious stuff. /usr/bin/perl here is the system-wide perl
PH  install that came bundled with Redhat.
PH 
PH Just a thought: did you fix the locale on that machine?  Most of CPAN
PH won't compile on Red Hat 8 and 9 because of the broken UTF8 locale
PH setting they have.  If you haven't already, edit /etc/sysconfig/i18n
PH and change LANG=en_US.UTF-8 to LANG=en_US.ISO8859-1.  That fixed
PH many mysterious things for me.
PH 
PH - Perrin

Hi Perrin,

I don't think locale is the issue here. I say that because by installing a 
new perl in my home directory (I don't have root access to this machine, 
just developer access), I'm able to install 1.99_10-dev and pass 100% of 
the tests. I think the issue is that I asked the admin to install 1.99_08 
a couple of months ago. Now 1.99_10-dev won't pass make test properly, 
as we suspect, it is finding the older 1.99_08 mod_perl.

Just for completeness, I checked for the LANG variable,
env | grep LANG
LANG=en_US
so more than likely that is not the issue.

Stas suggested some steps to take in his latest reply. I will post my 
findings as a reply to his email.
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails with 1.99_10-dev sources on redhat

2003-06-09 Thread Haroon Rafique
On Saturday at 9:22am, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB I think the issue is very simple: @INC had system libraries dirs
SB before the freshly build ones, so dumping @INC contents prior to libs
SB loading should aid the debug. But please use the latest cvs, since
SB I've messed with @INC a bit recently.
SB 
SB In parallel, we are planning to verify .so objects that they were
SB created by the same mod_perl.so to avoid completely this kind of
SB problems. Well it won't prevent the pickup of wrong libraries, it'll
SB just scream aloud when this will happen. So your debug is still very
SB important.
SB 

Seeing that you were answering emails even on a Saturday, I feel guilty
about taking that out of town trip yesterday. Oh well! I think we should
be able to enjoy the little bit of summer that we get here in Canada to
the fullest.

Now onto serious stuff. /usr/bin/perl here is the system-wide perl install
that came bundled with Redhat.

/usr/bin/perl -MApache2 -Mmod_perl -le 'print mod_perl-VERSION'
1.9908

I posted t/REPORT output in the beginning of the thread and can
repost upon request.

I did a cvs up, and issued:

* /usr/bin/perl Makefile.PL MP_AP_PREFIX=/servers/httpd-2.0.44-pl 
* make
* make test

and was greeted by the now familiar output (same as originally reported)

/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
sh: line 1: ulimit: core file size: cannot modify limit: Operation not 
permitted
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= \
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0 
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose=0
sh: line 1: ulimit: core file size: cannot modify limit: Operation not 
permitted
/servers/httpd-2.0.44-pl/bin/httpd  -d 
/home/haroon/src/build/modperl-2.0/t -f 
/home/haroon/src/build/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
-DPERL_USEITHREADS
using Apache/2.0.44 (prefork MPM)

waiting for server to start: ..[Mon Jun 09 09:38:20 2003] [info] 22 
Apache:: modules loaded
[Mon Jun 09 09:38:20 2003] [info] 5 APR:: modules loaded
[Mon Jun 09 09:38:20 2003] [info] base server + 9 vhosts ready to run 
tests
[Mon Jun 09 09:38:20 2003] [error] Invalid CODE attribute: 
TestFilter::in_init_basic at 
/home/haroon/src/build/modperl-2.0/t/filter/TestFilter/in_init_basic.pm 
line 30
BEGIN failed--compilation aborted at 
/home/haroon/src/build/modperl-2.0/t/filter/TestFilter/in_init_basic.pm 
line 30.
Compilation failed in require at (eval 35) line 3.

[Mon Jun 09 09:38:20 2003] [error] Can't load Perl module 
TestFilter::in_init_basic for server localhost.localdomain:8529, 
exiting...

!!! 
server has died with status 255 (t/logs/error_log wasn't created, start 
the server in the debug mode)
make: *** [run_tests] Error 143

Thanks,
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails on redhat 8.0 with 1.99_09 and 1.99_10-devsources

2003-06-06 Thread Haroon Rafique
   122  16.67%  6 10
*** server localhost.localdomain:8529 shutdown
!!! error running tests (please examine t/logs/error_log)

there's nothing suspicious in t/logs/error_log

Once I get a 100% on both tests then I can worry about how to isolate the 
problem with the old pre-installed mod_perl messing up the tests as 
originally reported.

Regards,
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails with 1.99_10-dev sources on redhat

2003-06-06 Thread Haroon Rafique
On Today at 11:32am, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB 
SB Both failed due to the missing LWP. I was able to reproduce the exact
SB problem by removing LWP/UserAgent.pm. I have now fixed both in cvs.
SB Please 'cvs up' and test again. Thanks.
SB 

after cvs up, make test skipped a bunch of tests in both the first batch
and the 2nd batch (since libwww-perl was not installed). 100% successful.

After that, I installed:
libwww-perl-5.69
CGI.pm-2.93
HTML-Parser-3.28
URI-1.23
to satisfy all dependencies for installing libwww-perl

The tests, that were skipped last time around, ran successfully this time. 
100%.

Now onto investigating my originally reported problem as to why the older,
system-wide installation is interfering with the make test. Any
suggestions on how to get started on that?

Thanks,
--
Haroon Rafique
[EMAIL PROTECTED]



Re: [mp2] make test fails on redhat 8.0 with 1.99_09 and 1.99_10-devsources

2003-06-04 Thread Haroon Rafique
On Today at 12:03pm, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB 
SB  In the case of 1.99_09, following happens after running make test
SB  
SB  [Mon Jun 02 15:55:16 2003] [error] Invalid CODE attribute:  
SB  TestFilter::out_init_basic at
SB  /home/haroon/src/build/mod_perl-1.99_09/t/filter/TestFilter/out_init_basic.pm
SB  line 33 BEGIN failed--compilation aborted at
SB  /home/haroon/src/build/mod_perl-1.99_09/t/filter/TestFilter/out_init_basic.pm
SB  line 33. Compilation failed in require at (eval 21) line 3.
SB 
SB I hate when this happens :( I remember seeing this problem at some
SB point, but I wasn't able to reproduce it since then. I have exactly
SB the same perl build as in your report. The only difference is that
SB I've built it with:  -Doptimize='-g'. I'm not sure if it'd make any
SB difference. But can you try building a custom perl using
SB -Doptimize='-g' and all the options that you had:

Hi Stas,

Unfortunately I only have developer access on that machine. Since I don't 
have root access does this mean that first I might have to install perl as 
a regular user in my home directory and then install mod_perl built 
against the locally built perl?

SB 
SB  config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686
SB  -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc
SB  -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr
SB  -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr
SB  -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid
SB  -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog
SB  -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
SB  -Uversiononly -Dpager=/usr/bin/less -isr'
SB 
SB and give it another try?
SB 
SB Anybody else sees this problem?
SB 

We could wait and see if anyone else has the same problem.

SB Another difference from perl -v is
SB -libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so
SB -gnulibc_version='2.2.92'
SB +libc=/lib/libc-2.2.5.so, so=so, useshrplib=true, libperl=libperl.so
SB +gnulibc_version='2.2.5'
SB 
SB but I doubt this has anything to do with it.
SB 

Cheers,
--
Haroon Rafique
[EMAIL PROTECTED]



[mp2] make test fails on redhat 8.0 with 1.99_09 and 1.99_10-devsources

2003-06-03 Thread Haroon Rafique
: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Sep  1 2002 23:56:49
  %ENV:
PERL_LWP_USE_HTTP_10=1
  @INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
.

The machine is on an internal network behind a NAT firewall. Can I provide 
any other details to help diagnose this further?

Thanks,
--
Haroon Rafique
[EMAIL PROTECTED]



Re: Apache::DBI on mp2

2003-03-04 Thread Haroon Rafique
On Today at 11:16am, SB=Stas Bekman [EMAIL PROTECTED] wrote:

SB FWIW, we are discussing the internal DBI pooling mechanism at the
SB dbi-dev list and having already a sort-of-working prototype. So
SB hopefully there will be no need for Apache::DBI in the near future, as
SB DBI will be able to handle pooling internally. However it may take
SB some time, as the drivers will have to adjust to support the new
SB functionality.
SB 
SB You can see the thread here:
SB http://archive.develooper.com/[EMAIL PROTECTED]/index.html#02118
SB 
SB Some working examples are attached to this message:
SB http://archive.develooper.com/[EMAIL PROTECTED]/msg02134.html
SB 

Stas,

Thanks for your response.

I will try and keep up with the developments in the above-mentioned
threads. However, for now, I'll focus on your alternate solution as
mentioned below. If I find some free time (what are the chances?) I may
also give DBI::Pool a try under mp2.

SB [..snip..]
SB 
SB If you apply the following patch (will commit it soon) against the modperl-2.0 
SB source, you will be able to use connect_on_init unmodified, assuming that 
SB Apache::compat was loaded before Apache::DBI. Let me know whether it works for 
SB you.
SB 

I'm happy to report that the patch to lib/Apache/compat.pm works. I did
not even have to use CVS versions of any of the packages.

Apache/2.0.44 (Gentoo/Linux) mod_perl/1.99_08 Perl/v5.8.0

I simply patched:
/usr/lib/perl5/vendor_perl/5.8.0/i686-linux/Apache2/Apache/compat.pm
with your patch and connect_on_init works unmodified. And as mentioned in 
your email, I do have Apache::compat loaded before Apache::DBI.

Cheers,
--
Haroon Rafique
[EMAIL PROTECTED]



Apache::DBI on mp2

2003-03-03 Thread Haroon Rafique
My setup is as follows:

Apache/2.0.44 (Gentoo/Linux) mod_perl/1.99_08 Perl/v5.8.0

mod_perl was built from CVS.

I was interested in getting Apache::DBI to run under mp2. I did read 
Ask's message at 
http://marc.theaimsgroup.com/?l=apache-modperlm=104225578207460w=2
which leads me to my question. What would it take to get connect_on_init 
to run under mp2?

With the following patch I was able to get connect_on_init to work under 
mp2. Remember that my objective was to JUST get it to run. This is NOT 
release quality code. I'm happy to report that it works for me, so far. 
Anyone else who is running mp2 (no compat mode) willing to give it a try?
Of course, then the gurus can come in and clean up the code so that it 
works under either mp1 or mp2.

diff -u DBI.pm /usr/lib/perl5/site_perl/5.8.0/Apache/DBI.pm 
--- DBI.pm  2003-02-17 08:04:19.0 -0500
+++ /usr/lib/perl5/site_perl/5.8.0/Apache/DBI.pm2003-03-03 
12:03:06.0 -0500
@@ -7,6 +7,8 @@
 use DBI ();
 use Carp qw(carp);
 
+use Apache::ServerUtil ();
+
 require_version DBI 1.00;
 
 $Apache::DBI::VERSION = '0.91';
@@ -32,9 +34,8 @@
 # provide a handler which creates all connections during server 
startup
 
 # TODO - Should check for mod_perl 2 and do the right thing there
-carp Apache.pm was not loaded\n and return unless 
$INC{'Apache.pm'};
-if([EMAIL PROTECTED] and Apache-can('push_handlers')) {
-Apache-push_handlers(PerlChildInitHandler = \childinit);
+if([EMAIL PROTECTED]) {
+Apache-server-push_handlers(PerlChildInitHandler = 
\childinit);
 }
 # store connections
 push @ChildConnect, [EMAIL PROTECTED];
@@ -89,9 +90,9 @@
 # this PerlCleanupHandler is supposed to initiate a rollback after 
the script has finished if AutoCommit is off.
 my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0;
 # TODO - Fix mod_perl 2.0 here
-if(!$Rollback{$Idx} and $needCleanup and 
Apache-can('push_handlers')) {
+if(!$Rollback{$Idx} and $needCleanup) {
 print STDERR $prefix push PerlCleanupHandler \n if 
$Apache::DBI::DEBUG  1;
-Apache-push_handlers(PerlCleanupHandler, \cleanup);
+Apache-server-push_handlers(PerlCleanupHandler, \cleanup);
 # make sure, that the rollback is called only once for every 
 # request, even if the script calls connect more than once
 $Rollback{$Idx} = 1;


--
Haroon Rafique
[EMAIL PROTECTED]