[mp2]make test problems

2002-12-03 Thread Beau E. Cox
NOTE: My name servers have been giving me fits today, so I am
resending this problem report; If you have already received it,
please forgive me = Beau.
-8-- Start Bug Report 8--
1. Problem Description:

  A. Apache 2.0.43:

  ./configure --enable-layout=SuSE --with-mpm=worker
  make
  make install
  -- hokie-dokie --

  B. mod_perl 1.99_07

  perl Makefile.pl MP_AP_PREFIX=/usr/include/apache MP_INST_APACHE2=1

  (that funny include directory is _real_: it's specified in
  the apache config.layout under SuSE. I cleared it before the apache
  configure/build, and it reappeared - looks OK to me).

  Here is the layout I used:

  Layout SuSE
prefix:/usr
exec_prefix:   ${prefix}
bindir:${prefix}/bin
sbindir:   ${prefix}/sbin
libdir:${prefix}/lib
libexecdir:${prefix}/lib/apache
mandir:${prefix}/share/man
sysconfdir:/etc/httpd
datadir:   /srv/www
installbuilddir: ${datadir}/build
errordir:  ${datadir}/error
iconsdir:  ${datadir}/icons
htdocsdir: ${datadir}/htdocs
manualdir: ${datadir}/manual
cgidir:${datadir}/cgi-bin
includedir:${prefix}/include/apache/include
localstatedir: /var/lib/httpd
runtimedir:/var/run
logfiledir:/var/log/httpd
proxycachedir: /var/cache/httpd
  /Layout

  C. Apache/Const not found:

  Can't locate Apache/Const.pm in @INC (@INC contains:
Apache-Test/lib /usr/local/addons/mod_perl-1.99_07/Apache-Test/lib
/usr/local/addons/mod_perl-1.99_07/lib
/usr/local/addons/mod_perl-1.99_07/blib/lib
/usr/local/addons/mod_perl-1.99_07/blib/arch
/usr/local/addons/mod_perl-1.99_07/t/../Apache-Test/lib
/usr/local/addons/mod_perl-1.99_07/t/../lib
/usr/local/addons/mod_perl-1.99_07/t/../../lib
/usr/lib/perl5/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
   .) at
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm line
12.
  BEGIN failed--compilation aborted at
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm
line 12.

  Here is where Const.pm (actually several vertsions of them) is
  in the mod_perl tree (looks like the @INC should have
a --/Apache2/Apache--
  in it) (all below are from /usr/local/addons/mod_perl-1.99_07/):

  blib/lib/Apache2/APR:
-r--r--r--1 root root  160 Apr 11  2001 Const.pm
  blib/lib/Apache2/Apache:
-r--r--r--1 root root  324 Aug 28 16:28 Const.pm
  blib/lib/Apache2/ModPerl:
-r--r--r--1 root root  743 Sep  5 07:07 Const.pm
  xs/APR/Const:
-rw-r--r--1 beau mysql 160 Apr 11  2001 Const.pm
  xs/Apache/Const:
-rw-r--r--1 beau mysql 324 Aug 28 16:28 Const.pm
  xs/ModPerl/Const:
-rw-r--r--1 beau mysql 743 Sep  5 07:07 Const.pm

  D. apache/subprocess test

  ...
  apache/scanhdrs2.ok
  apache/subprocessFAILED tests 1-4
Failed 4/4 tests, 0.00% okay
  apache/write.ok
  ...

  E. apr/perlio

  ...
  apr/os...ok
  apr/perlio...FAILED tests 1-11
Failed 11/11 tests, 0.00% okay
  apr/pool.ok
  ...

  F. t/logs/error_log:

  ...
  END in modperl_extra.pl, pid=7419
  [Mon Dec 02 05:08:24 2002] [notice] Apache/2.0.43 (Unix)
mod_perl/1.99_07-dev Perl/v5.8.0 configured -- resuming normal operations
  [Mon Dec 02 05:08:24 2002] [info] Server built: Dec  2 2002 04:57:53
  [Mon Dec 02 05:08:24 2002] [debug] worker.c(1736): AcceptMutex: sysvsem
(default: sysvsem)
  [Mon Dec 02 05:08:25 2002] [error] server reached MaxClients setting,
consider raising the MaxClients setting
  # Failed test 1 in
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm at
line 55
  # Failed test 2 in
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm at
line 68
  # Failed test 3 in
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm at
line 82
  # Failed test 4 in
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm at
line 96
  [Mon Dec 02 05:08:31 2002] [info] [client 127.0.0.1] TestAPI::aplog test
in progress
  [Mon Dec 02 05:08:31 2002] [debug]
/usr/local/addons/mod_perl-1.99_07/t/response/TestAPI/aplog.pm(43):
log_serror test ok
  [Mon Dec 02 05:08:31 2002] [debug]
/usr/local/addons/mod_perl-1.99_07/t/response/TestAPI/aplog.pm(46):
(20007)No time was provided and one was required.: log_serror test 2 ok
  [Mon Dec 02 05:08:31 2002] [debug]
/usr/local/addons/mod_perl-1.99_07/t/response/TestAPI/aplog.pm(49): [client
127.0.0.1] (20007)No time was provided and one was required.: log_rerror
test ok
  [Mon Dec 02 05:08:31 2002] [error] $r-log_error test ok
  [Mon Dec 02 05:08:31 2002] [error] $s-log_error test ok
  [Mon Dec 02 05:08:31 2002] [debug]

Re: Horrible handler memory leak

2002-12-03 Thread Stas Bekman
Hann, Brian wrote:
 I'm having a problem with a fairly simple handler eating up resources
 and I'm wondering if there's any easy way to track it down.

 The handler fetches data from an Oracle database and displays it
 using Template-Toolkit.  Nothing fancy, just some display logic, etc.


 The thing is, when I try to show all 8000 records the process spirals
 upwards towards 500M and it has to be killed.  With smaller amounts
 of records (~100-1000), the process STILL grows by several megs.
 There really isn't that much data going through other than the sheer
 amount of records so I'm wondering what's eating the resources.

When storing lots of small records in Perl the overhead of the data 
management is very big. You can check the real memory usage with B::Size 
(which can be conveniently invoked via Apache::Status). See 
http://perl.apache.org/ for some examples.

Consider using some other way to represent data in your perl code (e.g. 
dbm files). Also see the list archives for similar discussions.


__
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: [mp2.0]make test problems

2002-12-03 Thread Stas Bekman
There are two problems:


  C. Apache/Const not found:

  Can't locate Apache/Const.pm in @INC (@INC contains:
Apache-Test/lib /usr/local/addons/mod_perl-1.99_07/Apache-Test/lib
/usr/local/addons/mod_perl-1.99_07/lib
/usr/local/addons/mod_perl-1.99_07/blib/lib
/usr/local/addons/mod_perl-1.99_07/blib/arch
/usr/local/addons/mod_perl-1.99_07/t/../Apache-Test/lib
/usr/local/addons/mod_perl-1.99_07/t/../lib
/usr/local/addons/mod_perl-1.99_07/t/../../lib
/usr/lib/perl5/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
   .) at
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm line
12.
  BEGIN failed--compilation aborted at
/usr/local/addons/mod_perl-1.99_07/t/response/TestApache/subprocess.pm
line 12.

  Here is where Const.pm (actually several vertsions of them) is
  in the mod_perl tree (looks like the @INC should have
a --/Apache2/Apache--
  in it) (all below are from /usr/local/addons/mod_perl-1.99_07/):

  blib/lib/Apache2/APR:
-r--r--r--1 root root  160 Apr 11  2001 Const.pm
  blib/lib/Apache2/Apache:
-r--r--r--1 root root  324 Aug 28 16:28 Const.pm
  blib/lib/Apache2/ModPerl:
-r--r--r--1 root root  743 Sep  5 07:07 Const.pm
  xs/APR/Const:
-rw-r--r--1 beau mysql 160 Apr 11  2001 Const.pm
  xs/Apache/Const:
-rw-r--r--1 beau mysql 324 Aug 28 16:28 Const.pm
  xs/ModPerl/Const:
-rw-r--r--1 beau mysql 743 Sep  5 07:07 Const.pm


It wants /usr/local/addons/mod_perl-1.99_07/blib/lib/Apache2/Apache/Const.pm
but for some reason blib/lib/Apache2 is not in the path. 
modperl_extra.pl loads Apache2, so @INC should be adjusted.

What happens if you run this test standalone, like so:

t/TEST apache/subprocess

even better in a verbose mode:

t/TEST -v apache/subprocess

(watch the error_log)

The second problem manifestates in the error_log file:

  [Mon Dec 02 05:08:38 2002] [error] [client 127.0.0.1] mkdir
/usr/local/addons/mod_perl-1.99_07/t/htdocs/perlio: Permission denied at
/usr/local/addons/mod_perl-1.99_07/Apache-Test/lib/Apache/TestUtil.pm line
128


it tries to create a new dir 'perlio' in the dir 'htdocs' and fails.

Apparently your umask is set to some value that when untarring the 
package the writable bits weren't set. What does the following show?
cd /usr/local/addons/mod_perl-1.99_07/
ls -dl t/htdocs

You are not the first to report this problem. I suppose we should add 
some code to check that t/htdocs is writable.

BTW, when you have tests failing, run them separately and then you will 
immediately what errors are relevant for this test. You can even tell it 
to run/skip specific subtests...

  MaxClients (in t/conf/httpd.conf):
  ...
  IfModule worker.c
StartServers 1
MaxClients   1
MinSpareThreads  1
  ...
  Tried setting it to 150 before make test, but he sets it back to 1!


if you read the head of that file, it's autogenerated and all your 
changes will be overwritten. If you really want to change it (and most 
likely you don't, since some test rely on the fact that there is only 
one process/thread that responds, read the Apache::Test guide here:
http://perl.apache.org/docs/general/testing/testing.html#Starting_Multiple_Servers

  G. I hope you folks don't think I'm just dumping this on you;
 I have tried everthing I could think of before reporting;
	 I'm really trying to RTFM and learn while I'm doing...


You are doing the right thing. Your last report was very comprehensive, 
now we need to figure out why your system behaves differently than mine :)

And you are doing a great service of shaking all those problems out for 
the many users to come. (hint, hint... :)

__
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: [mp2.0]make test problems

2002-12-03 Thread Stas Bekman
Also, can you please try to do the testing with the cvs version of 
mod_perl 2.0? Since chances are that some things were fixed since last 
release (and possibly new bugs added :)

See: 
http://perl.apache.org/download/source.html#2_0_Development_Source_Distribution
(though use only the mod_perl cvs, not the httpd)

__
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: [mp2.0]make test problems

2002-12-03 Thread Beau E. Cox
Ok Stas -

I will pick up the cvs mod_perl now and try again.

My ignorance is showing (20 yrs+ with M$ systems, only
1 1/2 yrs with Linux) but I did notice that mod_perl
untared to beau:mysql? Where did that come from? umask?
man umask only gives me (2) - programmers reference. Is
there some setup parameter I should set? I've read my SuSE
admin guide and can't find anything revelent. Please
point me somewhere... :)

Of course, I'm doing everthing logged in as root (it's my
network after all, and if you can't be King of your own
network...) I've never seen tar carry owner:group + perms
thru an untar...they usually come out the other end root:root.
It's some of your magic, isn't it Stas?

Aloha = Beau.

PS: I can't give you the ls you wanted right now, I am in the middle
of reinstalling apache w/o my SuSE layout...

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 1:00 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2.0]make test problems


Also, can you please try to do the testing with the cvs version of
mod_perl 2.0? Since chances are that some things were fixed since last
release (and possibly new bugs added :)

See:
http://perl.apache.org/download/source.html#2_0_Development_Source_Distribut
ion
(though use only the mod_perl cvs, not the httpd)

__
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






[mp2] the make test problem saga continues...

2002-12-03 Thread Beau E. Cox

-8-- Start Bug Report 8--
1. Problem Description:

   A. Reinstalled apache 2.0.43 w/o my crazy SuSE layout, just:
  ./configure --with-mpm=worker

  Apache AOK.

   B. Pulled CVS source for mp2 as per web site instructions.

  perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 MP_INST_APACHE2=1
  make
  make test

   C. same Apache/Const.pm not found:

  Can't locate Apache/Const.pm in @INC (@INC contains:
Apache-Test/lib /usr/local/addons/modperl-2.0/Apache-Test/lib
/usr/local/addons/modperl-2.0/lib
/usr/local/addons/modperl-2.0/blib/lib
/usr/local/addons/modperl-2.0/blib/arch
/usr/local/addons/modperl-2.0/t/../Apache-Test/lib
/usr/local/addons/modperl-2.0/t/../lib
/usr/local/addons/modperl-2.0/t/../../lib
/usr/lib/perl5/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl .) at
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm line 12.
  BEGIN failed--compilation aborted at
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm line 12.
  Compilation failed in require at
/usr/local/addons/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfigPerl.pm
line 382.

  I have Const.pm at:

  /usr/local/addons/modperl-2.0/blib/lib/Apache2/Apache

  but that's not in @INC. How can I modify the @INC within
  the ApacheTest environment? I can't find it in the Apache Test
  section of the docs.

   D. same tests failed:

  apache/subprocessFAILED tests 1-4
Failed 4/4 tests, 0.00% okay

  apr/perlio...FAILED tests 1-11
Failed 11/11 tests, 0.00% okay

   E. t/logs/error_log

  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  END in modperl_extra.pl, pid=18641
  [Tue Dec 03 02:13:03 2002] [notice] Apache/2.0.43 (Unix)
mod_perl/1.99_08-dev Perl/v5.8.0 configured -- resuming normal operations
  [Tue Dec 03 02:13:03 2002] [info] Server built: Dec  3 2002 00:51:28
  [Tue Dec 03 02:13:03 2002] [debug] worker.c(1736): AcceptMutex:
sysvsem (default: sysvsem)
  [Tue Dec 03 02:13:04 2002] [error] server reached MaxClients setting,
consider raising the MaxClients setting
  # Failed test 1 in
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm at line 55
  # Failed test 2 in
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm at line 68
  # Failed test 3 in
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm at line 82
  # Failed test 4 in
/usr/local/addons/modperl-2.0/t/response/TestApache/subprocess.pm at line 96
  [Tue Dec 03 02:13:09 2002] [info] [client 127.0.0.1] TestAPI::aplog
test in progress
  [Tue Dec 03 02:13:09 2002] [debug]
/usr/local/addons/modperl-2.0/t/response/TestAPI/aplog.pm(43): log_serror
test ok
  [Tue Dec 03 02:13:09 2002] [debug]
/usr/local/addons/modperl-2.0/t/response/TestAPI/aplog.pm(46): (20007)No
time was provided and one was required.: log_serror test 2 ok
  [Tue Dec 03 02:13:09 2002] [debug]
/usr/local/addons/modperl-2.0/t/response/TestAPI/aplog.pm(49): [client
127.0.0.1] (20007)No time was provided and one was required.: log_rerror
test ok
  [Tue Dec 03 02:13:09 2002] [error] $r-log_error test ok
  [Tue Dec 03 02:13:09 2002] [error] $s-log_error test ok
  [Tue Dec 03 02:13:09 2002] [debug]
/usr/local/addons/modperl-2.0/t/response/TestAPI/aplog.pm(63):
TestAPI::aplog test done
  [Tue Dec 03 02:13:09 2002] [warn] ApacheApache-warn test ok
  [Tue Dec 03 02:13:09 2002] [warn] $s-warn test ok
  [Tue Dec 03 02:13:17 2002] [error] [client 127.0.0.1] mkdir
/usr/local/addons/modperl-2.0/t/htdocs/perlio: Permission denied at
/usr/local/addons/modperl-2.0/Apache-Test/lib/Apache/TestUtil.pm line 128

  [Tue Dec 03 02:13:20 2002] [error] Apache::log_error test ok
  [Tue Dec 03 02:13:31 2002] [error] [client 127.0.0.1] File does not
exist: /usr/local/addons/modperl-2.0/t/htdocs/nope
  [Tue Dec 03 02:13:37 2002] [error] [client 127.0.0.1] need AuthName:
/TestModperl::setauth
  [Tue Dec 03 02:13:41 2002] [info] removed PID file
/usr/local/addons/modperl-2.0/t/logs/httpd.pid (pid=18642)
  [Tue Dec 03 02:13:41 2002] [notice] caught SIGTERM, shutting down
  END in modperl_extra.pl, pid=18642
  END in modperl_extra.pl, pid=18642
  END in modperl_extra.pl, pid=18642
  END in modperl_extra.pl, pid=18642
  END in modperl_extra.pl, 

Re: [MP2] Handler feauters in a filter?

2002-12-03 Thread Stas Bekman
Issac Goldstand wrote:

I'm writing a filter in which two lines of data are to be appended to the
content going back.  However, I'd like to test for a 404, and if found set
the response to 200.  Can this be done from the output filters?  Or am I
going to have to do something more complex with a handler?


Haven't tried this yet, but you can either write a connection filter 
which rewrites the headers if they were sent already, or insert your 
filter just before the one that generates the headers. Since you want to 
add something to the end, the former case is probably the best. I 
suggest that you ask for the best way at the httpd-dev list, as it's a 
pretty generic httpd topic and that list has real filter experts. Then 
once you figure out from them what's the best way to go (and share with 
us :) implementing it in perl is a piece of cake.

The big problem is mod_proxy (or any other module, for that matter) - it's
not as simple as checking the file on disk - the content could be coming
from a proxy or from another content-handler.

Any ideas?
  Issac



--


__
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: [mp2.0]make test problems

2002-12-03 Thread Stas Bekman
My ignorance is showing (20 yrs+ with M$ systems, only
1 1/2 yrs with Linux) but I did notice that mod_perl
untared to beau:mysql? Where did that come from? umask?
man umask only gives me (2) - programmers reference. Is
there some setup parameter I should set? I've read my SuSE
admin guide and can't find anything revelent. Please
point me somewhere... :)


No need for excuses :) as you saw in my followup it wasn't a umask 
issue. (Though 'perldoc -f umask' has a good explanation of umask.)

Of course, I'm doing everthing logged in as root (it's my
network after all, and if you can't be King of your own
network...) I've never seen tar carry owner:group + perms
thru an untar...they usually come out the other end root:root.


Been there, done that. But now I work under my own user and rarely need 
to run 'su'. But that discussion belongs to a different list...

We are probably going to change Apache::Test to not let you run the test 
suite as root (the real problem is that Apache 2.0 will refuse to start 
if httpd.conf file says: User root), instead of trying to guess your 
'other' username. As you can see this help causes more troubles than it 
helps.

It's some of your magic, isn't it Stas?


If it has anything to do with magic always remember to s/Stas/Doug/gi

__
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: [mp2] the make test problem saga continues...

2002-12-03 Thread Beau E. Cox
Sir:

You are correct; after changing owner:group settings to 
my normal user, apr/perlio worked fine under that user!

Const.pm  apache/subprocess fail in the same way as
under root.

progress...ain't it great! :)

Aloha = Beau.

PS: boy, you are brave; over the years I've learned not to say:
I'm 100% sure that...
but, yes, it worked.
I seem to get burned almost every time I let that one slip! :)

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 4:14 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2] the make test problem saga continues...


   apache/subprocessFAILED tests 1-4
   Failed 4/4 tests, 0.00% okay
 
   apr/perlio...FAILED tests 1-11
   Failed 11/11 tests, 0.00% okay

OK, finally I've figured what's different in your environment from mine: 
You run the test suite as root!

I was able to reproduce the problem with apr/perlio.

The problem is that when you run the test suite as root, Apache::Test 
runs the server under User: nobody, which explains the failure. The dir 
t/htdocs doesn't have a+wx perms.

For now, please switch to your user, instead of root. And try again:

I'm 100% sure that apr/perlio will work for you now.

Does apache/subprocess now work for you?

re: Apache::Const not found, I'm still trying to guess what could be the 
problem, since I can't reproduce 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: [mp2.0]make test problems

2002-12-03 Thread Narins, Josh

[EMAIL PROTECTED] writes:

If it has anything to do with magic always remember to s/Stas/Doug/gi

[EMAIL PROTECTED]: Name service error for dougon.org: Host not found

hmmm

:)

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 9:32 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2.0]make test problems


 My ignorance is showing (20 yrs+ with M$ systems, only
 1 1/2 yrs with Linux) but I did notice that mod_perl
 untared to beau:mysql? Where did that come from? umask?
 man umask only gives me (2) - programmers reference. Is
 there some setup parameter I should set? I've read my SuSE
 admin guide and can't find anything revelent. Please
 point me somewhere... :)

No need for excuses :) as you saw in my followup it wasn't a umask 
issue. (Though 'perldoc -f umask' has a good explanation of umask.)

 Of course, I'm doing everthing logged in as root (it's my
 network after all, and if you can't be King of your own
 network...) I've never seen tar carry owner:group + perms
 thru an untar...they usually come out the other end root:root.

Been there, done that. But now I work under my own user and rarely need 
to run 'su'. But that discussion belongs to a different list...

We are probably going to change Apache::Test to not let you run the test 
suite as root (the real problem is that Apache 2.0 will refuse to start 
if httpd.conf file says: User root), instead of trying to guess your 
'other' username. As you can see this help causes more troubles than it 
helps.

 It's some of your magic, isn't it Stas?

If it has anything to do with magic always remember to s/Stas/Doug/gi

__
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


--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.





Re: [mp2] the make test problem saga continues...

2002-12-03 Thread Stas Bekman


   C. same Apache/Const.pm not found:

  Can't locate Apache/Const.pm in @INC (@INC contains:

[...]

   D. same tests failed:

  apache/subprocessFAILED tests 1-4
	Failed 4/4 tests, 0.00% okay


OK, here is the patch that will 100% :) fix these two problems (apply 
manually or just use the cvs version):

Index: Apache-Test/lib/Apache/TestConfigPerl.pm
===
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.53
diff -u -r1.53 TestConfigPerl.pm
--- Apache-Test/lib/Apache/TestConfigPerl.pm1 Jul 2002 07:57:15 
-  1.53
+++ Apache-Test/lib/Apache/TestConfigPerl.pm3 Dec 2002 15:27:17 -
@@ -282,6 +282,13 @@
 sub configure_pm_tests {
 my $self = shift;

+# since server wasn't started yet, the modules in blib under
+# Apache2 can't be seen. So we must load Apache2.pm, without which
+# run_apache_test_config might fail to require modules
+if ($mod_perl::VERSION  1.99) {
+require Apache2;
+}
+
 for my $subdir (qw(Response Protocol Hooks Filter)) {
 my $dir = catfile $self-{vars}-{t_dir}, lc $subdir;
 next unless -d $dir;


--

I hope that now you get a clean make test.

__
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: [mp2] the make test problem saga continues...

2002-12-03 Thread Beau E. Cox
Ok Mr. 100%... ;-)

I'll get cvs again.

Aloha = Beau.

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 5:33 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2] the make test problem saga continues...



C. same Apache/Const.pm not found:

   Can't locate Apache/Const.pm in @INC (@INC contains:
[...]
D. same tests failed:

   apache/subprocessFAILED tests 1-4
   Failed 4/4 tests, 0.00% okay

OK, here is the patch that will 100% :) fix these two problems (apply
manually or just use the cvs version):

Index: Apache-Test/lib/Apache/TestConfigPerl.pm
===
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
,v
retrieving revision 1.53
diff -u -r1.53 TestConfigPerl.pm
--- Apache-Test/lib/Apache/TestConfigPerl.pm1 Jul 2002 07:57:15
-  1.53
+++ Apache-Test/lib/Apache/TestConfigPerl.pm3 Dec 2002 15:27:17 -
@@ -282,6 +282,13 @@
  sub configure_pm_tests {
  my $self = shift;

+# since server wasn't started yet, the modules in blib under
+# Apache2 can't be seen. So we must load Apache2.pm, without which
+# run_apache_test_config might fail to require modules
+if ($mod_perl::VERSION  1.99) {
+require Apache2;
+}
+
  for my $subdir (qw(Response Protocol Hooks Filter)) {
  my $dir = catfile $self-{vars}-{t_dir}, lc $subdir;
  next unless -d $dir;


--

I hope that now you get a clean make test.

__
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: [mp2] the make test problem saga continues...

2002-12-03 Thread Beau E. Cox
THIS THREAD IS OFFICIALLY RETIRED

Yes, everthing works (although I still miss being King).

Thank you for your time and effort. I hope others will
benefit from what we went through.

Aloha = Beau.

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 5:33 AM
To: Beau E. Cox
Cc: Modperl
Subject: Re: [mp2] the make test problem saga continues...



C. same Apache/Const.pm not found:

   Can't locate Apache/Const.pm in @INC (@INC contains:
[...]
D. same tests failed:

   apache/subprocessFAILED tests 1-4
   Failed 4/4 tests, 0.00% okay

OK, here is the patch that will 100% :) fix these two problems (apply
manually or just use the cvs version):

Index: Apache-Test/lib/Apache/TestConfigPerl.pm
===
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
,v
retrieving revision 1.53
diff -u -r1.53 TestConfigPerl.pm
--- Apache-Test/lib/Apache/TestConfigPerl.pm1 Jul 2002 07:57:15
-  1.53
+++ Apache-Test/lib/Apache/TestConfigPerl.pm3 Dec 2002 15:27:17 -
@@ -282,6 +282,13 @@
  sub configure_pm_tests {
  my $self = shift;

+# since server wasn't started yet, the modules in blib under
+# Apache2 can't be seen. So we must load Apache2.pm, without which
+# run_apache_test_config might fail to require modules
+if ($mod_perl::VERSION  1.99) {
+require Apache2;
+}
+
  for my $subdir (qw(Response Protocol Hooks Filter)) {
  my $dir = catfile $self-{vars}-{t_dir}, lc $subdir;
  next unless -d $dir;


--

I hope that now you get a clean make test.

__
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: [MP2] Handler feauters in a filter?

2002-12-03 Thread Issac Goldstand
Implemented it in C:

  if (f-r-status==HTTP_NOT_FOUND) // If this is so, we need to revamp the
request_rec
  {
   f-r-status=HTTP_OK; // Spoof HTTP_OK
   f-r-status_line=200 OK;

APR_BRIGADE_INSERT_TAIL(ctx-bb,apr_bucket_eos_create(f-c-bucket_alloc));
// Add an EOS to the new bb
   ap_pass_brigade(f-next,ctx-bb); // and pass the new bb to the next
filter
   return APR_SUCCESS;
  }

Not sure how to translate that to mod_perl's API (the first half is easy and
understandable in C, I think, though...)

This was *my* solution - I'm not sure if it's the best way to do it...
I'm sure that as I delve deeper into Apache 2, I'll find better solutions...

  Issac

- Original Message -
From: Stas Bekman [EMAIL PROTECTED]
To: Issac Goldstand [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, December 03, 2002 3:43 PM
Subject: Re: [MP2] Handler feauters in a filter?


 Issac Goldstand wrote:
  I'm writing a filter in which two lines of data are to be appended to
the
  content going back.  However, I'd like to test for a 404, and if found
set
  the response to 200.  Can this be done from the output filters?  Or am I
  going to have to do something more complex with a handler?

 Haven't tried this yet, but you can either write a connection filter
 which rewrites the headers if they were sent already, or insert your
 filter just before the one that generates the headers. Since you want to
 add something to the end, the former case is probably the best. I
 suggest that you ask for the best way at the httpd-dev list, as it's a
 pretty generic httpd topic and that list has real filter experts. Then
 once you figure out from them what's the best way to go (and share with
 us :) implementing it in perl is a piece of cake.

  The big problem is mod_proxy (or any other module, for that matter) -
it's
  not as simple as checking the file on disk - the content could be coming
  from a proxy or from another content-handler.
 
  Any ideas?
Issac


 --


 __
 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: [MP2] Handler feauters in a filter?

2002-12-03 Thread Stas Bekman
Issac Goldstand wrote:

Implemented it in C:

  if (f-r-status==HTTP_NOT_FOUND) // If this is so, we need to revamp the
request_rec
  {
   f-r-status=HTTP_OK; // Spoof HTTP_OK
   f-r-status_line=200 OK;

APR_BRIGADE_INSERT_TAIL(ctx-bb,apr_bucket_eos_create(f-c-bucket_alloc));
// Add an EOS to the new bb
   ap_pass_brigade(f-next,ctx-bb); // and pass the new bb to the next
filter
   return APR_SUCCESS;
  }

Not sure how to translate that to mod_perl's API (the first half is easy and
understandable in C, I think, though...)


It works exactly the same, just add $ before 'f' :) Though you don't say 
where in the filter chain do you insert it and how do you configure it 
(i.e. what filter type).

This was *my* solution - I'm not sure if it's the best way to do it...
I'm sure that as I delve deeper into Apache 2, I'll find better solutions...


Hence my suggestion to ask at the httpd-dev list.

__
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




Resetting cache Apache::Registry

2002-12-03 Thread Justin Luster








I know that when you require or use
helper files in a Perl Script, and you are using Apache::Registry, when changes
are made to the helper files they are not recognized until you restart
Apache. In the documentation it says that you can change the Apache configuration
file to do this for you. What I want to know is if there is a way to
clear out the files or code in the Apache::Registry cache via a Perl
Script. I would like to write a simple Perl Script (clear.pl) that would
have some code like $r-ResetCache that would clear out the cache and allow
my other Perl script to see the new changes in its helper files.



The situation is that Im using a shared server from a
3rd party hosting provider and I do not have control over what they
have in their Apache configuration file. Every time I make a change to a
helper file I need them to restart Apache.



Are there any ideas out there in the world of Mod_Perl
gurus?



Thank you.








Re: Resetting cache Apache::Registry

2002-12-03 Thread Geoffrey Young


The situation is that I?m using a shared server from a 3rd party hosting 
provider and I do not have control over what they have in their Apache 
configuration file.  Every time I make a change to a helper file I need 
them to restart Apache.

on the Cobalt and Ensim systems I have websites at, I was able to just 
create a .htaccess file with

PerlInitHandler Apache::StatINC

in it and let that take care of everything.

HTH

--Geoff





RE: Resetting cache Apache::Registry

2002-12-03 Thread Justin Luster
Thank you.  That is a good suggestion.

-Original Message-
From: Geoffrey Young [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 03, 2002 9:56 AM
To: Justin Luster
Cc: [EMAIL PROTECTED]
Subject: Re: Resetting cache Apache::Registry


 The situation is that I?m using a shared server from a 3rd party
hosting 
 provider and I do not have control over what they have in their Apache

 configuration file.  Every time I make a change to a helper file I
need 
 them to restart Apache.

on the Cobalt and Ensim systems I have websites at, I was able to just 
create a .htaccess file with

PerlInitHandler Apache::StatINC

in it and let that take care of everything.

HTH

--Geoff








Re: Resetting cache Apache::Registry

2002-12-03 Thread Perrin Harkins
Justin Luster wrote:


I know that when you “require” or “use” helper files in a Perl Script,
and you are using Apache::Registry, when changes are made to the helper
files they are not recognized until you restart Apache.  In the
documentation it says that you can change the Apache configuration file
to do this for you.



That's a reference to Apache::Reload or Apache::StatINC.  You can do 
that in an htaccess file if your host allows it.

  What I want to know is if there is a way to clear
out the files or code in the Apache::Registry cache via a Perl Script. 


Yes, but understand that we're not talking about the Apache::Registry 
cache here.  A::R just caches your CGI script itself, not the modules. 
The modules are cached as a normal function of Perl, i.e. once it has 
compiled a module that module stays in memory until the Perl process 
shuts down.

To make Perl reload a module, you can do this:

delete $INC{'Your/Module.pm'};
require Your::Module;

But that glosses over a lot of details about imports and such, so you're 
better off using Apache::Reload if you can.

- Perrin



[mp2.0] How do I port modules using Apache::SIG?

2002-12-03 Thread Clare, Bruce W
I'm attempting to run Scoop 0.9 (scoop.kuro5hin.org) under Apache2/mod_perl
2.0 running on Windows 2000, but the application was written for Apache/mp
1.x, so it uses Apache::SIG (and possibly other) modules that are no longer
in mod_perl.  

The mod_perl developer documentation for porting from 1.x to 2.x doesn't
really cover the missing modules, other than to say you can use
Apache::compat to allow use of deprecated methods. This doesn't do the job
here, which makes sense because the SIG module isn't even installed on my
system. Is there any resource that discusses the changes between mod_perl
1.x and 2.x in more detail than the current developer document? The key
point here is what has been deprecated/removed/rearchitected in mod_perl
2.x? and how do I replace it?



Online Tonight

2002-12-03 Thread David Wheeler
All,

I will be the featured guest for an hour on the nationally syndicated 
talk radio show Online Tonight this evening at 8 pm PST (11 pm EST). 
Host David Lawrence and I be discussing Bricolage, its history, and 
content management in general. This is my first time on the radio, so 
it should be interesting. The show is a light, humor-oriented tech talk 
show, and is, along with Online Today, the most listened to 
high-tech-oriented talk show on the air today, according to CNET Radio.

The show's web site:
  http://www.online-tonight.com/

To listen in via streaming media:
  http://www.cnet.com/broadband/0-7227152.html

For those who aren't familiar with Bricolage, it's the mod_perl-powered 
enterprise-class content management software I've been working on for a 
few years, first at Salon, then for About.com, and now as open-source 
(free) software on the Internet.

The Bricolage web site:
  http://bricolage.cc/

A Tech analysis in the October 28th eWeek:
  http://www.eweek.com/article2/0,3959,652977,00.asp

Feel free to tune in or even call in and show your support for mod_perl 
applications. Host David Lawrence and I will also be available via IM 
during the broadcast.

Regards,

David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]



[ANNOUNCE] Apache::PAR 0.01

2002-12-03 Thread Nathan Byrd
Hi all,

I am happy to announce the initial public release to CPAN of the
Apache::PAR module.

 Apache::PAR is a framework for including Perl ARchive files in a
mod_perl environment.  It allows an author to package up a web
application, including configuration, static files, Perl modules, and
Registry and PerlRun scripts to include in a single file.  This archive
can then be moved to other locations on the same system or distributed,
and loaded with a single set of configuration options in the Apache
configuration.  Scripts, modules, and content should continue to run
without modifications.

These modules are based on PAR.pm by Autrijus Tang and Archive::Zip by
Ned Konz, as well as the mod_perl modules.  They extend the concept of
PAR files to mod_perl, similar to how WAR archives work for Java. An
archive (which is really a zip file), contains one or more elements
which can be served to clients making requests to an Apache web server.

For more information, see the Perl documentation or README included with
the package.  The CPAN entry can be found at:

http://search.cpan.org/author/NBYRD/Apache-PAR-0.01/

A sourceforge project (including CVS access) has also been created at:
http://sourceforge.net/projects/apache-par/

Please let me know if you have any questions/comments/suggestions. This
is especially important as I know there are some rough edges to work
out, and I would love to get feedback to help me determine priorities. 
And, of course, patches are always welcome. :-) Thanks,

-- 
Nathan Byrd [EMAIL PROTECTED]




Re: [mp2.0] How do I port modules using Apache::SIG?

2002-12-03 Thread Stas Bekman
Clare, Bruce W wrote:

I'm attempting to run Scoop 0.9 (scoop.kuro5hin.org) under Apache2/mod_perl
2.0 running on Windows 2000, but the application was written for Apache/mp
1.x, so it uses Apache::SIG (and possibly other) modules that are no longer
in mod_perl.  

The mod_perl developer documentation for porting from 1.x to 2.x doesn't
really cover the missing modules, other than to say you can use
Apache::compat to allow use of deprecated methods. This doesn't do the job
here, which makes sense because the SIG module isn't even installed on my
system. Is there any resource that discusses the changes between mod_perl
1.x and 2.x in more detail than the current developer document? The key
point here is what has been deprecated/removed/rearchitected in mod_perl
2.x? and how do I replace it?

The changes are documented here:
http://perl.apache.org/docs/2.0/user/compat/compat.html

I haven't put it into the developer's guide, but the user's guide. 
Because the user's guide is for all people who write mod_perl code. The 
developer's guide is for those who tinker with the core. I'll put an 
xref to the above doc to avoid this problem in the fuure.

Apache::compat is certainly incomplete, as you have just figured out, 
and that doc is synced with Apache::compat. But we are getting there. 
Please keep reporting those missing things.

I'm not sure if mod_perl 2.0 will ever need this module (especially with 
perl 5.8.0 which has safe signals). So here is a stub that let's your 
1.0 code run as is. It'll be in CVS soonish.

Index: lib/Apache/compat.pm
===
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.71
diff -u -r1.71 compat.pm
--- lib/Apache/compat.pm23 Nov 2002 22:35:06 -  1.71
+++ lib/Apache/compat.pm4 Dec 2002 02:23:01 -
@@ -509,5 +509,14 @@
 APR::Table::make($r-pool, $nelts);
 }

+package Apache::SIG;
+
+use Apache::Const -compile = 'DECLINED';
+
+sub handler {
+# don't set the SIGPIPE
+return Apache::DECLINED;
+}
+
 1;
 __END__


__
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: [mp2.0] How do I port modules using Apache::SIG?

2002-12-03 Thread Stas Bekman
The changes are documented here:
http://perl.apache.org/docs/2.0/user/compat/compat.html

I haven't put it into the developer's guide, but the user's guide. 
Because the user's guide is for all people who write mod_perl code. The 
developer's guide is for those who tinker with the core. I'll put an 
xref to the above doc to avoid this problem in the fuure.

While adding the xrefs I've realized that what I've said is not strictly 
correct, as http://perl.apache.org/docs/2.0/devel/porting/porting.html
includes useful notes for code writers as well. In any case I've added 
xrefs to each other, so there shouldn't be a problem to find all the 
relevant info now. The online docs will be updated by the cron within 6 
hours.

__
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