Re: Charts and Graphs

2007-04-13 Thread martin
> On Thursday 12 April 2007 19:15, Bill Whillers wrote:
>> Hello,
>>
>> I'm wondering what people are using for efficiently generating charts
>> and
>> graphs on the fly from within a mod_perl environment.  I've been using
>> GD::Graph for a while but I'm hoping to get a bit more feature-deep.
>> I'm
>> not terribly concerned about getting a bit more complicated if it means
>> better efficiency and/or better control, etc.
>>
>> Any suggestions?
>
> Have you looked at using gnuplot or R?
>
> Sean
>

Or may be ploticus ?



set request params

2007-09-28 Thread martin
as i see there is no way to set request parameter in mod_perl2
is there any chance this could happen in near future releases?



libapreq2 and FreeBSD

2004-01-16 Thread Martin Nilsson
I'm trying to install libapreq2-2.02-dev on FreeBSD 4.9 with Perl 5.6.1 
and Apache 2.048 mod_perl2-1.99r12 all installed from ports.

Things that needs to be changed:
Build with gmake - not the FreeBSD make!
src/Makefile - Add -L/usr/local/lib to the following line so expat lib 
is found:
LIBS =  /usr/local/lib/apache2/libapr-0.la -lm -lcrypt 
/usr/local/lib/apache2/libaprutil-0.la -lexpat

glue/Makefile - change invocations of make to gmake

Add the ppport.h file found here:
http://marc.theaimsgroup.com/?l=apreq-dev&m=107104807218621&w=2
Add the dAX patch found here:
http://marc.theaimsgroup.com/?l=apreq-dev&m=107110581723271&w=2
Now the package builds and installs but the server tests fail.
I'll make some real programming tests with it tonight.
The following files have been installed, does this look reasonable?

platon# pkg_info -L bsdpan-libapreq2-0.10
Information for bsdpan-libapreq2-0.10:
Files:
///usr/local/lib/perl5/5.6.1/man/man3/Apache::Cookie.3
///usr/local/lib/perl5/5.6.1/man/man3/Apache::Request.3
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/Apache/Cookie.pm
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/Apache/Cookie.pod
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/Apache/Request.pm
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/Apache/Request.pod
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/auto/Apache/Cookie/Cookie.bs
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/auto/Apache/Cookie/Cookie.so
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/auto/Apache/Request/Request.bs
///usr/local/lib/perl5/site_perl/5.6.1/mach/Apache2/auto/Apache/Request/Request.so
///usr/local/lib/perl5/site_perl/5.6.1/mach/auto/libapreq2/.packlist
Thanks for any help making this work!

/Martin

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


Re: libapreq2 and FreeBSD

2004-01-18 Thread Martin Nilsson
Joe Schaefer wrote:
Martin Nilsson <[EMAIL PROTECTED]> writes:


I'm trying to install libapreq2-2.02-dev on FreeBSD 4.9 with Perl
5.6.1 and Apache 2.048 mod_perl2-1.99r12 all installed from ports.


The perl glue looks ok to me.  Where did mod_apreq.so 
and libapreq2.so wind up going? mod_apreq should be in
apache2's module directory, and libapreq2 should be
alongside libaprutil.
/usr/local/libexec/apache2/mod_apreq.so
/usr/local/lib/libapreq2.so
/usr/local/lib/apache2/libaprutil-0.so
The Perl bindings seems to work as they should.

When I tried to build directly from CVS i got lost in autoconf version hell.

	/Martin

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


Re: Search Bot

2004-01-28 Thread martin langhoff
Shawn wrote:

Hi, I have been trying to figure out a way to limit the massive amount
of bandwidth that search bots (Googlebot/2.1) consume daily from my 
website. My problem is that I am running Apache::ASP and about 90% of 
Doesn't Apache::Throttle, configured in apache to kick as a fixuphandler 
only for Googlebot, address the problem?

I seem to recall a thread where people were using it to throttle clients 
based on a "bad client" IP list that was updated on a cron script.

cheers,





martin

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


Re: [OT] Forcing httpd's to not swap out of memory

2004-02-29 Thread Martin Langhoff
Mark Maunder wrote:
Definitely an option. I could blast the server with ap every 10 minutes.
But it's not too elegant in that not all apache children are guaranteed
to serve requests, so some will stay in swap.
Why not send them a meaningless signal? It'd force the kernel to bring 
them back to 'handle' the signal, and then they'd ignore it. You get all 
the children, it's simpler and doesn't muck up you logs or request counts.

Untested cron entry:
*/10 * * * * ps -u apache --option-show-only-pids | xargs kill -SIGARLM
cheers,





martin
--
--
Martin Langhoff  http://nzl.com.ar/


--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Refreshing Caches at server restart

2004-04-19 Thread MARTIN MOSS
All,
 
I have a few modules which cache a few arrays. I want to get around the problem of these arrays staying cached when Apache Restarts gracefully. I can't have the server stop and start, and Apache::Reload isn't really the solution for this problem (or at least I don't think it is).
 
Has anybody done something which can allow me to force certain modules to reload/refresh whenever Apache does a Graceful restart?
 
Marty
 
Chris Faust <[EMAIL PROTECTED]> wrote:
Thanks Geoffrey,That is exactly what I wanted to know.-Chris- Original Message - From: "Geoffrey Young" <[EMAIL PROTECTED]>To: "Chris Faust" <[EMAIL PROTECTED]>Cc: "Tom Schindl" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>Sent: Sunday, April 18, 2004 1:23 PMSubject: Re: Defining specific vars in conf for a shared script>>> Chris Faust wrote:> > That helps Tom, I wasn't even sure if it was "PerlSetVar" that I neededto> > do.> >> > Beyond that, how do I get that from within script? If I'm going to use> > something in my script to read in the conf file then how do I know which> > config file I want?> >> > Using your example is there some> > "$r->get_vhost_settings{'HTML_TEMPLATE_ROOT'}" to get that
 value?>> for PerlSetVar it's>> use Apache::RequestUtil ();> use APR::Table ();>> $r->dir_config->get('HTML_TEMPLATE_ROOT');>> $r will be scoped to the current request, so you'll only get those> PerlSetVar settings that apply to the current vhost or container.>> this is pretty standard stuff, so you might want to check out some of the> docs or books listed at perl.apache.org for more on directive scoping,> PerlSetVar and the like.>> HTH>> --Geoff>-- Report problems: http://perl.apache.org/bugs/Mail list info: http://perl.apache.org/maillist/modperl.htmlList etiquette: http://perl.apache.org/maillist/email-etiquette.html

Re: DBI and Apache::DBI

2004-05-14 Thread MARTIN MOSS
You didn't specify which Database server you're using. If it's mysql you need to be cautious of the 'ping' method used by Apache::DBI to check if a connection is stale or not. the DBD::mysql ping method always returns a 'true' string e.g. "0 but true" rather than a 1 or a 0.
 
I believe the latest version of DBD::mysql has an automatic 'reconnect' feature, but We're still seeing failed connections occuring infrequently on our systems. (Still investigating).
 
MartyPerrin Harkins <[EMAIL PROTECTED]> wrote:
On Wed, 2004-05-12 at 12:15, I S wrote:> a) I don't understand why the database sometimes gets> dropped. It happens randomly but frequently.> > could not prepare: Database disconnected at> /dssweb/httpd/cgi-bin/feeds/viewReport line 157.Usually this is caused by an inactivity timeout on your databaseserver. If you call DBI->connect before that, Apache::DBI will ping theconnection to make sure it is still live and re-connect if it isn't.> b) I built mod_perl and apache with EVERYTHING=1. > Should I expect DBI.pm appear in Apache directory?EVERYTHING=1 affects which hooks are enabled for mod_perl handlers. Ithas nothing to do with which modules will be available.Apache::DBI comes with mod_perl, and you should see it in your site_perldirectory. It is a pure perl module, so it would not be
 under an i386directory (or whatever your architecture is). If you can do PerlModuleApache::DBI in your program without failure, it means that it is therein your @INC path.- Perrin-- Report problems: http://perl.apache.org/bugs/Mail list info: http://perl.apache.org/maillist/modperl.htmlList etiquette: http://perl.apache.org/maillist/email-etiquette.html

Method Handler not working

2004-07-22 Thread MARTIN MOSS
All,
 
I have a quirky issue concerning a redhat machine and Apache 1.
I have a method handler
 
sub handler ($$)
{
  my $class=shift;
  my $r = shift;
}
 
Which when running on a redhat linux machine dies with the error message "Attempt to bless into a reference"  and when analysing the incoming variuables, $class is really $r. So apache seems to be ignoring the method handler directive. 
 
This error doesn't occur on machines running the same code (mirrored in the same way as the redhat box), it works perfectly fine.
 
Has anybody seen this type of error before, is it the symptom of some other issue that I've missed somehow?
 
Regards
 
Marty
		 ALL-NEW 
Yahoo! Messenger - so many 
all-new ways to express yourself 

Re: Method Handler not working

2004-07-22 Thread MARTIN MOSS
I'm not sure, is there a way to find out what options apache has been built with?
 
There are no differences in code & http.conf between the working machines, only OS versions.
 
MartyPerrin Harkins <[EMAIL PROTECTED]> wrote:
On Thu, 2004-07-22 at 11:26, MARTIN MOSS wrote:> This error doesn't occur on machines running the same code (mirrored> in the same way as the redhat box), it works perfectly fine.> > Has anybody seen this type of error before, is it the symptom of some> other issue that I've missed somehow?Did you compile with support for method handlers? That has to beenabled. Also, are there any httpd.conf differences?- Perrin-- Report problems: http://perl.apache.org/bugs/Mail list info: http://perl.apache.org/maillist/modperl.htmlList etiquette: http://perl.apache.org/maillist/email-etiquette.html
		 ALL-NEW 
Yahoo! Messenger - so many 
all-new ways to express yourself 

Re: Method Handler not working

2004-07-22 Thread MARTIN MOSS


Michael <[EMAIL PROTECTED]> wrote:Perrin Harkins
wrote:
> On Thu, 2004-07-22 at 11:26, MARTIN MOSS wrote:
> 
>>This error doesn't occur on machines running the
same code (mirrored
>>in the same way as the redhat box), it works
perfectly fine.
>> 
>>Has anybody seen this type of error before, is it
the symptom of some
>>other issue that I've missed somehow?
> 
> 
> Did you compile with support for method handlers?
That has to be
> enabled. Also, are there any httpd.conf differences?

>right. Does your httpd.conf say
>SetHandler MyPackage::handler
>or
>SetHandler MyPackage

It is setup like this:-


SetHandler  perl-script
PerlHandler My::Package






Michael Peters
Developer
PlusThree







___ALL-NEW Yahoo! Messenger - 
so many all-new ways to express yourself http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Method Handler not working

2004-07-24 Thread MARTIN MOSS

> > > It is setup like this:-
> > > 
> > > 
> > > SetHandler  perl-script
> > > PerlHandler My::Package
> > > 
> > Shouldn't that be
> >PerlHandler My::Package->handler
> 
> Technically that isn't necessary if your method is
> called handler() and
> you have prototyped it with ($$).
> 
I've got a kinda technical details point here, which
is maybe part of this issue.

I was always under the impression that in order to use
a module you should declare it with 
PerlModule My::Module


set-handler PerlScript
PerlHandler My::Module  #in whatever permutation


My question is, If you don't have a PerlModule
statement or a use My::Module, or a require or a
+My::Module statement  so it looks like this

#PerlModule My:Module

set-handler PerlScript
PerlHandler My::Module 


But the module My::Module is on the Include path for
apache (hmm or is that the apache user), What exactly
happens? or should happen?

I ask because this is how the system I'm using has
been configured. Everything seems to work, but I'm
wondering if the previous posted issue is a
consequence of doing this on two different OS systems,
one is Redhat, the other is freeBSD

I've never come across this method before.

Regards

Marty






___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://www.allnewmessenger.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Method Handler not working

2004-07-24 Thread MARTIN MOSS
Thanks very much Perrin,

Have a nice weekend,

Marty


--- Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Fri,
2004-07-23 at 18:12, MARTIN MOSS wrote:
> > My question is, If you don't have a PerlModule
> > statement or a use My::Module, or a require or a
> > +My::Module statement  so it looks like this
> > 
> > #PerlModule My:Module
> > 
> > set-handler PerlScript
> > PerlHandler My::Module 
> > 
> > 
> > But the module My::Module is on the Include path
> for
> > apache (hmm or is that the apache user), What
> exactly
> > happens?
> 
> mod_perl tries to load it at request time.  There
> are two reasons why
> this is bad.  The first is that it doesn't allow for
> copy-on-write
> shared memory.  You want to load it before the fork,
> and this doesn't do
> that.  The second is that it doesn't know about the
> method prototyping
> and thus your handler is not called as a method.
> 
> So, load the module first.  You can do it in any
> number of ways
> (startup.pl is common).  I think this will fix your
> problem.
> 
> - Perrin
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://www.allnewmessenger.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Method Handler not working

2004-07-26 Thread MARTIN MOSS
--- Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Fri,
2004-07-23 at 18:12, MARTIN MOSS wrote:
> > My question is, If you don't have a PerlModule
> > statement or a use My::Module, or a require or a
> > +My::Module statement  so it looks like this
> > 
> > #PerlModule My:Module
> > 
> > set-handler PerlScript
> > PerlHandler My::Module 
> > 
> > 
> > But the module My::Module is on the Include path
> for
> > apache (hmm or is that the apache user), What
> exactly
> > happens?
> 
> mod_perl tries to load it at request time.  There
> are two reasons why
> this is bad.  The first is that it doesn't allow for
> copy-on-write
> shared memory.  You want to load it before the fork,
> and this doesn't do
> that.  The second is that it doesn't know about the
> method prototyping
> and thus your handler is not called as a method.
> 
> So, load the module first.  You can do it in any
> number of ways
> (startup.pl is common).  I think this will fix your
> problem.
> 
> - Perrin

I have a little note to add, It seems that under
freeBSD the above bad method does seem to work ok (or
at least gives that illusion),  But on Redhat, it
doesn't. Anybody have any ideas why this is?

Marty







___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://www.allnewmessenger.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



[mp2] make test fails on t/hooks/hookrun.t t/hooks/stacked-handlers2.t and t/user/rewrite.c

2004-09-04 Thread Martin Wheldon
Hi Folks,
   Hope you can help me with this one. Apologies if I've missed and 
critical information. If I have please let me know and I'll provide any 
additional that is required.

Thanks in advance
Martin
-8<-- Start Bug Report 8<--
1. Problem Description:
   During the make test phase the following test fail. The server core 
dumps during these failures.

t/hooks/hookrun.t
t/hooks/stacked_handlers2.t
t/user/rewrite.t
System information.
Debian Woody 3.01r
Perl 5.6.1
mod_perl-1.99_16
Apache 2.0.49 -(OpenSSL/0.9.7d PHP/4.3.7 FrontPage/5.0.2.2635 )
Compiled in modules:
core.c
mod_access.c
mod_auth.c
util_ldap.c
mod_auth_ldap.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_so.c
t/logs/error_log from invividual tests.
[Sat Sep 04 22:32:47 2004] [debug] util_ldap.c(1129): LDAP cache: Unable 
to init Shared Cache: no file
[Sat Sep 04 22:32:47 2004] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Sat Sep 04 22:32:47 2004] [notice] LDAP: SSL support unavailable
[Sat Sep 04 22:32:47 2004] [info] Init: Initializing OpenSSL library
[Sat Sep 04 22:32:47 2004] [info] Init: Seeding PRNG with 0 bytes of entropy
[Sat Sep 04 22:32:47 2004] [info] Init: Generating temporary RSA private 
keys (512/1024 bits)
[Sat Sep 04 22:32:47 2004] [info] Init: Generating temporary DH 
parameters (512/1024 bits)
[Sat Sep 04 22:32:47 2004] [warn] Init: Session Cache is not configured 
[hint: SSLSessionCache]
[Sat Sep 04 22:32:47 2004] [info] Init: Initializing (virtual) servers 
for SSL
[Sat Sep 04 22:32:47 2004] [info] Server: Apache/2.0.49, Interface: 
mod_ssl/2.0.49, Library: OpenSSL/0.9.7d
END in modperl_extra.pl, pid=12436
[Sat Sep 04 22:32:48 2004] [debug] util_ldap.c(1129): LDAP cache: Unable 
to init Shared Cache: no file
[Sat Sep 04 22:32:48 2004] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Sat Sep 04 22:32:48 2004] [notice] LDAP: SSL support unavailable
[Sat Sep 04 22:32:48 2004] [info] Init: Initializing OpenSSL library
[Sat Sep 04 22:32:48 2004] [info] Init: Seeding PRNG with 0 bytes of entropy
[Sat Sep 04 22:32:48 2004] [info] Init: Generating temporary RSA private 
keys (512/1024 bits)
[Sat Sep 04 22:32:48 2004] [info] Init: Generating temporary DH 
parameters (512/1024 bits)
[Sat Sep 04 22:32:48 2004] [info] Init: Initializing (virtual) servers 
for SSL
[Sat Sep 04 22:32:48 2004] [info] Server: Apache/2.0.49, Interface: 
mod_ssl/2.0.49, Library: OpenSSL/0.9.7d
[Sat Sep 04 22:32:48 2004] [error] (13)Permission denied: Can't clean 
stale key files from directory 
"/usr/local/frontpage/version5.0/apache-fp" in FrontPageCleanup().
[Sat Sep 04 22:32:48 2004] [error] Not running as root in 
FrontPageCheckup().  Until this problem is fixed, the FrontPage security 
patch is disabled and the FrontPage extensions may not work correctly.
[Sat Sep 04 22:32:48 2004] [notice] Apache/2.0.49 (Unix) 
mod_perl/1.99_16 Perl/v5.6.1 world domination series/2.0 mod_ssl/2.0.49 
OpenSSL/0.9.7d PHP/4.3.7 configured -- resuming normal operations
[Sat Sep 04 22:32:48 2004] [info] Server built: Jul  5 2004 15:16:10
[Sat Sep 04 22:32:48 2004] [debug] prefork.c(955): AcceptMutex: sysvsem 
(default: sysvsem)
[Sat Sep 04 22:32:49 2004] [notice] child pid 12445 exit signal 
Segmentation fault (11), possible coredump in 
/usr/local/src/mod_perl-1.99_16/t
[Sat Sep 04 22:32:50 2004] [info] Child process pid=12456 is exiting
END in modperl_extra.pl, pid=12456
[Sat Sep 04 22:32:50 2004] [warn] child process 12462 still did not 
exit, sending a SIGTERM
[Sat Sep 04 22:32:50 2004] [info] Child process pid=12462 is exiting
END in modperl_extra.pl, pid=12462
[Sat Sep 04 22:32:50 2004] [info] removed PID file 
/usr/local/src/mod_perl-1.99_16/t/logs/httpd.pid (pid=12440)
[Sat Sep 04 22:32:50 2004] [notice] caught SIGTERM, shutting down
END in modperl_extra.pl, pid=12440


Indevidual test results
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl 
/usr/local/src/mod_perl-1.99_16/t/TEST -verbose 't/hooks/hookrun.t' 
't/hooks/stacked_handlers.t' 't/user/rewrite.t'
[   info] consider removing an old 
/usr/local/src/mod_perl-1.99_16/t/core file before running tests
[warning] root mode: changing the files ownership to 'nobody' (65534:65534)
[warning] testing whether 'nobody' is able to -rwx 
/usr/local/src/mod_perl-1.99_16/t
"/usr/bin/perl" -Mlib=/usr/local/src/mod_perl-1.99_16/Apache-Test/lib 
-MApache::TestRun -e 'eval { Apache::TestRun::run_root_fs_test(65534, 
65534, q[/usr/local/src/mod_perl-1.99_16/t]) }';

[warning] result: OK
[warning] the client side drops 'root' permissions and becomes 'nobody'
/usr/local/apache2/bin/httpd -d /usr/local/src/mod_perl-1.99_16/t -f 
/usr/loc

[mp2] make test fails on t/hooks/hookrun.t t/hooks/stacked-handlers2.t and t/user/rewrite.c

2004-09-07 Thread Martin Wheldon
Hi Folks,
   Repost of information. Hope I've got everything this time. Am I 
right in thinking it is an issue with Frontpage extensions, if so is it 
possible to run both modules on the same server. Reason being I want to 
be able to offer both frontpage and asp(perl script) to my users?

  Hope you can help me with this one. Apologies if I've missed and 
critical information. If I have please let me know and I'll provide any 
additional that is required.

Thanks in advance
Martin
-8<-- Start Bug Report 8<--
1. Problem Description:
  During the make test phase the following test fail. The server core 
dumps during these failures.

t/hooks/hookrun.t
t/hooks/stacked_handlers2.t
t/user/rewrite.t
System information.
Debian Woody 3.01r
Perl 5.6.1
mod_perl-1.99_16
Apache 2.0.49 -(OpenSSL/0.9.7d PHP/4.3.7 FrontPage/5.0.2.2635 )
Compiled in modules:
core.c
mod_access.c
mod_auth.c
util_ldap.c
mod_auth_ldap.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_so.c
Indevidual test results
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl 
/usr/local/src/mod_perl-1.99_16/t/TEST -verbose 't/hooks/hookrun.t' 
't/hooks/stacked_handlers.t' 't/user/rewrite.t'
[   info] consider removing an old 
/usr/local/src/mod_perl-1.99_16/t/core file before running tests
[warning] root mode: changing the files ownership to 'nobody' (65534:65534)
[warning] testing whether 'nobody' is able to -rwx 
/usr/local/src/mod_perl-1.99_16/t
"/usr/bin/perl" -Mlib=/usr/local/src/mod_perl-1.99_16/Apache-Test/lib 
-MApache::TestRun -e 'eval { Apache::TestRun::run_root_fs_test(65534, 
65534, q[/usr/local/src/mod_perl-1.99_16/t]) }';

[warning] result: OK
[warning] the client side drops 'root' permissions and becomes 'nobody'
/usr/local/apache2/bin/httpd -d /usr/local/src/mod_perl-1.99_16/t -f 
/usr/local/src/mod_perl-1.99_16/t/conf/httpd.conf -D APACHE2
using Apache/2.0.49 (prefork MPM)

waiting 120 seconds for server to start: .[Sat Sep 04 22:32:47 2004] 
[info] 26 Apache:: modules loaded
[Sat Sep 04 22:32:47 2004] [info] 7 APR:: modules loaded
[Sat Sep 04 22:32:47 2004] [info] base server + 20 vhosts ready to run 
tests
.
waiting 120 seconds for server to start: ok (waited 1 secs)
server localhost:8529 started
server localhost:8530 listening (TestVhost::config)
server localhost:8531 listening (TestFilter::in_str_msg)
server localhost:8532 listening (TestModperl::setupenv)
server localhost:8533 listening (TestModperl::merge)
server localhost:8534 listening (TestModperl::perl_options)
server localhost:8535 listening (TestProtocol::pseudo_http)
server localhost:8536 listening (TestProtocol::echo_filter)
server localhost:8537 listening (TestProtocol::echo_bbs2)
server localhost:8538 listening (TestProtocol::echo_bbs)
server localhost:8539 listening (TestProtocol::echo_timeout)
server localhost:8540 listening (TestProtocol::echo_block)
server localhost:8541 listening (TestPreConnection::note)
server localhost:8542 listening (TestHooks::startup)
server localhost:8543 listening (TestHooks::stacked_handlers2)
server localhost:8544 listening (TestHooks::hookrun)
server localhost:8545 listening (TestFilter::in_bbs_msg)
server localhost:8546 listening (TestFilter::both_str_con_add)
server localhost:8547 listening (TestFilter::in_bbs_inject_header)
server localhost:8548 listening (TestDirective::perlrequire)
server localhost:8549 listening (TestDirective::perlmodule)
server localhost:8550 listening (TestDirective::perlloadmodule5)
server localhost:8551 listening (TestDirective::perlloadmodule3)
server localhost:8552 listening (TestDirective::perlloadmodule4)
server localhost:8553 listening (TestDirective::perlloadmodule6)
t/hooks/hookrun.# connecting to localhost:8544
1..10
# Using Apache/Test.pm version 1.14
request has failed (the response code was: 500)
see t/logs/error_log for more details
# testing : $r->die
# expected: 500
# received: 500
ok 1
dubious
  Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 2-10
  Failed 9/10 tests, 10.00% okay
t/hooks/stacked_handlers1..1
# Using Apache/Test.pm version 1.14
# testing : stacked_handlers
# expected: one
# two
# three
# received: one
# two
# three
ok 1
ok
t/user/rewrite..request has failed (the response code was: 500)
see t/logs/error_log for more details
dubious
  Test returned status 9 (wstat 2304, 0x900)
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
--- 

t/hooks/hookrun.t9  230410   18 180.00%  2-10
t/user/rewrite.t 9  2304??   ??   %  ??
Failed 2/3 test scripts

[mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre



Hello all,
I am totally new to mod_perl mailing list so maybe 
i am not posting in the right place.
 
I recently installed a debian woody on a pentium 
based box. I also managed to install Apache 2 (with php and some others modules) 
and it works perfectly as i was waiting it to do :)

I red that apache 2.x was not compatible with 
mod_perl 1.x, so i downloaded the 2.current. I figured out that in the package 
it is 1.99. Is it ok?Now, i am trying to make mod_perl working with 
this bunch of sacred software, and i just CANT. The mod_perl version is 1.99_16 
and my Apache is 2.0.52.
 
* Configured:
perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 
MP_INST_APACHE2=1
 
Compiled:
* make && make install without any 
problem.
 
* But when i start apache i get this 
stuff:
Syntax error on line 104 of 
/usr/local/apache2/conf/httpd.conf:Cannot load 
/usr/local/apache2/modules/mod_perl.so into server: 
/usr/local/apache2/modules/mod_perl.so: undefined symbol: 
PL_localizing
 
i googled a lot, but in didnt found 
anything!
 
If somebody answer this, and if you ask me for 
information, like nm xxx.so, please tell me the command line to do cause im not 
very familar with linux shell.
 
Please somebody helps me, my native language is 
french so if somebody try to help me be clear and speak slowly :)
In advance i thank you all a lot, and 
anyway!
 
Pierre
-8<-- Start Bug Report 8<--
1. Problem Description:

  [DESCRIBE THE PROBLEM HERE]

2. Used Components and their Configuration:

*** mod_perl version 1.9916

*** using /data/misc/mod_perl-1.99_16/lib/Apache/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB  => aprext
  MP_AP_PREFIX=> /usr/local/apache2
  MP_COMPAT_1X=> 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1


*** The httpd binary was not found


*** (apr|apu)-config linking info

 -L/usr/local/apache2/lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread -ldl
 -L/usr/local/apache2/lib -laprutil-0 -lgdbm -ldb3 -lexpat



*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=linux, osvers=2.6.3-deb2-skas3, archname=i386-linux
uname='linux mizar 2.6.3-deb2-skas3 #1 sun mar 14 14:46:35 pst 2004 i686 unknown '
config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux 
-Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 
-Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 
-Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl 
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib 
-Dlibperl=libperl.so.5.6.1 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.4 20011002 (Debian prerelease)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
perllibs=-ldl -lm -lc -lcrypt
libc=/lib/libc-2.2.5.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Apr  4 2004 05:57:53
  %ENV:
PERL_LWP_USE_HTTP_10="1"
  @INC:
/usr/local/lib/perl/5.6.1
/usr/local/share/perl/5.6.1
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.6.1
/usr/share/perl/5.6.1
/usr/local/lib/site_perl
.

*** Packages of interest status:

Apache::Request: -
CGI: 2.752
LWP: -
mod_perl   : 1.9915, 1.9916


3. This is the core dump trace: (if you get a core dump):

  [CORE TRACE COMES HERE]

This report was generated by t/REPORT on Mon Oct 11 17:05:39 2004 GMT.

-8<-- End Bug Report --8<--

Note: Complete the rest of the details and post this bug report to
modperl  perl.apache.org. To subscribe to the list send an empty
email to 

Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre
Hello again,
Here are the needed informations, this time CCed to all the mailing list:

* "make test" gives me no errors until here:
/usr/local/apache2/bin/httpd -d /data/misc/mod_perl-1.99_16/t -f
/data/misc/mod_perl-1.99_16/t/conf/httpd.conf -D APACHE2
using Apache/2.0.52 (prefork MPM)

waiting 120 seconds for server to start: .Syntax error on line 12 of
/data/misc/mod_perl-1.99_16/t/conf/httpd.conf:
Cannot load /data/misc/mod_perl-1.99_16/src/modules/perl/mod_perl.so
into
server: /data/misc/mod_perl-1.99_16/src/modules/perl/mod_perl.so:
undefined
symbol: PL_localizing
[  error]
server has died with status 1 (t/logs/error_log wasn't created, start
the
server in the debug mode)
make: *** [run_tests] Error 143

* The output of "ldd /usr/local/apache2/modules/mod_perl.so" is:
libgdbm.so.1 => /usr/lib/libgdbm.so.1 (0x4002d000)
libdl.so.2 => /lib/libdl.so.2 (0x40033000)
libm.so.6 => /lib/libm.so.6 (0x40037000)
libc.so.6 => /lib/libc.so.6 (0x40058000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x40175000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000)

* "locate libperl.so*" (i just made an updatedb to make sure results will
be nice) gives me:
/usr/lib/libperl.so
/usr/lib/libperl.so.5.6
/usr/lib/libperl.so.5.6.1

But i think the first 2 items are symlinks pointing to
/usr/lib/libperl.so.5.6.1, so in theory no problem...

Thank you!
Pierre

- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "MARTIN Pierre" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 11, 2004 7:33 PM
Subject: Re: [mp2] & Apache2: undefined symbol: PL_localizing


> MARTIN Pierre wrote:
> > Hello all,
> > I am totally new to mod_perl mailing list so maybe i am not posting in
the right place.
>
> You are posting it to the right place, Martin.
>
> > I recently installed a debian woody on a pentium based box. I also
managed to install Apache 2 (with php and some others modules) and it works
perfectly as i was waiting it to do :)
> > I red that apache 2.x was not compatible with mod_perl 1.x, so i
downloaded the 2.current. I figured out that in the package it is 1.99. Is
it ok?
> > Now, i am trying to make mod_perl working with this bunch of sacred
software, and i just CANT. The mod_perl version is 1.99_16 and my Apache is
2.0.52.
> >
> > * Configured:
> > perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 MP_INST_APACHE2=1
> >
> > Compiled:
> > * make && make install without any problem.
>
> You forgot to run the most important part: make test
>
> > * But when i start apache i get this stuff:
> > Syntax error on line 104 of /usr/local/apache2/conf/httpd.conf:
> > Cannot load /usr/local/apache2/modules/mod_perl.so into server:
/usr/local/apache2/modules/mod_perl.so: undefined symbol: PL_localizing
> >
> > i googled a lot, but in didnt found anything!
> >
> > If somebody answer this, and if you ask me for information, like nm
xxx.so, please tell me the command line to do cause im not very familar with
linux shell.
> >
> > Please somebody helps me, my native language is french so if somebody
try to help me be clear and speak slowly :)
> > In advance i thank you all a lot, and anyway!
>
> > libc=/lib/libc-2.2.5.so, so=so, useshrplib=true,
libperl=libperl.so.5.6.1
>
> Looks like the usual problem of having more than one perl installed the
> wrong libperl.so getting on the way of the startup (not the one you built
> modperl with). Please post the output of:
>
> ldd /usr/local/apache2/modules/mod_perl.so
>
> and the location of all libperl.so.* file found on your system.
>
> (you could try using locate(1) to accomplish that task)
>
> locate libperl.so
>
> --
> __
> 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
>
> --
> Report problems: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
> List etiquette: http://perl.apache.org/maillist/email-etiquette.html
>
>
>



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre
> Hmm, can you please paste the arguments you passed to perl Makefile.PL? I
> can't figure out why the above output doesn't show a link to libperl.so

To configure i just did:
perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 MP_INST_APACHE2=1
Is there a step before that i forgot?

/data/misc/mod_perl-1.99_16# ldd src/modules/perl/mod_perl.so Gives me the
same i think:
libgdbm.so.1 => /usr/lib/libgdbm.so.1 (0x4002d000)
libdl.so.2 => /lib/libdl.so.2 (0x40033000)
libm.so.6 => /lib/libm.so.6 (0x40037000)
libc.so.6 => /lib/libc.so.6 (0x40058000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x40175000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000)

> > * "locate libperl.so*" (i just made an updatedb to make sure results
will
> > be nice) gives me:
> > /usr/lib/libperl.so
> > /usr/lib/libperl.so.5.6
> > /usr/lib/libperl.so.5.6.1
>
> The perl you've quoted seems to live in /usr/local/share/perl/5.6.1, are
> you sure there is no other libperl.so on your system?

Nope, i think that it is all that i have matching the name libperl.so, i
just tryed with "locate *libperl*" and it does:
/data/misc/mod_perl-1.29/apaci/libperl.module
/usr/doc/libperl5.6
/usr/lib/libperl.so
/usr/lib/libperl.so.5.6
/usr/lib/libperl.so.5.6.1
/usr/share/defoma/libperl-file.pl
/usr/share/defoma/libperl-hint.pl
/usr/share/doc/libperl5.6
/var/lib/dpkg/info/libperl5.6.list
/var/lib/dpkg/info/libperl5.6.md5sums
/var/lib/dpkg/info/libperl5.6.postinst
/var/lib/dpkg/info/libperl5.6.postrm
/var/lib/dpkg/info/libperl5.6.prerm
/var/lib/dpkg/info/libperl5.6.shlibs

So no other .so on this list i didnt mention before...

I am totally lost :)
I can try to "uninstall" PERL 5 from my DEBIAN, but i think it is too
difficult for me because of all the dependency in my system :(
Do you think that a PERL reinstallation should solve it?

Pierre.



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre
> what happens if you do:
>nm src/modules/perl/mod_perl.so | grep PL_

 U PL_curcop
 U PL_curinterp
 U PL_curpad
 U PL_curstack
 U PL_curstackinfo
 U PL_curstash
 U PL_defoutgv
 U PL_defstash
 U PL_diehook
 U PL_egid
 U PL_endav
 U PL_envgv
 U PL_errgv
 U PL_euid
 U PL_gensym
 U PL_gid
 U PL_incgv
 U PL_localizing
 U PL_markstack_max
 U PL_markstack_ptr
 U PL_modglobal
 U PL_na
 U PL_op
 U PL_origenviron
 U PL_patchlevel
 U PL_perl_destruct_level
 U PL_ppaddr
 U PL_rs
 U PL_scopestack_ix
 U PL_stack_base
 U PL_stack_max
 U PL_stack_sp
 U PL_stderrgv
 U PL_sv_undef
 U PL_sv_yes
 U PL_tainted
 U PL_tainting
 U PL_tmps_floor
 U PL_tmps_ix
 U PL_uid
 U PL_vtbl_env
 U PL_vtbl_envelem


> and this:
>
>ldd -r src/modules/perl/mod_perl.so
OUCH
Output is too long i cant get all, ( i am connected to the bogus machine via
SSH)

undefined symbol: apr_table_setn(src/modules/perl/mod_perl.so)
undefined symbol: PL_gensym (src/modules/perl/mod_perl.so)
undefined symbol: PL_euid   (src/modules/perl/mod_perl.so)
undefined symbol: PL_envgv  (src/modules/perl/mod_perl.so)
undefined symbol: PL_na (src/modules/perl/mod_perl.so)
undefined symbol: PL_sv_yes (src/modules/perl/mod_perl.so)
undefined symbol: PL_errgv  (src/modules/perl/mod_perl.so)
undefined symbol: PL_curstackinfo   (src/modules/perl/mod_perl.so)
undefined symbol: PL_curstash   (src/modules/perl/mod_perl.so)
undefined symbol: PL_modglobal  (src/modules/perl/mod_perl.so)
undefined symbol: PL_defoutgv   (src/modules/perl/mod_perl.so)
undefined symbol: PL_stack_base (src/modules/perl/mod_perl.so)
undefined symbol: PL_tainted(src/modules/perl/mod_perl.so)
undefined symbol: PL_stack_sp   (src/modules/perl/mod_perl.so)
undefined symbol: PL_curcop (src/modules/perl/mod_perl.so)
undefined symbol: PL_vtbl_envelem   (src/modules/perl/mod_perl.so)
undefined symbol: PL_tmps_floor (src/modules/perl/mod_perl.so)
undefined symbol: PL_curpad (src/modules/perl/mod_perl.so)
undefined symbol: PL_scopestack_ix  (src/modules/perl/mod_perl.so)
undefined symbol: PL_op (src/modules/perl/mod_perl.so)
undefined symbol: apr_pool_cleanup_null (src/modules/perl/mod_perl.so)
undefined symbol: PL_tainting   (src/modules/perl/mod_perl.so)
undefined symbol: PL_incgv  (src/modules/perl/mod_perl.so)
undefined symbol: PL_vtbl_env   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_gv_stashpv   (src/modules/perl/mod_perl.so)
undefined symbol: perl_get_sv   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_croak(src/modules/perl/mod_perl.so)
undefined symbol: ap_log_rerror (src/modules/perl/mod_perl.so)
undefined symbol: Perl_sv_free  (src/modules/perl/mod_perl.so)
undefined symbol: Perl_markstack_grow   (src/modules/perl/mod_perl.so)
undefined symbol: ap_hook_post_config   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_save_int (src/modules/perl/mod_perl.so)
undefined symbol: ap_scan_script_header_err_strs
(src/modules/perl/mod_perl.so)
undefined symbol: Perl_sv_setiv (src/modules/perl/mod_perl.so)
undefined symbol: Perl_sv_unmagic   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_mg_find  (src/modules/perl/mod_perl.so)
undefined symbol: Perl_av_store (src/modules/perl/mod_perl.so)
undefined symbol: apr_pool_create_ex(src/modules/perl/mod_perl.so)
undefined symbol: apr_bucket_shared_destroy
(src/modules/perl/mod_perl.so)
undefined symbol: apr_table_overlay (src/modules/perl/mod_perl.so)
undefined symbol: Perl_av_len   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_av_pop   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_sv_setuv (src/modules/perl/mod_perl.so)
undefined symbol: ap_get_brigade(src/modules/perl/mod_perl.so)
undefined symbol: Perl_newGVgen (src/modules/perl/mod_perl.so)
undefined symbol: ap_hook_handler   (src/modules/perl/mod_perl.so)
undefined symbol: apr_strerror  (src/modules/perl/mod_perl.so)
undefined symbol: Perl_pop_scope(src/modules/perl/mod_perl.so)
undefined symbol: ap_hook_check_user_id (src/modules/perl/mod_perl.so)
undefined symbol: apr_brigade_flatten   (src/modules/perl/mod_perl.so)
undefined symbol: Perl_av_clear (src/modules/perl/mod_perl.so)
undefined symbol: ap_register_output_filter
(src/modules/perl/mod_perl.so)
undefined symbol: Perl_save_scalar  (src/modules/perl/mod_perl.so)
undefined symbol: Perl_save_sptr(src/modules/perl/mod_perl.so)
undefined symbol: ap_single_module_configure
(src/modules/perl/mod_perl.so)
undefined symbol: Perl_av_shift (src/modules/perl/mod_perl.so)
undefined symbol: apr_table_clear   (src/modules/perl/mod_perl.so)
undefined symbol: ap_check_cmd_context  (src/

Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre
> Please do:
> cd src/modules/perl/
> rm mod_perl.so
> make -f Makefile.modperl

Here we go:

/data/misc/mod_perl-1.99_16/src/modules/perl# rm mod_perl.so
/data/misc/mod_perl-1.99_16/src/modules/perl# make -f Makefile.modperl
rm -f mod_perl.so
cc -shared -L/usr/local/lib \
 \
mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo
modperl_config.lo
 modperl_cmd.lo modperl_options.lo modperl_callback.lo modperl_handler.lo
modper
l_gtop.lo modperl_util.lo modperl_io.lo modperl_io_apache.lo
modperl_filter.lo m
odperl_bucket.lo modperl_mgv.lo modperl_pcw.lo modperl_global.lo
modperl_env.lo
modperl_cgi.lo modperl_perl.lo modperl_perl_global.lo modperl_perl_pp.lo
modperl
_sys.lo modperl_module.lo modperl_svptr_table.lo modperl_const.lo
modperl_consta
nts.lo modperl_apache_compat.lo modperl_error.lo modperl_debug.lo
modperl_common
_util.lo modperl_common_log.lo modperl_hooks.lo modperl_directives.lo
modperl_fl
ags.lo modperl_xsinit.lo  -rdynamic  -L/usr/local/lib
/usr/lib/perl/5.6.1/auto/D
ynaLoader/DynaLoader.a -L/usr/lib/perl/5.6.1/CORE -lperl -ldl -lm -lc -lcryp
t \
-o mod_perl.so
: mod_perl.so

But maybe there was something i didnt understand, "make -f Makefile.modperl"
has to be done in the "root" folder of the sources, or in the
/source_folder/src/modules/perl folder? I dit it in the /src/modules/perl
folder...

> Don't worry. I don't think it has anything to do with your level of
> expertise in linux. It should just work. Let's just continue :)
Between you and me, my first time on a mailing list, i didn't know it was
existing, it is really helpfull.
Just a question, is there a way to access ALL this mailing list archive? For
example, before asking you, is there a way for me to search in it / does
google indexes it?

Pierre



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-11 Thread MARTIN Pierre
> I think your linker is broken. I say that because it included the linking
> directives:
>
>-L/usr/lib/perl/5.6.1/CORE -lperl
>
> but the resulting mod_perl.so doesn't show it up. It should have
> complained if it didn't find it. Try upgrading your linker (cc) and try
> rebuilding mod_perl again.

Okay, maybe you know the name of the package i have to search for?

I hope this thread ends here, it would mean my problem does too...
If not, we will talk again soon! :O)
Anyway i am going to find this, do it, and whatever happens i'll give you
feedback...

Thank you VERY MUCH, it was really nice from you to help me!

Pierre



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-12 Thread MARTIN Pierre
> Hi Pierre,

Hello William,

> I run Apache with Debian and have had
> troubles in the past with compiling mod_perl due to having two copies of
> libperl.so[1]; I think this would more likely be the case if you have
> compiled Perl yourself.

We discussed about all this with Stas and we arrived at the conclusion that
my GCC linker should be broken. I didn't compile perl manualy, i used the
debian package. So i am going to upgrade my Linker program, and i will tell
you guys if it worked...

Thank you,
Pierre



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-12 Thread MARTIN Pierre
Hello Nick,

> If you want mod_perl for Apache2 in Debian, I'd suggest you use a
> packaged
> version; it's a lot easier.

My problem is, that i CANT get the debian package because i compiled &
installed apache manualy. Few weeks ago i tryed to override some debian
dependency packages, and the result was that my system was a wreck. So i m
kind of affraid to do it again,
i think i will follow Stas advices and first give a try to the GCC linker,
which appear to be dead.

> mod_perl for apache2 in Debian is in the package libapache2-mod-perl2,
> which is in testing and unstable distributions.

To install libapache2-mod-perl2, debian tells me to install apache-common,
apache, and so on...

> If you really need to use woody for some reason, I'd suggest that you
> grab the sources for the testing version of the package, and work from
> there. That way, you will have a list of the other packages you need in
> order to build it, and any debian-specific workarounds or similar will
> be in-place. You will also get the benefit that at the end of it all,
> you'll end up with a package that can easily be installed onto multiple
> servers.

The point is i don't have any choice but woody, cause my CD burner is dead,
and Woody is the only distrib that can suit for a server i have on CD (i
also have mandrake 9.2 but now i prefer debian :) )

> You may find that you end up needing a whole chain of backports of more
> recent versions of things in order to make it work. In that case, I'd
> consider using the testing distribution. You won't (yet) get security
> updates reliably, but that is being worked on, as testing is going to
> become stable fairly soon. And there are a whole lot of other goodies
> in testing that aren't in stable -- perl 5.8 and lots more perl modules
> that weren't previously packaged, for example. And gcc 3.3...

That is right, i didnt thought about that. My GCC is 2.95.4, do you think it
can be why the linker appears as broken?

Thank you for help!

Pierre



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Mod perl performance and DSO?

2004-10-12 Thread Martin Moss
All,

I have a brand new redhat 9 box. I have plenty of
diskspace and I need to install apache mode perl mod
php and mod ssl. 

Most information I find on the web to do this uses
DSO. Performance is absolutely critical for this
machine, it's going to be handling millions of web
'hits' per day. 

My question is, should we use DSO or not?
My second question is, is this a daft question?

Kind regards

Marty







___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Mod perl performance and DSO?

2004-10-13 Thread Martin Moss
Hmmm, I'm a little concerned that using DSO does have
a performance hit for no real benefit for what we wish
to do. Hmm, now just need to find instructions on
building apache with mod_ssl, mod_perl and mod_php?
without using DSO, any ideas? (whilst I'm off to
google...)

Marty


 --- William McKee <[EMAIL PROTECTED]> wrote: 
> On Tue, Oct 12, 2004 at 05:06:18PM +0100, Martin
> Moss wrote:
> > Most information I find on the web to do this uses
> > DSO. Performance is absolutely critical for this
> > machine, it's going to be handling millions of web
> > 'hits' per day. 
> > 
> > My question is, should we use DSO or not?
> > My second question is, is this a daft question?
> 
> You didn't mention what version of Apache you were
> using but try this
> url for a starter:
> 
>
http://perl.apache.org/docs/1.0/guide/install.html#Pros_and_Cons_of_Building_mod_perl_as_DSO
> 
> You can answer the 2nd question for yourself after
> you read the above :).
> 
> 
> William
> 
> -- 
> Knowmad Services Inc.
> http://www.knowmad.com
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Mod perl performance and DSO?

2004-10-13 Thread Martin Moss
eek, sorry, you guessed right at apache 1.x (1.3.31)

Marty

 --- William McKee <[EMAIL PROTECTED]> wrote: 
> On Wed, Oct 13, 2004 at 12:46:19PM +0100, Martin
> Moss wrote:
> > Hmmm, I'm a little concerned that using DSO does
> have
> > a performance hit for no real benefit for what we
> wish
> > to do. Hmm, now just need to find instructions on
> > building apache with mod_ssl, mod_perl and
> mod_php?
> > without using DSO, any ideas? (whilst I'm off to
> > google...)
> 
> Yes, that's been my decision as well. I still don't
> know what version of
> Apache you are using, but if it's 1.x, then you may
> want to try
> Apachetoolbox[1]. I use it to compile mod_perl and
> mod_ssl.  However, I
> have not tried to compile mod_php along with
> mod_perl. There is a pretty
> good online forum which you could turn to if you hit
> any snags.  Let me
> know how it turns out; I may need to do this myself
> one day.
> 
> Good luck,
> William
> 
> [1] http://www.apachetoolbox.com/
> 
> 
> -- 
> Knowmad Services Inc.
> http://www.knowmad.com
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Modperl setup Linux (which version)?

2004-10-13 Thread Martin Moss
Not for Mp2 but did you come across this link?

http://www.brtnet.org/linux/rtinstall.htm

Marty 

--- Jon Forrest <[EMAIL PROTECTED]> wrote: 
> Maybe others know something that I don't know,
> but I was unable to build mod_perl2 with apache 2
> on either Mandrake 10.0 or Fedora Core 2. I sent
> several bug reports to this list summarizing
> the problems.
> 
> Since my goal was to build Request Tracker, and
> their documentation strongly advises against
> mod_perl2, I decided to forget about this for
> now and use mod_perl1 which builds and runs just
> fine on these platforms.
> 
> Cordially,





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



[mp2] Large (>11584 bytes) requests truncated

2004-10-15 Thread Scot Martin
Apache 2.0.52   mod_perl 1.99_16   Perl 5.8.5  
OpenSSL 0.9.7d   Solaris 8

Greetings!

I am building a load test environment that simulates
responses from a large database, with all I/O in an
XML payload.  Most of the requests and responses are
no more than a few hundred bytes, but then there are a
couple huge ones.  

The problem I'm having is that my largest request is
349024 bytes and when I send it (using Perl 5.8.5
w/libwww) I can see the first 11584 bytes come in
(using truss), but then nothing further.  

Watching the server with truss, I can see the calls to
read() with buffer sizes of 8000 bytes, each of which
typically contain only between 1.4K and 4.3K of data. 
There are always 4 calls to read() (Normal byte count
is 1448, 2896, 2896 and 4344) then we go to sleep in
accept().

I tried various ways of reading data from the client
and ended up using the Bucket Brigade approach so I
can see everything as it comes through the front door,
all to no avail.

As a sanity check I sent the same request to the real
database and everything worked fine, so I know the
client script is working.

What am I missing?

Thanks in advance,
Scot


P.S.  This is the second project I'm working on using
MP2.  The first was an application server that
supports the entire IVR platform for a large bank. 
These application servers process requests for 1
million customers a day and have been in production
since November 2003.  Mod_perl rocks!

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp1] text-book forking code still producing zombies

2004-10-15 Thread Scot Martin
Hi Mark,

I don't know if this will help, but out of the
numerous ways I tried this is the only way I could
solve the zombie issue in MP2 on Solaris 8:

use POSIX 'WNOHANG';
use POSIX ":sys_wait_h";
my($kid);
do {
  $kid=waitpid(-1,WNOHANG);
} until $kid <= 0;

if(!(defined ($pid = fork(
{
   ...


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Embedding another webpage within a web page

2004-10-06 Thread Martin Moss
All,

I have an interesting issue. I'm in the process of
whitelabeling a website, but part of the process I
need to whitepabel is hosted by an outsourced company.


Rather than get the outsource company to change their
html, I would rather download and edit the html from
the outsourced website on the fly. 

I was thinking of writing a contentHandler which uses
LWP::Useragent etc.. to download from the outsourced
website. however I have only limited experience with
it.  Also, if the page I wish to download is itself a
form, how would I go about getting LWP to 'submit'
values etc...

Kind Regards

Marty





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Embedding another webpage within a web page

2004-10-07 Thread Martin Moss
Thanks guys, 

Marty


 --- Tom Schindl <[EMAIL PROTECTED]> wrote: 
> Martin Moss wrote:
> > All,
> > 
> > I have an interesting issue. I'm in the process of
> > whitelabeling a website, but part of the process I
> > need to whitepabel is hosted by an outsourced
> company.
> > 
> > 
> > Rather than get the outsource company to change
> their
> > html, I would rather download and edit the html
> from
> > the outsourced website on the fly. 
> > 
> > I was thinking of writing a contentHandler which
> uses
> > LWP::Useragent etc.. to download from the
> outsourced
> > website. however I have only limited experience
> with
> > it.  Also, if the page I wish to download is
> itself a
> > form, how would I go about getting LWP to 'submit'
> > values etc...
> > 
> 
> I hope you don't use this in production but this
> should work if I'm not 
> completely mistaken:
> 
> 8<
> package Fake::FormRequest;
> 
> use LWP::UserAgent();
> use Apache::Constants();
> 
> my $ua = LWP::UserAgent->new;
> 
> sub handler {
> my $r = shift;
> my $request;
> 
> if( $r->method_number() ==
> Apache::Constants::M_GET ) {
>   $request = HTTP::Request->new(GET => 
>
'http://bla.com/my.cgi?'.$r->args,&getHeaderAsArrayRef($r));
> } else {
>   $request = HTTP::Request->new(POST => 
>
'http://bla.com/my.cgi?',&getHeaderAsArrayRef($r),$->content);
> }
> 
> my $response = $ua->request($request);
> ## .
> }
> 
> sub getHeaderAsArrayRef {
> my $r = shift;
> my %headers = $r->headers_in();
> my @rv;
> 
> map { push @rv, [ $_, $headers{$_} ] } keys
> %headers;
> 
> return [EMAIL PROTECTED];
> }
> 8<
> 
> 
> > Kind Regards
> > 
> > Marty
> > 
> > 
> > 
> > 
> > 
> >
>
___ALL-NEW
> Yahoo! Messenger - all new features - even more fun!
>  http://uk.messenger.yahoo.com
> > 
> 
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] & Apache2: undefined symbol: PL_localizing

2004-10-21 Thread MARTIN Pierre
Hello here to everybody who helped me when i was in troubles...

I write this just to tell you where i am now, i hope it will help you to
understand something new in the "linker" (???) subject.

So, my problem was, that i was unable to compile modperl 2 with apache 2.
Not exactly will you say, i was able to compile it, but apache was unable to
start and load the module, due to an apparent "linker" broken problem.

So, i tryed the following:

* I uninstalled perl 5 with a dpkg FORCE stuff, to make sure nothing else
will be missing.
* I compiled my own Perl 5 release, and installed it... Had make some few
symlinks, and

MODPERL was able to WORK!!!

I was happy. Really happy.
BUT...

I have also a customized qmail installation (i am less a newbee with qmail
than with mod_perl). And in this customized qmail install, i was having a
Perl script, which role was to replace the "queue" function of my mail
server (e.g. scanning for viruses, spam, etc before delivering mail).
Here was the big problem. This script began to bug a lot (I saw in the logs
that some subroutines was missing for example...). Guys i know you are
mod_perl specialist, understand here i am just telling you EVERYTHING to
make you able to understand stuffs i didnt understand :)...

Then i tryed to apt-get dist-upgrade (From Woody to Sarge). Worked
perfectly, 23 packages all new freshed, but nothing solved with perl.

You know, i am a sort of psycho, i cant sleep knowing some of my computer is
a mess... I am a kind of maniac, i like to know everything happening inside
of my computers :) So i get rid of my Debian. Formatted my HDD, ZAP!
Installed Debianagain without ANY packages, directly updated to Sarge, and
then installed apache qmail mysql openssl etc...

Now, i just finished installing mod perl and it is working. I just had some
tricks to do, while compiling mod_perl it told me stuff like 'Your
installation is made against libgdbm' (i dont remember exactly sorry) so i
had to symlink some .so to others.

The point here is that everything is just FINE now!!!

My explanation:
As i told you, i am sort of newbee to most stuffs under Linux. I think i had
made a mistake somewhere unfindable in my old DEBIAN installation, so the
mod_perl problem was maybe my fault. But i understood few stuffs when i was
trying to solve the problem, before formatting and installing:
I uninstalled Perl and mod_perl linked properly. So you were right guys, the
linker was maybe broken, due to an improper perl installation. My mistake
was that i removed perl, and so everything which has been previously
configured with default perl version was broken and unable to work with the
new perl installation i made...

Anyway, i am really happy that everything is working now!!!

Thank you a lot!
Pierre

P.S.: Due to my *bad* english, i bet you didnt understand anything i
wrote... I will not think you are rude if you ask me for some more
explanations :) Dont hesitate if you have a new idea which can help others i
stay tunned to mailing list :)



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: [mp2] Large (>11584 bytes) requests truncated

2004-10-21 Thread Scot Martin

--- Stas Bekman <[EMAIL PROTECTED]> wrote:

> Scot Martin wrote:
> > Apache 2.0.52   mod_perl 1.99_16   Perl 5.8.5  
> > OpenSSL 0.9.7d   Solaris 8
> > 

> > 
> > The problem I'm having is that my largest request
> is
> > 349024 bytes and when I send it (using Perl 5.8.5
> > w/libwww) I can see the first 11584 bytes come in
> > (using truss), but then nothing further.  
> > 

> > 
> > I tried various ways of reading data from the
> client
> > and ended up using the Bucket Brigade approach so
> I
> > can see everything as it comes through the front
> door,
> > all to no avail.
> > 


> 
> Scot, please run with the IO tracing to see what
> exactly happens behind 
> the scenese and what goes wrong. This is
> accomplished with:
> PerlTrace o
>
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_

Stas,  This helped point to the problem, thank you
very much.  After the request was populated into $r,
but before doing anything with it, I was, for reasons
I can't think of now, sending the xml header, then
reading the request, then printing the reply.  This
all worked fine until I had a large request, then this
is what I see with I/O tracing:

mpxs_Apache__RequestRec_print: 39 bytes []
mpxs_Apache__RequestRec_print: (flush) 39 bytes []
modperl_request_read: wanted 348402b, read 11584b
[http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Apache::DBI, Postgresql, and transactions

2004-10-27 Thread Martin Moss
Heyho,

I spent ages trying to track down a mysql/Apache::DBI
bug, and whilst I'm not sure what's going wrong with
your system, I found it useful to add the PID of the
individual mysql process (not sure if you can do this
with postgresql) to the $dbh and then implement a
error handler which logs the pid. Then (again not sure
if you can do this in postgres) trace that pid to a DB
log file. in mysql you can get the last run command of
that PID, and then see if something is amiss on the DB
end...

Anyway here's a quick brain dump, you'll probably have
to tailor this to your needs..


Regards

Marty


something like this:-

my $dbh;

my %attrs=();
$attrs{RaiseError}=1;

if ($DBI::VERSION >= 1.21)
{
  #cos old DBI doesn't support this and we had
many versions running
  #cluck ("Adding ErrorHandler as DBI (version
$DBI::VERSION) Supports this method\n");
  $attrs{HandleError}=\&DBIErrorHandler;
}
else
{
  #cluck ("Not Adding ErrorHandler Support as DBI
version ($DBI::VERSION) Does not support this
method\n")
;
}

eval
{
$dbh = DBI->connect(
$dsn,
$db_user,
$db_password,
\%attrs
);
}; #because our bug was in the connect, you may
not need this

my $c_id;
eval
{
  my $stm_id = qq{SELECT connection_id()};
  ($c_id) = $dbh->selectrow_array($stm_id);
};

if ($@)
{
  #Probably older version of mysql, ignore
  $c_id='UNKNOWN - PROBABLY AN OLD DB Server';
}

$dbh->{private_MY_HASH}->{connection_id}=$c_id;



sub DBIErrorHandler
{
  my $sql = shift;
  my $sth = shift;
  my $value = shift;

  my $dbh;
  my $ref=ref($sth);

  print STDERR "In DBIErrorHandler\n";
  print STDERR "Incoming handle is '$ref'\n";
  print STDERR Dumper(@_)."\n";

  if ($ref =~ /DBI::st$/)
  {
#print STDERR "IS a STH\n";
$dbh=$sth->{Database};
  }
  elsif($ref =~ /DBI::db$/)
  {
#print STDERR "IS a DBH\n";
$dbh=$sth;
  }
  else
  {
print STDERR "Unable to Determine db/sth from ".
Dumper($sth);
$dbh=$sth;
  }

  if (ref($dbh) eq 'HASH')
  {
print STDERR "\nConnection ID is
'".$dbh->{private_MY_HASH}->{connection_id}."'\n";
  }
  else
  {
print STDERR '\nConnection ID cannot be
established, $dbh is not a hashref';
  }

  return 0; #Return false so RaiseError is now
executed

}



 --- Joe Thomas <[EMAIL PROTECTED]> wrote: 
> Brian Dimeler wrote:
> 
> > So anyway, I recompiled mod_perl to ensure these
> kinds of handlers 
> > were enabled, restarted the server with
> $Apache::DBI::DEBUG set to 2, 
> > and sure enough, I started getting debug messages
> about rollbacks 
> > after each script finished executing. Problem is..
> they stopped, after 
> > awhile. Mysteriously, about an hour after
> restarting, the cleanup 
> > handlers either aren't running or aren't printing
> debug info anymore, 
> > and the 'transaction aborted' errors are back.
> Does anyone know what 
> > could cause this, or how I could better diagnose
> my system?
> 
> Do you ever connect to a different database from
> your mod_perl scripts 
> -- or to the same database with different options? 
> Or even use a 
> different form for the database hostname (hostname
> only vs. 
> fully-qualified domain name)?
> 
> If you do, please try this patch (inline and
> attached) against the 
> current Apache::DBI.  I believe it fixes a bug in
> rolling back 
> transactions when more than one database handle is
> used.
> 
> Joe
> 
> --- DBI.pm.orig Tue Feb 17 16:18:50 2004
> +++ DBI.pm  Tue Aug 31 14:48:58 2004
> @@ -21,7 +21,6 @@
>  my %Rollback; # keeps track of pushed
> PerlCleanupHandler which can 
> do a rollback after the request has finished
>  my %PingTimeOut;  # stores the timeout values per
> data_source, a 
> negative value de-activates ping, default = 0
>  my %LastPingTime; # keeps track of last ping per
> data_source
> -my $Idx;  # key of %Connected and
> %Rollback.
>  
>  
>  # supposed to be called in a startup script.
> @@ -67,7 +66,7 @@
>  my $dsn= "dbi:$drh->{Name}:$args[0]";
>  my $prefix = "$$ Apache::DBI";
>  
> -$Idx = join $;, $args[0], $args[1], $args[2];
> +my $Idx = join $;, $args[0], $args[1],
> $args[2];  # key of 
> %Connected and %Rollback.
>  
>  # the hash-reference differs between calls even
> in the same
>  # process, so de-reference the hash-reference
> @@ -96,7 +95,7 @@
>  # TODO - Fix mod_perl 2.0 here
>  if(!$Rollback{$Idx} and $needCleanup and 
> Apache->can('push_handlers')) {
>  print STDERR "$prefix push
> PerlCleanupHandler \n" if 
> $Apache::DBI::DEBUG > 1;
> -Apache->push_handlers("PerlCleanupHandler",
> \&cleanup);
> +Apache->push_handlers("PerlCleanupHandler",
> sub { cleanup($Idx) });
>  # make sure, that the rollback is called
> only once for every
>  # request, even if the script calls connect
> more than once
>  $Rollback{$Idx} = 1;
> @@ -1

Re: Request methods not found

2004-11-02 Thread Martin Moss
Hi Marina,

Can you post a bit of your http.conf which declares
your AuthHandler's usage?

Are you saying:-

PerlAuthHandler Our::Auth->authen_handler
or
PerlAuthHandler Our::Authen::authenhandler

I ran some code across SuSe and Redhat and noticed
different behviours for using "->".

If you use "->" I think that this is interpreted as a
'method handler' and as such the first argument to
your authen_handler subroutine would be your classname
(Our::Auth) and the second argument would be the $r
(Apache->request).

Can you add this to your code:-

> package Our::Auth;
> use strict;
> use Apache;
> use Apache::Constants qw(:common);
> 
use Data::Dumper;
> use mod_perl ();
> 
> sub authen_handler {
> 
  print STDERR Dumper(@_); #lets see what you
got passed
> my $r = shift;
> 
> my ($res, $sent_pw) = $r->get_basic_auth_pw;
> 
> return $res if $res != OK;
> 
> my $user = $r->connection->user;
> if (!$user || !$sent_pw) {
> return AUTH_REQUIRED;
> }
> return OK;
> }
>   1;


I suspect that you will see 2 variables passed into
you subroutine 
1 = 'Our::Auth'
2 = instantiated Apache object

However I did have a skinful last night and my brain
is a little sluggish, so I could be wrong...(anybody
feel free to correct me)

Marty


 --- Marina Markus <[EMAIL PROTECTED]> wrote: 
> 
> Hello Geoffrey, 
> 
> Thank you for your answer; but I have to ask you for
> more help 
> as I neither use a pre-build version nor work with
> subclassing.
> The handler code is very simple:
> 
> package Our::Auth;
> use strict;
> use Apache;
> use Apache::Constants qw(:common);
> 
> use mod_perl ();
> 
> sub authen_handler {
> 
> my $r = shift;
> 
> my ($res, $sent_pw) = $r->get_basic_auth_pw;
> 
> return $res if $res != OK;
> 
> my $user = $r->connection->user;
> if (!$user || !$sent_pw) {
> return AUTH_REQUIRED;
> }
> return OK;
> }
>   1;
> 
> This code works OK in RedHat but cannot find
> "get_basic_auth_pw" in SGI.
> Still, my feeling is that that something simple but
> imporant is omitted
> in the code.
> 
> > that's right.  are you rolling your own on SGI or
> using a pre-compiled
> > package?  if the package is pre-compliled you
> might want to make sure that
> > it's mod_perl 1.2X and not mod_perl 1.99_XX, which
> is the precursor to
> > mod_perl 2.0 and a completely different beast.
> 
> I didn't use pre-compiled package but built it from
> source (Apache 1.3.31+
> PHP 4.3.8 + mod_perl 1.29). 
> 
> Maybe the following can be important: compilation is
> 32-bit
> (with "-o32" flag), otherwise Apache build complains
> of incompatible
> libraries. In fact, I had to configure mod_perl
> using a Shell-script:
> 
> #!/bin/sh
> CC="cc -o32" \
> perl Makefile.PL PERL_LOG=1 PERL_CHILD_INIT=1 \
> PERL_AUTHEN=1 PERL_ACCESS=1 PERL_AUTHZ=1 \
> PERL_CLEANUP=1 PERL_STACKED_HANDLERS=1 \
> USE_APACI=1 APACI_ARGS='--with-layout=Apache
> --prefix=/apache
> --activate-module=src/modules/php4/libphp4.a'
> 
> Still, there were no error messages concerning
> 32-to-64 incompatibility,
> so it may be not relevant. 
> 
> > well, that message says that it can't find
> get_basic_auth_pw() via
> > Our::Auth.  it should be looking for it via the
> Apache class, not
> > Our::Auth.  
> 
> What checks can I do to see if Apache class is seen
> by mod_perl?
> 
> Thank you,
> 
> Marina Markus
> [EMAIL PROTECTED]
> 
> 
> On Mon, 1 Nov 2004, Geoffrey Young wrote:
> 
> > 
> > 
> > Marina Markus wrote:
> > > Hello,
> > >  
> > > With Geoffrey Young's generous help I have
> successfully implemented
> > > authentication using my own handler subroutine
> defined as PerlAuthenHandler.
> > 
> > :)
> > 
> > 
> > > This works OK in RedHat but not on SGI (IRIX
> 6.2). Call to the handler fails
> > > complaining that it cannot find request object
> methods, be it "connection"
> > > or "get_basic_auth_pw", saying, for example:
> > >  
> > > [Mon Nov  1 12:54:13 2004] [error] Can't locate
> object method
> > > "get_basic_auth_pw" via package "Our::Auth" at
> > > /usr/local/lib/perl5/site_perl/5.005/Our/Auth.pm
> line 16,  chunk
> > > 225.\n
> > 
> > well, that message says that it can't find
> get_basic_auth_pw() via
> > Our::Auth.  it should be looking for it via the
> Apache class, not Our::Auth.
> >  if you're looking for it via $r blessed into
> Our::Auth you need to make
> > sure that you're doing subclassing properly for
> mod_perl (which is a bit
> > different than normal perl subclasses).  see
> > 
> >  
>
http://www.modperlcookbook.org/code/ch10/Cookbook/Apache.pm
> > 
> > for an example.
> > 
> > if you're not trying any subclassing tricks then
> something is definitely
> > amuck - $r should be an 'Apache' object (or
> 'Apache::RequestRec' in mp2)
> > when you call $r->note_basio_auth_pw.
> > 
> > >  
> > > These methods should come with the installation
> of mod_perl, shouldn't they?
> > 

RE: Request methods not found

2004-11-02 Thread Martin Moss
Having Just re-read your reply, (don't ask, waiting
for a machine sync to finish, bored...!) I noticed
that you said you didn't get an apache Object at all.

This is behaviour I've seen myself, and I never got a
decent understanding of why it happens?

So does anybody know under what circumstances it's
possible to NOT get an Apache object passed into your
handler subroutine?

Does this happen when a subrequest occurs?

Regards

Marty

 --- Marina Markus <[EMAIL PROTECTED]> wrote: 
> Hello and many thanks to Martin and Geoffrey,
> 
> Martin was right - using "Dump" revealed that only
> "Our::Auth" was passed as
> an input variable (and the request was not passed at
> all). After I changed
> "PerlAuthenHandler Our::Auth->authen_handler" to
> "PerlAuthenHandler
> Our::Auth::authen_handler", the handler started to
> get the request as the
> first variable. 
> 
> If Martin can give such exact advices after a bad
> night, I ask what wonders
> he can do when he is OK :)
> 
> Thanks a lot to Geoffrey for Apache-Test, it looks
> very helpful.
> -Marina
> 
> -Original Message-
> From: Geoffrey Young
> [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 02, 2004 3:09 PM
> To: Marina Markus
> Cc: [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: Re: Request methods not found
> 
> 
> > This code works OK in RedHat but cannot find
> "get_basic_auth_pw" in SGI.
> > Still, my feeling is that that something simple
> but imporant is omitted
> > in the code.
> 
> no, the code looks fine.  the issue isn't that
> get_basic_auth_pw() can't
> generally be found, but that $r isn't an Apache
> object, so your code is
> looking in the wrong place.  and you could be
> looking in the wrong place
> through no fault of your code at all - as martin
> suggested, you are probably
> using method handlers without knowing it.
> 
> besides the (good) advice that martin gave in his
> post, a really, really
> good way to track this down would be to use
> Apache-Test.  not that you are
> required to do this, but if you're interested in
> spending the up-front time
> to learn something new that will save you _lots_ of
> time in the future, give
> this a whirl...
> 
> first, install Apache-Test from CPAN:
> 
>   http://search.cpan.org/dist/Apache-Test/
> 
> then download this sample tarball:
> 
>  
>
http://perl.apache.org/~geoff/Apache-Test-skeleton-mp1.tar.gz
> 
> and tweak the distribution so that your handler is
> activated (follow the
> README to get started).  then try this:
> 
>   $ perl Makefile.PL -httpd
> /path/to/your/apache/bin/httpd
>   $ make
>   $ t/TEST -conf
>   $ t/TEST -start
> 
> and you can use your browser (or lynx or whatever)
> to hit
> http://localhost:8529/ and see your handler in
> action.  you could also take
> the time to tweak bug.t to act as a client for you.
> 
> the benefit here is that you now have a pristine
> environment with nothing
> attached to it except the code in question, and you
> can roll up your code
> (via make dist) and try it on different boxes.  you
> can even post a link to
> the tarball you have made for developers here to
> try, which would save
> iterations of 'what's the code? what's the
> configuration?" and so on.
> 
> now, if you don't do all of that, never fear - we're
> still here to help :)
> but it's something to keep in mind as you go forward
> with mod_perl related
> things.  Apache-Test is a wonderful development
> tool, so taking the time to
> get familiar with it will reap many, many benefits
> in the long term.
> 
> >>well, that message says that it can't find
> get_basic_auth_pw() via
> >>Our::Auth.  it should be looking for it via the
> Apache class, not
> >>Our::Auth.  
> > 
> > 
> > What checks can I do to see if Apache class is
> seen by mod_perl?
> 
> it is, or the 'use Apache' call would die.
> 
> HTH
> 
> --Geoff
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Protecting against Cookie copying

2004-11-08 Thread Martin Moss
All,

I'm looking into ways of uniquely identifying a
computer. I've been reading around the web looking at
different mechanisms, and so far I've drawn a fuzzy
blank. Currently, I want to use SSL to let a user sign
in and then I return a session cookie, which I then
use to confirm the user is logged in when they come to
non-ssl pages. 

What I wish to do is prevent another user copying the
session cookie, from one computer to another, and then
gaining access. Originally I wondered if I could get
at the mac address of the connection, but that seems
to be a dead end. After a little further reading It
seems that there is a UUID generated at the handshake?
stage of SSL, so therefore I wonder if I can use this,
e.g. map my session_id to a UUID, and then when I
check the session is valid I crosscheck this, however
I'm not sure if I can get the UUID over a non-SSL
connection. 

I'm sure I'm not the first person to want to uniquely
identify a computer that comes to my site, without
blindly trusting cookies, but I'm at a loss of how to
find anything better than ipaddress to session cookie
mapping. (which is kinda pointless for Natted
addresses I know).

Does anybody have any ideas, pointers...?

Regards

Marty







___ALL-NEW Yahoo! 
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Protecting against Cookie copying

2004-11-08 Thread Martin Moss
Thanks everyone. You've done a good job of assuring me
that I haven't missed the whole point of the way these
things work. 

There's been some really useful ideas, suggested and
I'm going to have a think about which, if any, are
worth implementing.

Ultimitely I'm upgrading our site from normal Basic
authentication, which sends username and password
unencrypted anyway, so compared to that the security
upgrade is still a big increase!

Marty





 --- Sam Tregar <[EMAIL PROTECTED]> wrote: 
> On Mon, 8 Nov 2004, Martin Moss wrote:
> 
> > I'm looking into ways of uniquely identifying a
> > computer.
> 
> Intel tried to implement this a while back with a
> unique ID in the
> CPU.  The public was not ammused.  If you do find a
> way, please tell
> us so we can find a workaround.
> 
> > What I wish to do is prevent another user copying
> the
> > session cookie, from one computer to another, and
> then
> > gaining access.
> 
> You can get close by using a very short session
> timeout, tying the IP
> to the cookie and putting a serial number on each
> form.  I believe
> this is what my bank does.  Sure, the IP can be
> spoofed or shared, and
> hackers can automate systems to defeat the timeouts
> and serial
> numbers, but it definitely raises the bar.  As an
> added bonus, the
> serial numbers also help with the ubiquitous
> catastrophe which is the
> back button.
> 
> -sam
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ALL-NEW Yahoo! 
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Authentication using https

2004-11-10 Thread Martin Moss
All,

I'm about to replace the authentication mechanism that
our web site uses. However I wanted to sanity check my
thought process. 

Is it possible to have an Authen handler sitting on
certain areas of a site, and if a user isn't logged in
(i.e. doesn't have an auth session cookie) we present
them with a form. (I can do this, but the next bit is
new to me). Then when they send their details, i.e.
username and password, they go over an SSL connection,
which provided they are correct, then shows the page
the user originally wanted? 

Basically I have a mechanism working that does this
without the SSL, but can I update it to use an SSL
connection for the login form submit?

Marty





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Authentication using https

2004-11-12 Thread Martin Moss
Cheers Fellas, this was the bit I was concerned about.

Apache::AuthCookie, looked a little bloated to me,
however I'm a big fan of only inventying new types of
wheels not old so I'll revisit...

Regards

Marty


 --- Michael J Schout <[EMAIL PROTECTED]> wrote: 
> On Wed, 10 Nov 2004, Skylos wrote:
> 
> > it could go...
> >
> > -> GET content from myserver port 80
> > <- 403 errordocument login form
> > -> POST credentials to myserver port 443
> > <- Location http://myserver/content
> > <- Set-Cookie: ticket=gooduser; Domain=myserver;
> Path=content;
> > -> GET content from myserver port 80
> > <- 403 errordocument login form
> >
> > And the question would be... Why would the browser
> say GET without the
> > cookie attached?
> >
> > It could be... because it didn't get the cookie
> from myserver:80 - it
> > got it from myserver:443 - and the security
> settings of the browser
> > say, 'enable only for the originating web server'
> 
> The port numbers do not matter at all.  There are a
> number of things you
> need to be aware of for cookies to work properly in
> this scenario.
> 
> - If you want the cookie to be presented over
> non-SSL connections, you
>need to make sure that AuthNameSecure is not
> turned on in AuthCookie.
>The "Secure" setting tells the browser to only
> send the cookie over
>SSL connections.
> 
> - If your using MSIE, you also need to properly
> create a P3P policy,
>otherwise MSIE might not return the cookie
> (depending on security
>settings).  The way you create a P3P policy is
> beyond the scope of
>this email.  In AuthCookie you can do this with
> something like:
> 
>PerlSetVar AuthNameP3P "CP=\"ALL DSP ...\""
> 
>but you need to read up on P3P to know what the
> value should be.
> 
> But there is no problem issuing cookies on HTTPS and
> having the browser
> return them over non SSL provided that the "Domain"
> paramter of the
> cookie is properly set, and the "Secure" setting is
> turned off.
> 
> Regards,
> Michael Schout
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ 
Moving house? Beach bar in Thailand? New Wardrobe? Win 10k with Yahoo! Mail to 
make your dream a reality. 
Get Yahoo! Mail http://uk.mail.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Urgent justification for perl

2004-11-19 Thread Martin Moss
All,

I've had an urgent request for a few paragraphs on the
justification for the use of perl. In particularly
mod_perl.

Someone in the powers that be read an outdated
description and thinks that using perl is a security
risk - (I know, its not what you use, but how you use
it thats the security concern). 

Any ideas?

Marty



___ 
Moving house? Beach bar in Thailand? New Wardrobe? Win £10k with Yahoo! Mail to 
make your dream a reality. 
Get Yahoo! Mail www.yahoo.co.uk/10k

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: Urgent justification for perl

2004-11-22 Thread Martin Moss
Big thanks to everyone for the links and tips.

Sorry for the ambiguous question, but was just passing
on the ambiguity, to see which way you guys took it,
as I was also annoyed at the ridiculousness of the
question...

Kind regards

Marty

 --- Matt Sergeant <[EMAIL PROTECTED]> wrote: 
> On 19 Nov 2004, at 12:35, Martin Moss wrote:
> 
> > I've had an urgent request for a few paragraphs on
> the
> > justification for the use of perl. In particularly
> > mod_perl.
> >
> > Someone in the powers that be read an outdated
> > description and thinks that using perl is a
> security
> > risk - (I know, its not what you use, but how you
> use
> > it thats the security concern).
> >
> > Any ideas?
> 
> We're a global security company. We scan email for
> spam and viruses for 
> some places you may have heard of, like the UK
> government and the US 
> Federal Reserve. About 50% of everything we do is in
> perl (including 
> mod_perl/AxKit for our quarantine system). We're
> also BS/ISO-7799 if 
> that's the sort of thing your powers that be need to
> hear.
> 
> Does that help?
> 
> Matt.
> 
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  



___ 
Moving house? Beach bar in Thailand? New Wardrobe? Win £10k with Yahoo! Mail to 
make your dream a reality. 
Get Yahoo! Mail www.yahoo.co.uk/10k

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



[mp2] Problem with forking cleanup in high request rate server

2003-09-22 Thread Scot Martin
mp1.99.10-devApache 2.0.47Solaris 8I'm building a single-purpose, high-performance, multi-threaded  application server using the above and have run into problems with forking and cleanup of old httpd instances.  Yes, I have to fork and exec as I have to call some legacy C code and then set up comms between the exec'd process and Apache.My first problem comes when loading the server heavily I occasionally see an instance that forked properly, but the child never wakes up and runs.  I only see this behavior when pushing 10 or so requests per second at the server.  There's probably 3 per minute of these so it's a real needle in a haystack. Any thoughts on how to prevent this and/or kill the errant kid?The second problem is after a half hour or so of slamming requests at an Apache instance, the kid hangs.  The parent proc does the right thing and
 starts another kid but since the first kid is hung, my reaper doesn't do its job and I end up with a bunch of zombies until I slay the kid.  I've tried setting MaxRequestsPerChild to various values but that doesn't help - in fact, it doesn't seem to do anything.  Am I missing something?  Lastly, cleanup_for_exec() doesn't seem to work - with tracing on I can see that we get into APR::Pool but the return status is always zero.  I've tried $r->APR::Pool::cleanup_for_exec() and a bald &APR::Pool::cleanup_for_exec().Here's a code snippet:    if(!(defined ($pid = fork(    {     return(&RELPERL::appmgr_env::ivruapperr "APP_FORK_ERR","error forking: $!"));   
 }    if($pid)    {#   print STDERR ("Parent pid $$ finished, kid's pid: $pid\n");    }    else    {    if(!(&APR::Pool::cleanup_for_exec()))    {    print STDERR ("cleanup_for_exec failed: $!\n");   
 }    # Close filehandles inherited from parent    close($tmpserver) or &crit_exit();    close(STDIN) or &crit_exit();  	.   		. 		. 		exec ...   	}What am I doing wrong here?By the way, I've seen a few people ask about how to do zombie cleanup.  I tried all sorts of ways and the only way I found to work on Sol 8 was this:	use POSIX 'WNOHANG';	use POSIX ":sys_wait_h";	my($kid);do {  $kid=waitpid(-1,WNOHANG);} until $kid <= 0;
	if(!(defined ($pid = fork(	{		...Thanks,Scot

Re: [mp2] Problem with forking cleanup in high request rate server

2003-09-23 Thread Scot Martin
Thanks for the reply.  I'd figured out earlier today that I probably should be using Apache::SubProcess so it's good to see confirmation.  A few lines of code replaced 50+.  It's a good thing.
 
When spawn_proc_prog() is called I get a segfault in strrchr when modperl_spawn_proc_prog calls ap_make_dirstr_parent, which then calls strrchr.  Unfortunately, my Perl 5.8 and Apache are not compiled with debugging on so I'm recompiling all now.  More later
 
Understand re: cleanup_for_exec
 
I read the Avoiding Zombies section and $SIG{CHLD} = 'IGNORE' didn't work for me.  I realize that I didn't try the waitpid() example after the fork.Stas Bekman <[EMAIL PROTECTED]> wrote:

Scot Martin wrote:> mp1.99.10-dev Apache 2.0.47 Solaris 8> > I'm building a single-purpose, high-performance, multi-threaded application> server using the above and have run into problems with forking and cleanup> of old httpd instances. Yes, I have to fork and exec as I have to call> some legacy C code and then set up comms between the exec'd process and> Apache.> > > My first problem comes when loading the server heavily I occasionally see > an instance that forked properly, but the child never wakes up and runs. 


See if using Apache::SubProcess helps.> Lastly, cleanup_for_exec() doesn't seem to work - with tracing on I can see> that we get into APR::Pool but the return status is always zero. I've > tried $r->APR::Pool::cleanup_for_exec() and a bald > &APR::Pool::cleanup_for_exec().[...]There is no $r->cleanup_for_exec() in mp2, there isAPR::Pool::cleanup_for_exec(), which accepts no arguments, returns no resultand does:


Re: [mp2] Problem with forking cleanup in high request rate server

2003-09-24 Thread Scot Martin
Stas Bekman wrote:

>> When spawn_proc_prog() is called I get a segfault in strrchr when 
>> modperl_spawn_proc_prog calls ap_make_dirstr_parent, which then 
calls
>> strrchr. Unfortunately, my Perl 5.8 and Apache are not compiled with 
>> debugging on so I'm recompiling all now. More later 
> 
> Ouch, a simple test case would be useful and hopefully I'll be able 
to 
> reproduce it. As I mentioned there are only some very basic tests in 
> t/apache/subprocess.t & t/response/TestApache/subprocess.pm, if you 
can add 
> more tests that would be great. 

Okay - test case and resulting stack traces below.  My Apache executible
only includes a few modules as I'm trying to wring the last ounce of 
performance out of it, so it fails most of the canned test cases.  The 
modules I have are:  core.c  mod_log_config.c  mod_ssl.c  worker.c
http_core.c  mod_status.c  mod_cgid.c  mod_alias.c and  mod_so.c

>
>> Understand re: cleanup_for_exec 
>> 
>> I read the Avoiding Zombies section and $SIG{CHLD} = 'IGNORE' didn't 
work 
>> for me. I realize that I didn't try the waitpid() example after the 
fork. 
>
> I suppose this varies from OS to OS :( 
>
> Was your suggestion different from the one in the guide?

Yes - it's the only one I could get to work w/ Solaris 8.  It seems to 
be the 
POSIX options that do it.  Also, my version will find any child and 
reap if 
ready, whereas the guide will only collect the specified pid.  I'm 
doing a fork 
and exec, then the exec'd process hangs around for 1-10 minutes so I 
have 
to be able to reap anything that needs reaping.


Here is my simple test case:

package RELPERL::MyFork;

use strict;
use warnings;

use Apache::SubProcess ();

sub handler {
my $r = shift;

$r->content_type('text/plain');

my($cmd)="/bin/ls";
my(@args)= qw(/etc /);
my($out_fh) = 
Apache::SubProcess::spawn_proc_prog($r,$cmd,[EMAIL PROTECTED]);
my($appout) = &read_data($out_fh);

return Apache::OK;
}

sub read_data
{
my($fh)[EMAIL PROTECTED];
my($data);
$data = ""
return defined $data ? $data : '';
}
1;


I ran this test case against Apache 2.0.47 / Perl 5.8.0 / modperl 
1.99.10-dev 
(the 3 PM ish 20030923 version) all compiled under GCC 3.3 on Sol 2.8 
with 
CFLAGS of -g -O0.

Here's the stack trace.  Note that r->filename is null when 
ap_make_dirstr_parent() 
is called.  Also, *command is "/", which doesn't seem right, but ***argv of "/"
seems okay.  

When we get to line 51 in Apache__SubProcess.h - if 
(FAILED(apr_procattr_create(&procattr, p)) ||   
a next or step produces a segfault.


Breakpoint 1, modperl_spawn_proc_prog (my_perl=0x194b60, r=0x30fdc88, 
command=0x2a826c0 "/bin/ls", argv=0xfdd09250, script_in=0xfdd09260, 
script_out=0xfdd0925c, script_err=0xfdd09258)
at 
/export/debugger-O0/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h:39
(gdb) p *r
$9 = {pool = 0x30fdc50, connection = 0x30f3d48, server = 0x115260, next 
= 0x0, 
  prev = 0x0, main = 0x0, the_request = 0x30fea90 "GET /test/myfork 
HTTP/1.1", 
  assbackwards = 0, proxyreq = 0, header_only = 0, 
  protocol = 0x30feb18 "HTTP/1.1", proto_num = 1001, 
  hostname = 0x30ff258 "sfivrapp02.telebank.foo.com", 
  request_time = 1064437591906258, status_line = 0x0, status = 200, 
  method = 0x30feae0 "GET", method_number = 0, allowed = 0, 
  allowed_xmethods = 0x0, allowed_methods = 0x30fde10, sent_bodyct = 0, 
  bytes_sent = 0, mtime = 0, chunked = 0, range = 0x0, clength = 0, 
  remaining = 0, read_length = 0, read_body = 0, read_chunked = 0, 
  expecting_100 = 0, headers_in = 0x30fde40, headers_out = 0x30fe2d0, 
  err_headers_out = 0x30fe478, subprocess_env = 0x30fe088, notes = 
0x30fe5d0, 
  content_type = 0x3101dc8 "text/plain", handler = 0x14b5a0 "modperl", 
  content_encoding = 0x0, content_languages = 0x0, vlist_validator = 
0x0, 
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0, 
  unparsed_uri = 0x30feaf8 "/test/myfork", uri = 0x30feb08 
"/test/myfork", 
  filename = 0x0, canonical_filename = 0x0, path_info = 0x0, args = 
0x0, 
  finfo = {pool = 0x0, valid = 0, protection = 0, filetype = 
APR_NOFILE, 
user = 0, group = 0, inode = 0, device = 0, nlink = 0, size = 0, 
csize = 0, atime = 0, mtime = 0, ctime = 0, fname = 0x0, name = 
0x0, 
filehand = 0x0}, parsed_uri = {scheme = 0x0, hostinfo = 0x0, user = 
0x0, 
password = 0x0, hostname = 0x0, port_str = 0x30ff288 "5", 
path = 0x30feb08 "/test/myfork", query = 0x0, fragment = 0x0, 
hostent = 0x0, port = 5, is_initialized = 1, dns_looked_up = 0, 
dns_resolved = 0}, used_path_info = 2, per_dir_config = 0x30ff308, 
  request_config = 0x30fe728, htaccess = 0x0, output_filters = 
0x30fea20, 
  input_filters = 0x30fe888, proto_output_filters = 0x30fea20, 
  proto_input_filters = 0x30fe888, eos_sent = 0}
(gdb) p *r->pool
$10 = {parent = 0x30f3c30, child = 0x0, sibling = 0x0, ref = 0x30f3c34, 
  cleanups = 0x30ff9b8, alloca

Re: [mp2] Problem with forking cleanup in high request rate server

2003-09-25 Thread Scot Martin
Sorry about the last post.  This one is definately
plain text.

The good news is that I've distilled the problem down
to a one line change in my httpd.conf file.  

With the following line, Apache drops a core when
spawn_proc_prog() is called:
   PerlTransHandler  Apache::OK 
The above line causes the testcase in
t/apache/subprocess.t to drop a core.
It looks like *r is considerably less populated with
the added line, which means $r->filename is null when
it gets passed to ap_make_dirstr_parent().

It would be nice to be able to use this as it gets rid
of a _whole bunch_ of calls to stat.  I'm trying to
wring the last ounce of performance out of the sucker.
 :)

I've included a trace of *r from inside of
modperl_spawn_proc_prog() with and without the
PerlTransHandler line.


Stas Bekman wrote:
>
>> Understand re: cleanup_for_exec 
>> 
>> I read the Avoiding Zombies section and $SIG{CHLD}
= 'IGNORE' didn't work 
>> for me. I realize that I didn't try the waitpid()
example after the fork. 
>
> I suppose this varies from OS to OS :( 
>
> Was your suggestion different from the one in the
guide?

Yes - it's the only one I could get to work w/ Solaris
8.  It seems to be the POSIX options that do it. Also,
my version will find any child and reap if ready,
whereas the guide will only collect the specified pid.
 I'm doing a fork and exec, then the exec'd process
hangs around for 1-10 minutes so I have to be able to
reap anything that needs reaping.


Here's a (bad) *r with PerlTransHandler in httpd.conf:

(gdb) p *r
$9 = {pool = 0x30fdc50, connection = 0x30f3d48, server
= 0x115260, next = 0x0, 
  prev = 0x0, main = 0x0, the_request = 0x30fea90 "GET
/test/myfork HTTP/1.1", 
  assbackwards = 0, proxyreq = 0, header_only = 0, 
  protocol = 0x30feb18 "HTTP/1.1", proto_num = 1001, 
  hostname = 0x30ff258 "sfivrapp02.telebank.foo.com", 
  request_time = 1064437591906258, status_line = 0x0,
status = 200, 
  method = 0x30feae0 "GET", method_number = 0, allowed
= 0, 
  allowed_xmethods = 0x0, allowed_methods = 0x30fde10,
sent_bodyct = 0, 
  bytes_sent = 0, mtime = 0, chunked = 0, range = 0x0,
clength = 0, 
  remaining = 0, read_length = 0, read_body = 0,
read_chunked = 0, 
  expecting_100 = 0, headers_in = 0x30fde40,
headers_out = 0x30fe2d0, 
  err_headers_out = 0x30fe478, subprocess_env =
0x30fe088, notes = 0x30fe5d0, 
  content_type = 0x3101dc8 "text/plain", handler =
0x14b5a0 "modperl", 
  content_encoding = 0x0, content_languages = 0x0,
vlist_validator = 0x0, 
  user = 0x0, ap_auth_type = 0x0, no_cache = 0,
no_local_copy = 0, 
  unparsed_uri = 0x30feaf8 "/test/myfork", uri =
0x30feb08 "/test/myfork", 
  filename = 0x0, canonical_filename = 0x0, path_info
= 0x0, args = 0x0, 
  finfo = {pool = 0x0, valid = 0, protection = 0,
filetype = APR_NOFILE, 
user = 0, group = 0, inode = 0, device = 0, nlink
= 0, size = 0, 
csize = 0, atime = 0, mtime = 0, ctime = 0, fname
= 0x0, name = 0x0, 
filehand = 0x0}, parsed_uri = {scheme = 0x0,
hostinfo = 0x0, user = 0x0, 
password = 0x0, hostname = 0x0, port_str =
0x30ff288 "5", 
path = 0x30feb08 "/test/myfork", query = 0x0,
fragment = 0x0, 
hostent = 0x0, port = 5, is_initialized = 1,
dns_looked_up = 0, 
dns_resolved = 0}, used_path_info = 2,
per_dir_config = 0x30ff308, 
  request_config = 0x30fe728, htaccess = 0x0,
output_filters = 0x30fea20, 
  input_filters = 0x30fe888, proto_output_filters =
0x30fea20, 
  proto_input_filters = 0x30fe888, eos_sent = 0}
(gdb) 


Here's a good one without PerlTransHandler:

(gdb) p *r
$1 = {pool = 0x312db38, connection = 0x3123c30, server
= 0x105a88, next = 0x0, 
  prev = 0x0, main = 0x0, the_request = 0x312e9b0 "GET
/test/myfork HTTP/1.1", 
  assbackwards = 0, proxyreq = 0, header_only = 0, 
  protocol = 0x312ea38 "HTTP/1.1", proto_num = 1001, 
  hostname = 0x312f178 "sfivrapp02.telebank.baz.com", 
  request_time = 1064521677613565, status_line = 0x0,
status = 200, 
  method = 0x312ea00 "GET", method_number = 0, allowed
= 0, 
  allowed_xmethods = 0x0, allowed_methods = 0x312dcf8,
sent_bodyct = 0, 
  bytes_sent = 0, mtime = 106160516200, chunked =
0, range = 0x0, 
  clength = 0, remaining = 0, read_length = 0,
read_body = 0, 
  read_chunked = 0, expecting_100 = 0, headers_in =
0x312dd28, 
  headers_out = 0x312e1b8, err_headers_out =
0x312e360, 
  subprocess_env = 0x312df70, notes = 0x312e4b8, 
  content_type = 0x3134038 "text/plain", handler =
0x175590 "modperl", 
  content_encoding = 0x0, content_languages = 0x0, 
  vlist_validator = 0x31300a0 "\"36929e80\"", user =
0x0, ap_auth_type = 0x0, 
  no_cache = 0, no_local_copy = 0, unparsed_uri =
0x312ea18 "/test/myfork", 
  uri = 0x312ea28 "/test/myfork", 
  filename = 0x312f920 "/ivruapp/htdocs.app/test", 
  canonical_filename = 0x312f920
"/ivruapp/htdocs.app/test", 
  path_info = 0x312f890 "/myfork", args = 0x0, finfo =
{pool = 0x312db38, 
valid = 7598448, protection = 1877, filetype =
APR_NOFILE, user = 500, 
group = 2057, inode = 50688, device = 30932997,
n

anchor tag

2003-11-01 Thread martin moss
Heyho,

If I have a url of http://some.domain.com/test/index.html#test

When I do a $r->uri I ge the url path /test/index.html
and $r->path_info is blank.

How do I get the #test anchor bit on the end of the url?

Regards

Marty




Re: ... and startup.pl equivalent?

2004-12-13 Thread Martin Moss
Hi Colin,

just my opinion, but from a 'practicalities' point of
view, as startup.pl gets more complex (your site grows
larger, you wish to do more intricate mod_perly
things), you will find that it is a distinct advantage
to run it from the command line in the debugger. you
wouldn't be able to do this if you buried all your
perl in the apache configs...

I'm sure there's many more reasons to keep your
startup script outside of the http configs, usually
it's because it's only neat and tidy to begin with
embedding your perl into your configs, but as your
site configs get larger, you'll probably start
thinking it a better idea to put all your 
sections in their own seperate httpd conf file, which
might as well be a startup.perl script..

Marty

 --- colin_e <[EMAIL PROTECTED]> wrote: 
> Platforms: Solaris 9, Win XP
> Apache: 2.0.52
> Perl: ActiveState Perl 5.8.4
> 
> Hi Guys,
> New to Apache 2.0.52 and modperl, working
> through the install and 
> configure steps.
> 
> Most books and docs on using modperl recommend using
> a "startup.pl" script
> to configure the Perl environment on startup,
> setting lib paths etc.  
> However, Apache now
> supports  ... sections directly in the
> Apache config files.
> 
> In a normal perl script, a chunk of code brought in
> with "require" is 
> exactly the same as a
> block inline within the the main routine.
> 
> Queastion- is this the same in Apache? I.e, instead
> of using a 
> startup.pl file can I include all the perl
> configuration inline in httpd.conf inside
>  blocks, with the 
> same effect? Logically
> it would seem so, but the apache docs also say
> variables in the  
> blocks go away after use,
> so it's unclear whether oeprations like "use lib
> " would have an effect.
> 
> Regards: Colin
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: HTML::Embperl + mod_perl + segfault

2004-12-15 Thread Martin Moss
I upgraded to the latest version of Embedperl and ran
the same code from my previous post. IT no longer
segfaults but I get the following error... 

Embperl::Execute({ 
 req_rec=>$r,
 inputfile=>$file,
 param =>[$params],
 output => \$html
 });


and I get the following error:-

Error in Perl code: Can't call method "headers_in" on
an undefined value at

Which is $req_rec.
It's undef.

I tried this without the req_rec=>$r too and it made
no difference.
Any ideas? Is it related to
http://www.gossamer-threads.com/lists/modperl/embperl/14815#14815

Regards

Marty

 --- Gerald Richter <[EMAIL PROTECTED]> wrote: 
> >I'm getting segfaults on every page request I make
> to a mod_perl handler
> thats running under >HTML::Embedperl. We're trying
> to migrate away from
> Embperl as fast as possible, but whenever >I call
> HTML::Embperl::Execute in
> my code more than 4 or 5 times I get seg
> faults..
> 
> 
> Embperl has no problems with mod_perl 1 and Perl
> 5.6. It seems like the
> versions you use are not fit together.
> 
> Make sure that Perl, mod_perl, Embperl and Apache
> are build with the same
> compiler and the same settings. 
> 
> Such problem will occur if you have compiled Embperl
> (or mod_perl) with
> differnet compiler settings or for a different Perl
> binary, than the one you
> are actually using.
> 
> Gerald
> 
> 
> -- 
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
> 
>  



___ 
Win a castle for NYE with your mates and Yahoo! Messenger 
http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



HTML::Embperl + mod_perl + segfault

2004-12-13 Thread Martin Moss
All,

I'm getting segfaults on every page request I make to
a mod_perl handler thats running under
HTML::Embedperl. We're trying to migrate away from
Embperl as fast as possible, but whenever I call
HTML::Embperl::Execute in my code more than 4 or 5
times I get seg faults..

perl 5.6, apache 1.3.33... 

I realise that this is one of those 'needle in a
haystack emails' but I was wondering if anybody has
any experience  running HTML::Embperl who may have
seen this sort of thing before.. I know that the code
I'm using doesn't segfault when I ran it on a
different machine - one I'd built myself and it was
running under perl 5.8.5.

[Mon Dec 13 18:25:16 2004] [notice] child pid 24141
exit signal Segmentation Fault (11)

We can't upgrade to perl 5.8 as some of the legacy
code we have just breaks - (think code written 5 years
ago, without the concept of use strict).

I've tried looking at the embedperl scripts that are
being called, and no matter which ones I comment
out,(remove possibility that it's some component
within the embperl thats causing it) it's always the
5th or 6th script being run that causes the segfault..

Marty





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: sessions:THANK YOU!

2005-01-06 Thread Martin Moss
I didn't get chance to reply, and the others covered
everything, but the point of Apache::Session is that
you don't need to store ANY data other than a
session_id in a hidden field or in a cookie... 

All of the rest of the data you need gets stored
locally on the server side. Much more secure.

Marty


 --- [EMAIL PROTECTED] wrote: 
> Thank you all who replied to my session state
> question.
> 
> Well it doesn't really bother me that I store data
> in cookies or hidden
> fields, but I want the best, fastest, and slickest
> solution I can create.
> And always keen to learn new stuff, and I want to
> improve my coding all
> the time, that's why I asked.
> 
> And to Sean special thank's, your code's gonna be
> useful. *S*
> 
> :-)
> 
> over and out.
> Greger
> --
> http://www.gh-webinteractive.com
> 
> 
> 
> 
> 
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: Apache::DBI

2005-01-09 Thread Martin Moss
> > Is PerlSetVar the best way to pass values from
> httpd.conf to perl
> > securely?
> 
> It's a good way, although there are plenty of
> others.  I use a separate
> config file usually.
> 

For what it's worth I use both. I keep 'site wide'
configuration vales in a Config file/module (usually
Backend DB access modules) and then 'location
specific' values in PerlSetVar's in each 
I find this the most adaptable and maintainable.

regards,

Marty





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: Overriding PerlAuthenHandler in sub-directories

2005-01-10 Thread Martin Moss
I was looking into this a while back, and came across
several posts that described using a PerlAccessHandler
to determine if PerlAuthenHandler should be set or
not.

You could then setup PerlSetVar Require_Auth '0' in
any sublocations that didn't need Auth. your
AccessHandler would then do a set-handlers call and
get it to return OK for an AuthHandler (I've tried to
dig out the syntax but I can't find it)..

I tried it briefly and couldn't get it to work at all,
but I got the impression that this was down to the
really quirky setup I was trying to do it on.

Anyway not much help, but perhaps give you something
to search google on,

Marty

 --- Ferrari Geoffrey
<[EMAIL PROTECTED]> wrote: 
> Hi Sean,
> 
> adding a .htaccess file might help, but I'm looking
> to see if there 
> isn't a better solution. The main problem is that
> /foo/bar will 
> actually be a virtual location, that is, it will be
> controlled by a 
>  directive in httpd.conf and will call the
> script to check 
> the user's name and password. As such, /foo/bar will
> not actually map 
> to a sub-directory on disk.
> 
> Second, the question arises what exactly would go
> into the .htaccess 
> file? Presumably, if a PerlAuthenHandler can be
> overridden for a 
> subdirectory using a .htaccess fie, there must be
> way to override it 
> directly in httpd.conf.
> 
> Thanks for the suggestion, though.
> 
> Geoffrey
> 
> 
> On 10 Jan 2005, at 13:30, Sean Davis wrote:
> 
> > Does adding a .htaccess file to /foo/bar help your
> situation?
> >
> > Sean
> >
> > On Jan 10, 2005, at 7:56 AM, Ferrari Geoffrey
> wrote:
> >
> >> Hi,
> >>
> >> If I have activated a PerlAuthenHandler for a
> directory in httpd.conf 
> >> with
> >>
> >> 
> >> ...
> >> PerlAuthenHandler My::Handler
> >> 
> >>
> >> How can I deactivate this PerlAuthenHandler for a
> subdirectory, such 
> >> as /foo/bar ?
> >>
> >> The online mod_perl docs explain that
> PerlHandlers can be deactivated 
> >> for subdirectories by setting PerlHandler
> default-handler (when 
> >> SetHandler has been set to perl-script), but
> either my problem lies 
> >> elsewhere, or it is not possible to have:
> >>
> >> 
> >> 
> >> PerlAuthenHandler default-handler # nor
> indeed 
> >> 'PerlAuthenHandler none'
> >> .
> >>
> >> All advice gratefully received. (I'm trying to
> set up authentication 
> >> using Apache::AuthCookie. Since I want to avoid
> clunky URLs like 
> >> www.example.com/protected/... I want to activate
> authentication for 
> >> the root directory. The only problem is that the
> login form where the 
> >> user types in his username and password has to be
> submitted to a 
> >> location below root (e.g. /LOGIN), which of
> course, can't be done 
> >> until the user has logged in...)
> >>
> >> Regards,
> >>
> >> Geoffrey Ferrari
> >
> >
> 
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: Mac::Glue and mod_perl

2005-01-14 Thread Martin Moss
please forgive the really daft question, but have done
a complete server shutdown and restart?

I've come across bus errors before where a complete
server restart made the problem go away and never come
back...

Marty


 --- Brian Dimeler <[EMAIL PROTECTED]> wrote: 
> Sorry for cross-posting this, but i think it applies
> to both groups.
> 
> I'm trying to write a mod_perl script (for PerlRun)
> that will present an 
> online interface to my Mac OS X Address Book. Using
> the standard method 
> of connecting to the glue (new Mac::Glue 'Address
> Book') doesn't work; 
> the webserver complains about not being able to
> connect to a window 
> server. So, I'm using Remote Apple Events instead
> (yes, I remembered to 
> turn them on in System Preferences):
> 
> my $book = new Mac::Glue 'Address Book',
>   eppc => 'Address Book',
>   'mac8.local' # hosts both the webserver +
> addressbook
>   undef, undef, # uid & pid omitted
>   'Mac8', 'mypass' # Mac8 is the Admin user & owner
> of addressbook
> 
> This line apparently causes the server child process
> to exit:
> 
> [Fri Jan 14 11:02:40 2005] [notice] child pid 6070
> exit signal Bus error 
> (10)
> 
> However, it works if I run it in a Terminal window
> (the remainder of the 
> script successfully prints out a list of address
> groups). It even works 
> when run in a Terminal window in a different,
> non-admin user account, as 
> long as I include the admin username and pass, as
> above.
> 
> So, does anyone know why it's causing a "bus error"
> when I try to run it 
> in the webserver? Is there a workaround?
> 
> Brian
> 
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: [mp1] Method handler that eventually seems to "forget" it's a method handler

2005-02-02 Thread Martin Moss
I've seen this problem and never got to the bottom of
it, on a redhat box with 5.8.3 (I think) and same
apache and mod_perl,

Marty




 --- Andrew Green <[EMAIL PROTECTED]> wrote: 
> Hi,
> 
> I seem to have a bizarre problem with method
> handlers on my setup.  I 
> have a set of different handlers, all of which are
> method handlers so 
> that I can easily inherit shared code across a
> collection of different 
> installations of my application on the same server.
> 
> The first handler to get invoked is a
> PerlTransHandler -- everything 
> works fine (or at least seems to) for quite some
> time, but then the 
> handler begins "forgetting" that it's a method
> handler, and instead of 
> the class being passed before $r, $r becomes the
> first thing passed.  
> At least, that seems to be what's happening.  Is
> this a known problem?
> 
> My setup is as follows:
> 
>Perl 5.8.0 (Red Hat EL 3 default)
>Apache/1.3.29
>mod_perl/1.29
> 
> 
> Here's what I imagine to be the relevant bits of
> httpd.conf:
> 
>   MinSpareServers 10
>   MaxSpareServers 20
>   StartServers 10
>   MaxClients 60
>   MaxRequestsPerChild 1000
>   ...
>   
>   PerlTransHandler MyApp::MyInstall::Dispatcher
>   ...
> 
> 
> Here's the relevant bits of Dispatcher.pm:
> 
>   package MyApp::MyInstall::Dispatcher;
> 
>   use strict;
>   use Apache::Constants qw(OK DECLINED NOT_FOUND
> REDIRECT FORBIDDEN);
>   use Apache::URI;
> 
>   our @ISA = qw(MyApp::Core::Dispatcher);
> 
>   1;
> 
>   
> 
>   sub handler ($$) {
> 
>   my ($class,$r) = @_;
>   return DECLINED unless ($r->is_initial_req());
>   ...
> 
> 
> And here's the error (that only starts appearing
> after the server's 
> been running for a while:
> 
>   Can't call method "is_initial_req" on an undefined
> value...
> 
> The error then points to the line quoted above.  Of
> course, Apache 
> never gets to other handlers later in the sequence,
> so I can't easily 
> see whether the problem is limited to TransHandlers,
> or whether all my 
> method handlers would stop acting as such. 
> Restarting the server makes 
> the problem go away -- for a while!
> 
> I'd really like to avoid having to upgrade/change
> Perl or mod_perl if 
> at all possible.  Nonetheless, any help, advice or
> guidance anyone can 
> provide would be very much appreciated.
> 
> Cheers,
> Andrew.
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: [mp1] Method handler that eventually seems to "forget" it's a method handler

2005-02-02 Thread Martin Moss
I tried ->handler in my configs, made no difference. 
I was doing a 'require' in a startup script if that
makes any difference. Haven't seen this issue with
simillar code anywhere else..

Marty

 --- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> > 
> > PerlTransHandler MyApp::MyInstall::Dispatcher
> 
> make that
> 
> PerlTransHandler
> MyApp::MyInstall::Dispatcher->handler
> 
> and see if that helps.  you should also be
> preloading via
> 
>   PerlModule MyApp::MyInstall::Dispatcher
> 
> or in a startup.pl.
> 
> HTH
> 
> --Geoff
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Sanity check on mod_rewrite and POST data [slightly OT]

2005-02-04 Thread Martin Moss
All,

Can I get a sanity check on this:-

I have a form which POSTs to https://server/url
That https servers uses mod_rewrite to forward the
request onto another server internally as
http://server/url

However after the rewrite, the POST data is lost. Can
anybody throw any light on this?

the rewrite rule is this:-

RewriteRule ^(.*)$ http://%{HTTP_HOST}$1 [R]

As a side question, can anybody tell me if a https GET
request would encrypt the parameters passed?

Regards

Marty









___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Re: End result of Wiki-ish system design + final question

2005-02-14 Thread Martin Moss
Hi Ben,

I have a few thoughts on this... In my experience
writing a daemon process is easy (well ish) but then
configuring your system to manage them (have they
died, have they crashed etc..) is more trouble than
its worth.

Is it possible to use some kind of cronjob based
system, which runs a script every minute, picks up a
list of things to process from say a database (which
your Handler writes to, to communicate to the backend
processes)... Of course a lockfile mechanism would
need to be used to ensure only one cronjob script runs
at any one time...

Regards

Marty


 --- ben syverson <[EMAIL PROTECTED]> wrote: 
> 
> On Feb 12, 2005, at 9:44 PM, ben syverson wrote:
> 
> > Maybe the solution is to have 5 or 10 perl
> processes fire up and stay 
> > open as daemons, processing these background regen
> requests?
> 
> After testing this, that looks like the way to go.
> The regen code now 
> lives as a pre-forking server, accepting connections
> via either TCP or 
> UN*X socket. This opens up the interesting
> possibility of dedicating a 
> server (or multiple servers) just to the
> regeneration process.
> 
> - ben
> 
>  





___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com


Board down? Test email

2005-03-13 Thread Martin Moss
Is anybody else having problems posting?

I posted a message on Monday, it still hasn't arrived,
now I just get undeliverables

Marty

Send instant messages to your online friends http://uk.messenger.yahoo.com 


Re: shared memory

2005-03-15 Thread Martin Moss

--- André Warnier <[EMAIL PROTECTED]> wrote:
> Jonathan Vanasco wrote:
> > 
> > look into memcached -- http://danga.com/memcached/
> 
> Thank you for the link, I didn't know that module,
> and I'll keep it in 
> mind for some other projects.
> But it is slightly off the mark as far as the issue
> below is concerned.
> Maybe it was my mentioning "data in tables" that was
> confusing.  My 
> problem is not to speed up database access, it is to
> share data (stored 
> in memory tables, or say arrays) between Apache
> children/threads.
> 

I haven't used Memchache yet, but it has nothing to do
with databases
It CAN be used to prevent database load, OR it could
be used to prevent too much access to flocking
files...
Consider the Example at the top of that link

sub get_foo_object {
   my $foo_id = int(shift);
   my $obj = $::MemCache->get("foo:$foo_id");
   return $obj if $obj;

   $obj = $::db->selectrow_hashref("SELECT  FROM
foo f, bar b ".
   "WHERE ... AND
f.fooid=$foo_id");
   $::MemCache->set("foo:$foo_id", $obj);
   return $obj;
}


your subroutine would be

sub get_foo_object {
   my $foo_id = int(shift);
   my $obj = $::MemCache->get("foo:$foo_id");
   return $obj if $obj;

   #
   #get $obj from your flocked file mechanism that you
are already using...
##
   
$obj=get_from flockfiles($foo_id)


   $::MemCache->set("foo:$foo_id", $obj);

return $obj;
}

It depends on how you've implemented the existing
mechanism I guess The above seems expect
instantiated Objects...

Personally I'm curious as to why you don't want to use
a database

Regards

Marty


Send instant messages to your online friends http://uk.messenger.yahoo.com 


Re: Authentication problem

2005-04-07 Thread Martin Moss
Hi,

what's your MaxClients setting in your apache conf?

It could just be that you aren't running enough apache
child processes to serve the number of connections
being made,

Regards

Marty


--- "Levi E. Stanley" <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> Been seeing problems with an Authenticate script
> lately.  It was working 
> fine up to the time I started getting slammed with
> traffic.  I don't see 
> any connection problems in the log file at all.  But
> what I have noticed 
> on the site is, I will click to go to download a
> file from the secure 
> area, and it won't prompt me for a username and
> password until minutes 
> later, like it is being delayed or something.  Is
> this normal behavior 
> from high traffic? 
> 
> More Info:
> 
> The server isn't even being over worked, it has 4
> cpus and on high 
> traffic hours, it is around 2 on cpu load.  So it
> can only be two 
> possibilities, the script or apache configuration. 
> The apache version I 
> am using http-2.0.53, and mod_perl-2.0.0-RC4.
> 
> Here is the code:
> 
> package My::Authenticate;
> 
> use strict;
> use ModPerl::Util ();
> use Apache::Const qw(OK DECLINED AUTH_REQUIRED);
> use Apache::Log;
> use DBI;
> 
> sub handler{
> my $r = shift;
> my $s = Apache->server;
> 
> return Apache::DECLINED unless
> $r->is_initial_req;
> 
> my ($status,$password) =
> $r->get_basic_auth_pw;
> my $username = $r->user;
> 
> return $status unless $status == Apache::OK;
> 
> my $hostname = $r->hostname;
> $hostname=~/(.*?\.)?(.*?)\.[a-z]{3}$/;
> my $table_access = $2."_access";
> my $dbh = 
>
DBI->connect('DBI:mysql:database=site_authentication;host=xxx.xxx.xxx.xxx','xxx','xxx');
> my $rs = $dbh->prepare("select 1 from
> $table_access where 
> username='$username' and passwd='$password'");
> $rs->execute;
> my ($result) = $rs->fetchrow_array;
> $rs->finish();
> $dbh->disconnect();
> 
> if ($result){
> return Apache::OK;
> }
> 
> $r->note_basic_auth_failure;
> return Apache::AUTH_REQUIRED;
> }
> 
> 1;
> 
> Any assistance on this issue would be greatly
> appreciated.
> 

Send instant messages to your online friends http://uk.messenger.yahoo.com 


slightly OT - defining variables in httpd.conf for use in httpd.conf

2005-04-07 Thread Martin Moss
All,

I know I've seen this done before, but I'd like to
define a variable at the top of my httpd.conf file,
and then use it many times throughout the conf file...

e.g. 

define Server='fred'

DocumentRoot /usr/local/${server}

I just can't find any info on this... Can anybopdy
point me at the right place..

All I find in google is how to use PerlSetVar, which
isn't what I'm trying to do...

Regards

Marty

Send instant messages to your online friends http://uk.messenger.yahoo.com 


RE: slightly OT - defining variables in httpd.conf for use in httpd.conf

2005-04-07 Thread Martin Moss
mod_define!

Thats the one

I can't believe I didn't find a link to in when
searching google for

'dynamic variables httpd.conf'

Ah well 

Thanks for that,

regards

Marty


--- "Reed, Jonathan" <[EMAIL PROTECTED]> wrote:
> We set them in Section 2 of the httpd.conf after the
> DocumentRoot like this:
> 
> SetEnv ORACLE_HOME "/opt/home/oracle/product/8.1.7"
> 
> -Jon Reed
> 
> 
> -Original Message-
> From: David Wright [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 07, 2005 10:08 AM
> To: modperl
> Subject: Re: slightly OT - defining variables in
> httpd.conf for use in
> httpd.conf
> 
> 
> > I know I've seen this done before, but I'd like to
> > define a variable at the top of my httpd.conf
> file,
> > and then use it many times throughout the conf
> file...
> >
> > e.g.
> >
> > define Server='fred'
> >
> > DocumentRoot /usr/local/${server}
> >
> > I just can't find any info on this... Can anybopdy
> > point me at the right place..
> 
> mod_macro or mod_define look like they might be
> useful to you:
> 
> http://www.cri.ensmp.fr/~coelho/mod_macro/
> http://www.lpi.msk.su/mod/mod_define.html
> 
> 
> cheers,
> dave
> 

Send instant messages to your online friends http://uk.messenger.yahoo.com 


to ENV or not to ENV

2005-05-18 Thread Martin Moss
All,

We're in the process of introducing mod perl method
handlers and template toolkit into a system which is
also running Embperl. There is some interaction
between the two, and as Embperl (and especially our
code which uses it) uses %ENV to pass around variables
like $ENV{REMOTE_USER_ID} and other useful things I
wanted to get some views on the use of %ENV in this
form.

I was under the impression that using %ENV is a bad
thing to do.. mod perl provides PerlSetVar to set
variables for mod_perl within conf files... But when a
variable isn't set in a conf file, but in an embperl
script, the way I see it there are several ways to
transfer data between the two systems.

1) using %ENV
2) setting using our own subclass of Apache::Request's
pnotes or notes methods
3) Passed as parameters between them all
4) stored and retrieved through a session store
5) stored in cookies

I think that the whole thing comes down to the first
2... the last few are too impractical (given an
already existing code set) as a generic method... 

I believe that using %ENV opens up the system to bad
coding problems, e.g. writing a backend module for DB
interaction and then slipping in a call to %ENV for
some front end user information. I also believe there
has been some discussion on this list a while ago,
which came out in favour of not using %ENV at all if
it can be helped But I can't remember why this was
a bad thing...?

I favour using Apache::Request's pnotes, notes and
dir_config methods for acheiving all of this using
methods as wrappers to the information required

So can anybody shed some light on this pros/cons
discussion?

Kind regards

Marty





___ 
Yahoo! Messenger - want a free and easy way to contact your friends online? 
http://uk.messenger.yahoo.com


Re: Getting lots of redefined statements in the error_log

2005-06-20 Thread Martin Moss
Can you confirm you have the same version of Perl on
both systems?

I've seen these errors on perl 5.8 after upgrading
from perl 5.005

Marty

p.s. I still have them too, so any help with this
issue would be useful to me too...

--- Boysenberry Payne <[EMAIL PROTECTED]>
wrote:

> Here is a sample of a long list:
> 
> [Fri Jun 17 15:17:19 2005] Unix.pm: Subroutine _cwd
> redefined at 
>
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/File/Spec/Unix.pm
> line 
> 470.
> [Fri Jun 17 15:17:19 2005] Carp.pm: Subroutine
> import redefined at 
> /usr/lib/perl5/5.8.0/CGI/Carp.pm line 289.
> 
> This only happens on our external server (currently
> being tested and 
> set up.)  I didn't set it up, otherwise I would
> offer config settings.
> 
> It doesn't happen on my local system when I run the
> same script.  I'm 
> not sure why I'm getting all of these redefined
> errors.
> I thought maybe someone here would know what's going
> on
> 
> Thanks,
> Boysenberry
> 
> This message contains information that is
> confidential
> and proprietary to Humaniteque and / or its
> affiliates.
> It is intended only for the recipient named and for
> the express purpose(s) described therein.
> Any other use is prohibited.
> 
> http://www.habitatlife.com
> The World's Best Site Builder
> 
> 




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


mod_define apache2

2005-08-17 Thread Martin Moss
All,

We're in the middle of centralising our apache (1.3)
config files and I would like to use mod_define to
simplify the process. However I've noticed that
mod_define isn't available for apache2. 

Is there an alternative I can use, or is mod_define's
functionality now core to mod_perl2?

Regards

Marty





___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


[mp2] 'make test' error--cannot start server: httpd () does not exist

2005-08-22 Thread Eric Martin
ctions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <[EMAIL PROTECTED]>
Received: (qmail 69110 invoked by uid 99); 22 Aug 2005 16:50:07 -
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
   by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005 
09:50:07 -0700

X-ASF-Spam-Status: No, hits=0.0 required=10.0
tests=
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [130.44.1.105] (HELO ams.org) (130.44.1.105)
   by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005 
09:50:24 -0700

Received: from emmxp (emmxp.ams.org [130.44.10.28])
by ams.org (Switch-3.1.6/Switch-3.1.6) with SMTP id j7MGo3cI026888
(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO)
for 
<[EMAIL PROTECTED]>; 
Mon, 22 Aug 2005 12:50:03 -0400 (EDT)

Message-ID: <[EMAIL PROTECTED]>
From: "Eric Martin" <[EMAIL PROTECTED]>
To: 
<[EMAIL PROTECTED]>

References: <[EMAIL PROTECTED]>
Subject: Re: confirm subscribe to modperl@perl.apache.org
Date: Mon, 22 Aug 2005 12:50:02 -0400
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-Scanned-By: MIMEDefang 2.49 on 130.44.1.105
X-Virus-Checked: Checked by ClamAV on apache.org


- Original Message - 
From: <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Sent: Monday, August 22, 2005 12:47 PM
Subject: confirm subscribe to modperl@perl.apache.org



Hi! This is the ezmlm program. I'm managing the
modperl@perl.apache.org mailing list.

To confirm that you would like

  [EMAIL PROTECTED]

added to the modperl mailing list, please send
an empty reply to this address:

  [EMAIL PROTECTED]

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
<[EMAIL PROTECTED]> and put the
entire address listed above into the "Subject:" line.


--- Administrative commands for the modperl list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
  <[EMAIL PROTECTED]>

To remove your address from the list, send a message to:
  <[EMAIL PROTECTED]>

Send mail to the following for info and FAQ for this list:
  <[EMAIL PROTECTED]>
  <[EMAIL PROTECTED]>

Similar addresses exist for the digest list:
  <[EMAIL PROTECTED]>
  <[EMAIL PROTECTED]>

To get messages 123 through 145 (a maximum of 100 per request), mail:
  <[EMAIL PROTECTED]>

To get an index with subject and author for messages 123-456 , mail:
  <[EMAIL PROTECTED]>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
  <[EMAIL PROTECTED]>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<[EMAIL PROTECTED]>

To stop subscription for this address, mail:
<[EMAIL PROTECTED]>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <[EMAIL PROTECTED]>
Received: (qmail 66183 invoked by uid 99); 22 Aug 2005 16:47:40 -
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
   by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005
09:47:40 -0700
X-ASF-Spam-Status: No, hits=1.6 required=10.0
tests=MISSING_SUBJECT
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [130.44.1.105] (HELO ams.org) (130.44.1.105)
   by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005
09:47:57 -0700
Received: from emmxp (emmxp.ams.org [130.44.10.28])
by ams.org (Switch-3.1.6/Switch-3.1.6) with SMTP id j7MGlZqJ026519
(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO)
for <[EMAIL PROTECTED]>; Mon, 22 Aug 2005 12:47:36 -0400
(EDT)
Message-ID: <[EMAIL PROTECTED]>
From: "Eric Martin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject:
Date: Mon, 22 Aug 2005 12:47:35 -0400
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-Scanned-By: MIMEDefang 2.49 on 130.44.1.105
X-Virus-Checked: Checked by ClamAV on apache.org








Fw: [mp2] 'make test' error--cannot start server: httpd () does not exist

2005-08-22 Thread Eric Martin

Well, the suexec mechanism seems to be working OK:

# ps -ef | grep httpd
 nobody 28220 28219   0 14:38:25 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start
 nobody 28225 28219   0 14:38:26 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start
   root 28219 1   0 14:38:25 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start
 nobody 28221 28219   0 14:38:26 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start
 nobody 28224 28219   0 14:38:26 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start

   root 28229 28212   0 14:38:29 pts/10  0:00 grep httpd
 nobody 28223 28219   0 14:38:26 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start
 nobody 28222 28219   0 14:38:26 ?   0:00 
/usr/local/stow/apache-2.0.54/apache2/bin/httpd -k start


Should I need to chown my httpd to nobody to make Apache::Test work 
(circumventing suexec)?
Note: chowning the entire apache tree to nobody:nobody still causes the 
"httpd () does not exist" error in mod_perl 2.


In case I failed to mention this before:

# /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.54
Server built:   Aug 18 2005 12:40:02
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FCNTL_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"


- Original Message - 
From: "Philippe M. Chiasson" <[EMAIL PROTECTED]>

To: "Eric Martin" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, August 22, 2005 2:17 PM
Subject: Re: [mp2] 'make test' error--cannot start server: httpd () 
does not exist


Eric Martin wrote:

1. Just installed gcc-3.4.4, perl-5.8.7, apache-2.0.54 on a clean
installation of Solaris 10.  gcc, perl, and apache went in without a
hitch. About 70 perl modules also installed without failure using the
new gcc/perl.


2. I then proceed to do: 'perl Makefile.PL
MP_APXS=/usr/local/apache2/bin/apxs', 'make' (/usr/ccs/bin), and 'make
test,' which gives:
begin 'make test'
# make test
cd "src/modules/perl" && make
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT=
APACHE_TEST_USER= APACHE_TEST_APXS= \
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -bugreport -verbose=0
[warning] root mode: changing the files ownership to 'nobody' 
(60001:60001)

[warning] testing whether 'nobody' is able to -rwx
/usr/local/src/perlmods/mod_perl-2.0.1/t
"/usr/bin/perl"
-Mlib=/usr/local/src/perlmods/mod_perl-2.0.1/Apache-Test/lib
-MApache::TestRun -e 'eval { Apache::TestRun::run_root_fs_test(60001,
60001, q[/usr/local/src/perlmods/mod_perl-2.0.1/t]) }';


[warning] result: OK
[warning] the client side drops 'root' permissions and becomes 'nobody'
[  error] cannot start server: httpd
(/usr/local/stow/apache-2.0.54/apache2/bin/httpd) does not exist


Most likely problem here is that httpd does exist at that patch, but after
dropping privileges to nobody, it can't see it anymore.

Have you made sure that user 'nobody' can successfully stat/exec
/usr/local/stow/apache-2.0.54/apache2/bin/httpd ? (and the directories 
leading to there)



++
| Please file a bug report: http://perl.apache.org/bugs/ |
++
*** Error code 1
make: Fatal error: Command failed for target `run_tests'
=end 'make test'=
Well, apxs is where I said it was (obviously), and httpd definately
exists at: /usr/local/stow/apache-2.0.54/apache2/bin/httpd



Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 
88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 
88C3A5A5




Re: Fw: [mp2] 'make test' error--cannot start server: httpd () does not exist

2005-08-22 Thread Eric Martin

Note: chowning the entire apache tree to nobody:nobody still causes the
"httpd () does not exist" error in mod_perl 2.


Have you tried

$> su - nobody
$> stat /usr/local/stow/apache-2.0.54/apache2/bin/httpd

?


'stat' command?
Did I mention the machine is a vanilla Solaris 10 host?


I suspect nobody is unable to, say, access /usr/local/stow.


In case I failed to mention this before:

# /usr/local/apache2/bin/httpd -V


That's a bit curious, why /usr/local/apache2/bin/httpd and
usr/local/stow/apache-2.0.54/apache2/bin/httpd ?

Which one is the correct one ?


/usr/local/apache2/bin is a symlink to 
/usr/local/stow/apache-2.0.54/apache2/bin




Multiple Handlers

2005-08-31 Thread Martin Moss
All,

I'm trying to make something work in mod perl, and all
the docs seem to be pointing me in ways which just
don't work on our system...

Server version: Apache/1.3.33 (Unix)
SunOS 5.9
perl, v5.8.6

I wish to have a handler which sits after the
Authentication stage, which can choose whether to
display a HTML page instead of the originally
requested page.. 
The originally requested page will usually be served
via Embperl, or a method handler..

I originally tried using $r->set_handlers. in my
PerlAuthenHandler. But this made absolutely no
difference to the current request... 
e.g. if did a get_handlers call before and after using
set_handlers, it clearly showed me the handlers I'd
set using set_handlers, but apache ignored this and
carried on serving it's original get_handlers()
anyway.. 

I found many different people reporting bugs in the
set_handlers mechanism and push_handler (which worked
but couldn't help me as what I wanted to do was
unshift (not push) the handlers).

So I tried defining two handlers for the same request,
the first one my custom handler, the second one
Embperl as normal. Now when my custom handler returns
DECLINE the page requested displays
normally.GREAT:-)... 

But when my custom handler actually serves a page, and
returns OK, I actually see the custom handler page
being served, and then the original requested page
appears below with a load of headers and server error
messages  So basically BOTH handlers are being
called

Now, I was under the impression (but could be wrong)
that if 2 content PerlHandlers are defined for a
request, then if the first one returns OK then the
second handler doesn't get called, but if it returns
DECLINED then the second one gets called...

Can anybody throw some light on this? 
Why doesn't set_handlers (used in the
PerlAuthenHandler phase) allow me to define the
PerlHandler for the content phase?

How do I prevent other handlers (independant of my
custom handler) from being run if my Custom handler
decides to serve a page...

Kind regards

Marty








___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


Re: Multiple Handlers

2005-08-31 Thread Martin Moss
Have an awful suspicion the book I used suggested
doing it the other way around? Would that make a
difference?

$r->handler('perl-script');
$r->set_handlers(PerlHandler => [ My::Handler ]);

Marty


--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> 
> > I originally tried using $r->set_handlers. in my
> > PerlAuthenHandler. But this made absolutely no
> > difference to the current request... 
> 
> if you want to set_handlers() for the PerlHandler
> phase you need two calls
> 
>   $r->set_handlers(PerlHandler => [ My::Handler ]);
>   $r->handler('perl-script');
> 
> HTH
> 
> --Geoff
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Multiple Handlers

2005-08-31 Thread Martin Moss
It doesn't seem to work... This was the original
solution I tried..

Here is the code:-

if (Apache->can('set_handlers'))
{
print STDERR "CAN PUSH HANDLERS OK\n";
}
else
{
print STDERR "CANNOT PUSH HANDLERS OK\n";
}
my $list = $r->get_handlers( 'PerlHandler' );
print STDERR "\n";
print STDERR Dumper($$,$0,$list);
print STDERR "===\n";
 $r->set_handlers( 'PerlHandler' =>
['My::Apache::User::Notification']);
 $r->handler('perl-script');
my $list2 = Apache->get_handlers( 'PerlHandler' );
print STDERR Dumper($$,$list,$list2);
print STDERR "==\n";



Here is the output I get in my logs:-

CAN PUSH HANDLERS OK
==
$VAR1 = 15253;
$VAR2 = '/www/common/conf/core/traps.conf';
$VAR3 = [
  'Embperl::handler'
];
==
$VAR1 = 15253;
$VAR2 = [
  'Embperl::handler'
];
$VAR3 = [
  'III::Apache::User::Notification'
];
==

==
15253 Apache::AuthenDBI request type = main

In Embperl::handler

So as you can see, the set_handlers seems to work...
But after the Authen stage has returned OK, the next
handler to take control is Embperl::handler...

Any Ideas?

Regards

Marty

--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> 
> Martin Moss wrote:
> > Have an awful suspicion the book I used suggested
> > doing it the other way around? Would that make a
> > difference?
> > 
> > $r->handler('perl-script');
> > $r->set_handlers(PerlHandler => [ My::Handler ]);
> 
> none whatsoever.
> 
> keep in mind that you can only call set_handlers()
> during phases prior to
> the phase you're setting.  for example, you can't
> 
>   $r->set_handlers(PerlHandler => [ My::Handler ]
> 
> from within a PerlHandler, but you could from within
> a PerlAuthenHandler.
> 
> btw, I saw that you wanted to unshift handlers (as
> opposed to push). this is
> how you do that
> 
>   my $handlers =
> $r->get_handlers(`PerlFixupHandler');
>   $r->set_handlers(PerlFixupHandler => [`My::Bow',
> @$handlers]);
> 
> HTH
> 
> --Geoff
> 






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


Apache::DBI How tro tell if enabled

2005-09-29 Thread Martin Moss
All,

I'm trying to confirm whether Apache::DBI is running
on a server.. I can tell if it's loaded, using
perl-status, but I can't tell if it's running
correctly - e.g. intercepting calls to
DBI->connect/disconnect...

Can anybody give me a few pointers?

Marty



___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Apache::DBI How tro tell if enabled

2005-09-29 Thread Martin Moss
So I presume that having done all this, and my logfile
remains blank, then it is not working? :-)


--- Michael Peters <[EMAIL PROTECTED]> wrote:

> 
> 
> Martin Moss wrote:
> > All,
> > 
> > I'm trying to confirm whether Apache::DBI is
> running
> > on a server.. I can tell if it's loaded, using
> > perl-status, but I can't tell if it's running
> > correctly - e.g. intercepting calls to
> > DBI->connect/disconnect...
> > 
> > Can anybody give me a few pointers?
> 
> From mod_perl docs
>
(http://perl.apache.org/docs/1.0/guide/databases.html#Debugging_Apache__DBI)
> 
> If you are not sure if this module is working as
> advertised, you should
> enable Debug mode in the startup script
> 
> From the Apache::DBI docs:
> 
> To enable debugging the variable $Apache::DBI::DEBUG
> must be set. This
> can either be done in startup.pl or in the user
> script. Setting the
> variable to 1, just reports about a new connect.
> Setting the variable to
> 2 enables full debug output.
> 
> 
> -- 
> Michael Peters
> Developer
> Plus Three, LP
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Apache::DBI How tro tell if enabled

2005-09-30 Thread Martin Moss
:-) That seems to be the crux of it...
It is being loaded before DBI, however the escalating
number of DB connections we're observing tends to
disagree. I think someone has added a LoadModule
directive somewhere in the wrong place and that module
has a call to DBI.. I've managed to confirm
Apache::DBI debug level2 output wasnt' appearing in
the logs.. so it's definitely disabled... Fine tooth
comb time:-(

Cheers for all the help,

Marty


--- Perrin Harkins <[EMAIL PROTECTED]> wrote:

> On Thu, 2005-09-29 at 17:08 +0100, Martin Moss
> wrote:
> > So I presume that having done all this, and my
> logfile
> > remains blank, then it is not working? :-)
> 
> Make sure you load it before DBI (or any other
> module that will load
> DBI).
> 
> - Perrin
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Module mod_log_config and custom Auth

2005-10-03 Thread Martin Moss
All,

I'm looking to ensure that an Authenticated user's
username is logged in our logfiles, along with a
cookie string..  I've had a quick look through google
and I'm currently finding that I should use %u for
username, but this is appearing blank... What do I
need to set in my Custome Authentication Handler to
ensure the username gets recorded...

Marty



___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Module mod_log_config and custom Auth

2005-10-03 Thread Martin Moss
this doesnt seem to work. Here's the code

print STDERR "Username given = ". $investor3->name .
"\n";

$r->connection->user($investor3->name);
$r->user($investor3->name);

I'm definitely seeing correct username's in the
logs...  

We have EmbPerl installed... Can this have anything to
do with it?

Marty

--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> Martin Moss wrote:
> > All,
> > 
> > I'm looking to ensure that an Authenticated user's
> > username is logged in our logfiles, along with a
> > cookie string..  I've had a quick look through
> google
> > and I'm currently finding that I should use %u for
> > username, but this is appearing blank... What do I
> > need to set in my Custome Authentication Handler
> to
> > ensure the username gets recorded...
> 
> well, if you're using a custom authentication
> handler then you need to 
> set $r->user to whatever username you authenticated.
>  there are other 
> things you need to do as well, but that should solve
> your immeditate 
> problem.
> 
> HTH
> 
> --Geoff
> 






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


is_intial_req

2005-11-01 Thread Martin Moss
I'm a little confused. And was wondering if I could
get a sanity check..

I have a mod perl method handler and at start it runs
this code

my $is_initial_req = $r->is_initial_req;
my $is_main = $r->is_main;
my $main = $r->main;
my $proxyreq = $r->proxyreq;

print STDERR
Dumper('is_initial_req',$is_initial_req,'is_main',$is_main,'main',$main,'proxyreq',$proxyreq)
if $DEBUG;

I am running a system which has embperl installed
using this:-


  SetHandler  perl-script
  PerlHandler Embperl
  Options ExecCGI FollowSymLinks


And My handler is called using this


setHandler perl-script
PerlModule My::Apache::Authen::Cookie
PerlHandler My::Apache::Authen::Cookie->logout


I also have a second 'control' instance of this
handler installed purely for this debugging


setHandler perl-script
PerlModule My::Apache::Authen::Cookie
PerlHandler My::Apache::Authen::Cookie->logout


Finally there is a directory under my document root
called /logout/ which contains old Embperl scripts I'm
superceding with my handler (so would be found on a
FilesMatch).

The question I have is this.:-

When I visit /logout I get the following Dumped
information from my handler:-

$VAR1 = 'is_initial_req';
$VAR2 = '0';
$VAR3 = 'is_main';
$VAR4 = 1;
$VAR5 = 'main';
$VAR6 = undef;
$VAR7 = 'proxyreq';
$VAR8 = '0';

But when I visit /logout2 I get the following:-

$VAR1 = 'is_initial_req';
$VAR2 = 1;
$VAR3 = 'is_main';
$VAR4 = 1;
$VAR5 = 'main';
$VAR6 = undef;
$VAR7 = 'proxyreq';
$VAR8 = '0';

Why is is_initial_req consistently 0 for logout and
consistently 1 for logout2...

I tried swapping the order of the FilesMatch and the
Location configs in my httpd.conf but this made no
difference...

So can anybody clear up this mystery for me?

Kind regards

Marty




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


Re: is_intial_req

2005-11-01 Thread Martin Moss
Hey Frank..

I agree, thats why I setup the logout2 control test.
What I don't understand is "why" it is tripping it
out. Surely it would only trip it out if the order of
the httpd.conf filesmatch and location is set one way
around, and then not trip it out if the order is
reversed, not both as I'm seeing...

Would this also mean that once my ContentHandler has
returned OK, and sent Data back to the user and
"finished" as far as I'm concerned, that the Apache
server is then going off and running the old logout
embperl scripts too?

If so, how do I tell apache that I don't wish any more
contentHandlers to be run?

I posted an issue a while back about trying to use
push_handlers and set_handlers... and push_handlers
works, but set_handlers doesn't... never got a
solution, beyond what I'd already tried.. All very
weird. 

Marty

--- Frank Wiles <[EMAIL PROTECTED]> wrote:

> On Tue, 1 Nov 2005 14:31:33 + (GMT)
> Martin Moss <[EMAIL PROTECTED]> wrote:
> 
> > I'm a little confused. And was wondering if I
> could
> > get a sanity check..
> > 
> > I have a mod perl method handler and at start it
> runs
> > this code
> > 
> > my $is_initial_req = $r->is_initial_req;
> > my $is_main = $r->is_main;
> > my $main = $r->main;
> > my $proxyreq = $r->proxyreq;
> > 
> > print STDERR
> >
>
Dumper('is_initial_req',$is_initial_req,'is_main',$is_main,'main',
> > $main,'proxyreq',$proxyreq) if $DEBUG;
> > 
> > I am running a system which has embperl installed
> >
> > Why is is_initial_req consistently 0 for logout
> and
> > consistently 1 for logout2...
> > 
> > I tried swapping the order of the FilesMatch and
> the
> > Location configs in my httpd.conf but this made no
> > difference...
> > 
> > So can anybody clear up this mystery for me?
> 
>   I think your FilesMatch is what is tripping you
> up.  As a test,
>   move /logout/ to /logout3/ and see if you then get
> the same results
>   as /logout2/.  
> 
>  -
>Frank Wiles <[EMAIL PROTECTED]>
>http://www.wiles.org
>  -
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: is_intial_req

2005-11-01 Thread Martin Moss
yeah you're right, it does, thats what I've been
doing. But I'm having to use a rewrite rule to ensure
I don't have to go and manually edit the silly amount
of hardcoded links to /logout I've inherited with the
old code...:-(

Just bugs me that I don't understand the details of
why..

Marty


--- Frank Wiles <[EMAIL PROTECTED]> wrote:

> On Tue, 1 Nov 2005 14:54:31 + (GMT)
> Martin Moss <[EMAIL PROTECTED]> wrote:
> 
> > Hey Frank..
> > 
> > I agree, thats why I setup the logout2 control
> test.
> > What I don't understand is "why" it is tripping it
> > out. Surely it would only trip it out if the order
> of
> > the httpd.conf filesmatch and location is set one
> way
> > around, and then not trip it out if the order is
> > reversed, not both as I'm seeing...
> 
>   Order has almost no meaning in Apache's config
> files.  It's all
>   about the depth of the "nesting" of directives. 
> Much like CSS. 
> 
>   I don't have a really great explanation as to the
> cause, as I've
>   never used embedperl.  But I would think it would
> make your life
>   easier if you just didn't put handlers on
> Locations that also have
>   Embedperl scripts on the filesystem.  For
> clarity/readability as
>   much as to avoid this bug. 
> 
>  -
>Frank Wiles <[EMAIL PROTECTED]>
>http://www.wiles.org
>  -
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: is_intial_req

2005-11-01 Thread Martin Moss
Hi Micheal..

It's a sticky one, because surely that would
definitely mean that the Location would take
precedence and the FilesMatch would be secondary...
And I am seeing this, my handler does get run first...
But it is Never the initial Request... 

Obviously something is happenning, behind the scenes,
and I can't work it out...

Is it possible Embperl does something with the Apache
Request in an earlier Phase of the request?


--- Michael Peters <[EMAIL PROTECTED]> wrote:

> 
> 
> Martin Moss wrote:
> > I'm a little confused. And was wondering if I
> could
> > get a sanity check..
> 
> > I tried swapping the order of the FilesMatch and
> the
> > Location configs in my httpd.conf but this made no
> > difference...
> 
> From reading
> http://httpd.apache.org/docs/1.3/sections.html, it
> seems
> that Location will always take precedence over
> FilesMatch regardless of
> their order.
> 
> Order only matters in the precedence of similar
> tags.
> 
> -- 
> Michael Peters
> Developer
> Plus Three, LP
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: is_intial_req

2005-11-01 Thread Martin Moss
I had a quick look at this and found both my requests
to /logout/ and /logout2/ typed into the browser
manually, continue to result in the same issue..

Here's the rewrite rules I have on my https proxy that
each request comes through..

RewriteRule ^/logout/(.*)$
http://${farm:map_pf}/logout/$1 [P,L]
RewriteRule ^/logout2/(.*)$
http://${farm:map_pf}/logout2/$1 [P,L]

I also ammended both locations to use 
/logout/ and /logout2/

And I still get the same issue...(so as far as I'm
aware no further internal translation is made..)

--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> > Why is is_initial_req consistently 0 for logout
> and
> > consistently 1 for logout2...
> 
> besides the existing conversation, you need to
> remember what is_initial_req
> means - it means that this is the request as it came
> straight from the
> browser and wasn't redirected at all.  if apache
> made an internal redirect
> from /logout to /logout/ that would make
> is_initial_req false.
> 
> so, try playing around with trailing slashes and
> making sure that your
> requests are in fact equivalent (that you're not
> asking for /logout one time
> and /logout/index.html the next, for example).
> 
> HTH
> 
> --Geoff
> 




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


Authentication

2005-11-10 Thread Martin Moss
All,

During the Authentication phase, Any custom responses
that need to be sent back to a user, MUST be sent with
FORBIDDEN using custom_repsonse? 

Under Authentication 200 (OK) simply lets Apache Move
on the to the next phase (authz, content  etc..)...

I have an authen handler which uses cookies.. and only
accepts username and password submits under https...

I'm getting grief from our sysadmin that there's too
many 403's being served...

1) to redirect the user from their http request to a
https page.. 
2) custom response showing the login page
3) redirect user to original http page 

so 3 403's when a user has no valid cookie 
Is this abnormal? Is there anything I could do to
reduce this?

Marty




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Authentication

2005-11-10 Thread Martin Moss
So an Authen Handler can return a REDIRECT?

I use a 403 custom repsonse which is a self submitting
page (with non javascript handling)... By doing so it
prevent's any of the authentication pages appearing in
IE's back button on the browser...

Marty





--- Perrin Harkins <[EMAIL PROTECTED]> wrote:

> On Thu, 2005-11-10 at 16:20 +, John ORourke
> wrote:
> > You can avoid some redirection by having a
> non-HTTPS form which submits 
> > to the HTTPS login page (although users might
> worry, no padlock icon).  
> > Otherwise it's perfectly reasonable to redirect to
> a secure login.  On 
> > successful login simple 403 the user back to the
> page they wanted.  
> > That's just one 403 per request.
> 
> 403 means "Forbidden," not "Redirect."
> 
> - Perrin
> 
> 
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Authentication

2005-11-10 Thread Martin Moss
You wouldn't believe the problems I've had with
AccessHandlers...

Although saying that I was trying to do a set_handlers
for the contentphase... which was being completely
ignored by apache...

I'll have a think about it... But the idea is to make
the authentication be completely invisible to the
users page request.. so if their login times out, and
they've just submitted a post to a message board, we
want to preserve their post throughout the
authentication and then when they're authenticated,
have the post occur and the user never have the
authentication process appear in their browser
history... 

Marty


--- John ORourke <[EMAIL PROTECTED]> wrote:

> My fault guys, not looking up the numbers - Martin
> is your admin 
> complaining about too many FORBIDDENs or REDIRECTs?
> 
> The only thing I can add is that I'd recommend not
> using the 
> authentication pages/handler to redirect - make
> yourself an Access phase 
> (eg. "if no valid cookie, redirect to HTTPS login
> page with appropriate 
> parameters").
> 
> John
> 
> 
> Perrin Harkins wrote:
> 
> >On Thu, 2005-11-10 at 17:19 +, Martin Moss
> wrote:
> >  
> >
> >>So an Authen Handler can return a REDIRECT?
> >>
> >>I use a 403 custom repsonse which is a self
> submitting
> >>page (with non javascript handling)... By doing so
> it
> >>prevent's any of the authentication pages
> appearing in
> >>IE's back button on the browser...
> >>
> >>
> 
> 






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


configuration error: couldn't check user. No user file?:

2005-11-11 Thread Martin Moss
I'm seeing this error in the logfiles...

configuration error:  couldn't check user.  No user
file?:

Any ideas what might cause it... it is appearing on
different webpages... seems to be during large POST's.

We've just changed from Basic to Cookie based Auth...

Marty



___ 
Yahoo! Model Search 2005 - Find the next catwalk superstars - 
http://uk.news.yahoo.com/hot/model-search/


Re: configuration error: couldn't check user. No user file?:

2005-11-11 Thread Martin Moss
solved it... But there's a new mystery...

I was returning DECLINED in my Auth handler when the
following subroutine showed a user had disconnected...


sub client_still_connected
{
my $self = shift; #subclassed Apache::Request
my $conn = $self->connection;
my $is_connected = $conn->aborted ? 0 : 1;
if ($is_connected)
{
cluck ("connection still seems valid") if
$DEBUG;
my $fileno = $conn->fileno;
if (defined $fileno)
{
cluck ("Still seems valid\n") if $DEBUG;
my $s = IO::Select->new($fileno);
#$is_connected = $s->can_read(0) ? 0 : 1;
}
}

cluck ("is_connected=$is_connected\n") if $DEBUG;
return $is_connected;
}

The problem I have now, is this subroutine always
fails at the $s->can_read line whene a user POST's a
large amount of content... 

And intermittently on other page requests (GET & POST)
the subroutine fails the can_read but the client is
Still there

Any ideas?

We use a reverse proxy in front of our mod_perl
server...


Marty



--- Martin Moss <[EMAIL PROTECTED]> wrote:

> I'm seeing this error in the logfiles...
> 
> configuration error:  couldn't check user.  No user
> file?:
> 
> Any ideas what might cause it... it is appearing on
> different webpages... seems to be during large
> POST's.
> 
> We've just changed from Basic to Cookie based
> Auth...
> 
> Marty
> 
> 
>   
>
___
> 
> Yahoo! Model Search 2005 - Find the next catwalk
> superstars -
> http://uk.news.yahoo.com/hot/model-search/
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Apache::DBI

2006-01-16 Thread Martin Moss
Not sure why it's doing it, if you've got a default
clean install,

But to control it's debug level you can put this in
your startup.pl 

$Apache::DBI::DEBUG=0;

Regards

Marty



--- Paul Harrison <[EMAIL PROTECTED]> wrote:

>  
> 
> I installed Apache::DBI - 0.98 on FreeBSD 5.4 with
> mod_perl 1.
> 
>  
> 
> Apache::DBI logs an entry in apache error log file
> every time it create(s) a
> new connection or using an existing connection to
> the database server.
> 
> Is this normal with this version?  And how do I turn
> that feature off?
> 
>  
> 
>  
> 
> Example,
> 
> 55933 Apache::DBI need ping: yes
> 
> 55933 Apache::DBI already connected to
>
'database=database_name;host=info_here\AutoCommit=1^\PrintError=1^\Username=
> info_here'
> 
> 55933 Apache::DBI need ping: yes
> 
> 55933 Apache::DBI already connected to
>
'database=database_name;host=info_here\AutoCommit=1^\PrintError=1^\Username=
> info_here'
> 
>  
> 
>  
> 
> The error log file will get huge after a while.
> 
>  
> 
>  
> 
> Cure
> 
>  
> 
> 




___ 
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars 
online! http://uk.cars.yahoo.com/


[JOB] [OT] London

2006-02-28 Thread Martin Moss
All,

We are seeking a perl developer to join a small
development team. The ideal candidate will have 3+
years experience developing, supporting and debugging
internet/intranet projects, using perl within an
Apache, linux/solaris environment. 
Candidates must also have 2+ years experience using
Oracle SQL with perl’s DBI with a solid exposure to
either Template Toolkit or EmbedPerl. Other perl
templating mechanisms will be considered, as will
other SQL based RDBMS (Mysql, Sybase etc..)

Further to the above skills, candidates must
demonstrate a solid level of competence in hand coding
HTML and JavaScript. 

Financial industry experience will be considered a
bonus, as will experience of any of the following
technologies, JSP, Java (J2EE), XML, mod perl “Method”
handlers, Content Management systems, datafeeds and
bulk emailing systems. Any experience with developing
code using a Source code control mechanism, ideally
Perforce or CVS, will also be considered a Bonus.

Candidates will be tested on their knowledge of
Apache, DBI, OO Perl, mod perl, HTML, Javascript and
their ability to write efficient and abstract code
during the interview process.

Please Send CV's & a covering letter to
[EMAIL PROTECTED] (Do not reply to this email).

Please note, we are based in the City of London and
will only  accept applications from people who are
entitled to work in the UK and who can commute to the
office daily. 

Regards

Marty





___ 
Win a BlackBerry device from O2 with Yahoo!. Enter now. 
http://www.yahoo.co.uk/blackberry


Perl Script using MapToStorageHandler

2006-03-01 Thread Glenn Martin
Ive got a script im wokring on that uses the
"PerlMapToStorageHandler" at that point it adds to the
Apache Configuration using the Incomming URI, creating
Location/Directory Sections, and an Alias or two... 

However, i need to be able to remove these changes
after the request is completed... How would i remove
theses changes and what handler would you suggest for
me to tie in to?

Thank You
Glenn R. Martin


Re: Perl Script using MapToStorageHandler

2006-03-01 Thread Glenn Martin
Actually if i read the documentation correctly, im
doing it just right. Map to Storage is right before it
get mapped to a Location/Directory... and thus this is
where id want to add Directory/Location and Alias
directives based off of the incomming URI... Im trying
to control DAV input. Take the URI, translate it to a
Folder, Check the folders contents to see if it
matches a Subversion repository and if it does map the
Location to SVN Dav and that repository otherwise Map
the Directory to the URI using an Alias and a
Directory and turn on normal WebDAV... Then return
Decline to Apache then tries to Match the URI to the
Modified Config. Which will active the correct module
for the correct folder...

However i need this configuration change to be
Temporary... Per request only... I need the Alias' or
Location/Directory sections to no longer exist..

What handler do i use? and how do i reset the
configuration?

--- Andy Armstrong <[EMAIL PROTECTED]> wrote:

> On 1 Mar 2006, at 21:44, Glenn Martin wrote:
> > Ive got a script im wokring on that uses the
> > "PerlMapToStorageHandler" at that point it adds to
> the
> > Apache Configuration using the Incomming URI,
> creating
> > Location/Directory Sections, and an Alias or
> two...
> >
> > However, i need to be able to remove these changes
> > after the request is completed... How would i
> remove
> > theses changes and what handler would you suggest
> for
> > me to tie in to?
> 
> You're doing it wrong I'm afraid. Why do you want to
> change the  
> server config during a request?
> 
> -- 
> Andy Armstrong, hexten.net
> 
> 



Re: Perl Script using MapToStorageHandler

2006-03-01 Thread Glenn Martin
If i am doing this wrong, how would you suggest doing
it?

Glenn R. Martin

--- Andy Armstrong <[EMAIL PROTECTED]> wrote:

> On 1 Mar 2006, at 21:44, Glenn Martin wrote:
> > Ive got a script im wokring on that uses the
> > "PerlMapToStorageHandler" at that point it adds to
> the
> > Apache Configuration using the Incomming URI,
> creating
> > Location/Directory Sections, and an Alias or
> two...
> >
> > However, i need to be able to remove these changes
> > after the request is completed... How would i
> remove
> > theses changes and what handler would you suggest
> for
> > me to tie in to?
> 
> You're doing it wrong I'm afraid. Why do you want to
> change the  
> server config during a request?
> 
> -- 
> Andy Armstrong, hexten.net
> 
> 



Re: Perl Script using MapToStorageHandler

2006-03-01 Thread Glenn Martin
Sounds great, but how would i do something simular to:

  $r->add_config([sprintf('', $uripath),
  'DirectoryIndex .',
  'Options +Indexes',
  'Dav svn',
  sprintf("SVNPath %s",
$localpath),
  '']);


and

  $r->add_config([sprintf('',
$localpath), 'DirectoryIndex .', 'Options +Indexes',
'Dav On', '']);


--- "Philippe M. Chiasson" <[EMAIL PROTECTED]>
wrote:

> Glenn Martin wrote:
> > Actually if i read the documentation correctly, im
> > doing it just right. Map to Storage is right
> before it
> > get mapped to a Location/Directory... and thus
> this is
> > where id want to add Directory/Location and Alias
> > directives based off of the incomming URI... Im
> trying
> > to control DAV input. Take the URI, translate it
> to a
> > Folder, Check the folders contents to see if it
> > matches a Subversion repository and if it does map
> the
> > Location to SVN Dav and that repository otherwise
> Map
> > the Directory to the URI using an Alias and a
> > Directory and turn on normal WebDAV... Then return
> > Decline to Apache then tries to Match the URI to
> the
> > Modified Config. Which will active the correct
> module
> > for the correct folder...
> 
> I hope I understood this correctly, so apologies if
> I didn't.
> 
> > However i need this configuration change to be
> > Temporary... Per request only... I need the Alias'
> or
> > Location/Directory sections to no longer exist..
> 
> You can't 'remove' configuration directives you've
> injected
> in httpd. And those are very *global* and would
> affect
> much more than the current request.
> 
> > What handler do i use? and how do i reset the
> > configuration?
> 
> You don't reset the configuration, but you simply
> take a different
> approach.
> 
> Instead of trying to inject httpd configuration,
> your MapToStorage handler
> needs to emulate Alias/Location directives. For
> instance, if you needed
> to Alias /foo to /var/www/foo, instead of doing what
> I believe you are currently
> doing:
> 
> $r->add_config(["Alias /foo /var/www/foo"]);
> 
> Simply do what mod_alias would have done...
> 
> $r->filename(File::Spec->catfile("/var/www",
> $r->uri));
> 
> And you get pre-request behaviour just like you
> wanted. And it's tons faster too ;-)
> 
>

> Philippe M. Chiasson
> m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID :
> 88C3A5A5
> http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680
> 1AE5 3631 CB32 A107 88C3A5A5
> 



Re: Perl Script using MapToStorageHandler

2006-03-01 Thread Glenn Martin
Sounds great, but how would i do something simular to:

  $r->add_config([sprintf('', $uripath),
  'DirectoryIndex .',
  'Options +Indexes',
  'Dav svn',
  sprintf("SVNPath %s",
$localpath),
  '']);


and

  $r->add_config([sprintf('',
$localpath), 'DirectoryIndex .', 'Options +Indexes',
'Dav On', '']);


--- "Philippe M. Chiasson" <[EMAIL PROTECTED]>
wrote:

> Glenn Martin wrote:
> > Actually if i read the documentation correctly, im
> > doing it just right. Map to Storage is right
> before it
> > get mapped to a Location/Directory... and thus
> this is
> > where id want to add Directory/Location and Alias
> > directives based off of the incomming URI... Im
> trying
> > to control DAV input. Take the URI, translate it
> to a
> > Folder, Check the folders contents to see if it
> > matches a Subversion repository and if it does map
> the
> > Location to SVN Dav and that repository otherwise
> Map
> > the Directory to the URI using an Alias and a
> > Directory and turn on normal WebDAV... Then return
> > Decline to Apache then tries to Match the URI to
> the
> > Modified Config. Which will active the correct
> module
> > for the correct folder...
> 
> I hope I understood this correctly, so apologies if
> I didn't.
> 
> > However i need this configuration change to be
> > Temporary... Per request only... I need the Alias'
> or
> > Location/Directory sections to no longer exist..
> 
> You can't 'remove' configuration directives you've
> injected
> in httpd. And those are very *global* and would
> affect
> much more than the current request.
> 
> > What handler do i use? and how do i reset the
> > configuration?
> 
> You don't reset the configuration, but you simply
> take a different
> approach.
> 
> Instead of trying to inject httpd configuration,
> your MapToStorage handler
> needs to emulate Alias/Location directives. For
> instance, if you needed
> to Alias /foo to /var/www/foo, instead of doing what
> I believe you are currently
> doing:
> 
> $r->add_config(["Alias /foo /var/www/foo"]);
> 
> Simply do what mod_alias would have done...
> 
> $r->filename(File::Spec->catfile("/var/www",
> $r->uri));
> 
> And you get pre-request behaviour just like you
> wanted. And it's tons faster too ;-)
> 
>

> Philippe M. Chiasson
> m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID :
> 88C3A5A5
> http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680
> 1AE5 3631 CB32 A107 88C3A5A5
> 



Re: Perl Script using MapToStorageHandler

2006-03-02 Thread Glenn Martin
Sure id love to see that script... to be completely
hones im still kinda new to perl even... Im getting it
slowly... Anyway, im just looking to achieve my goal
and that is to have a working script/perl module that
can switchout config based on incomming URI... a
perfect example would be the one im working on now...
the Subversion/Dav one...

Glenn

--- Torsten Foertsch <[EMAIL PROTECTED]> wrote:

> On Wednesday 01 March 2006 23:20, Glenn Martin
> wrote:
> > Sounds great, but how would i do something simular
> to:
> >
> >       $r->add_config([sprintf(' > "%s/?">', $uripath),
> >                           'DirectoryIndex .',
> >                           'Options +Indexes',
> >                           'Dav svn',
> >                           sprintf("SVNPath %s",
> > $localpath),
> >                           '']);
> >
> >
> > and
> >
> >       $r->add_config([sprintf('',
> > $localpath), 'DirectoryIndex .', 'Options
> +Indexes',
> > 'Dav On', '']);
> 
> That leads to an error saying that " not allowed at that point. 
> In your case I think you don't need the "Directory"
> around your 
> configuration, I think. But, let me explain how the
> configuration is applied 
> to a request. After startup when the configuration
> has been parsed you have a 
> server/vhost-specific default configuration. That is
> everything outside 
> "Directory", "Location" and so on. Just before
> MapToStorage a copy of this 
> config is made. Then the core-MapToStorage handler
> applies "Location", 
> "Directory" etc blocks to that copy. At the end of
> the request this copy is 
> thrown away.
> 
> The mod_perl MapToStorage handler comes in after the
> server-specific config is 
> loaded but before the core handler. In fact if the
> mp-handler returns OK the 
> core-handler is skipped.
> 
> When $r->add_config([EMAIL PROTECTED], $override) is applied
> in MapToStorage it is very 
> similar to
> 
> AllowOverride $override
> 
> @lines
> 
> 
> Only this location block is applied *before* any
> Directory block.
> 
> That means
> 
> 1) If your mp-handler returns DECLINED, your current
> configuration can be 
> overridden by the core-handler, because it comes
> after you.
> 
> 2) Anything you apply to the config in MapToStorage
> applies to a copy. Hence, 
> nothing is needed to undo the changes.
> 
> 3) Your config can be applied by
> 
> $r->add_config([
>                 'DirectoryIndex .',
>                 'Options Indexes',
>                 'Dav svn',
>                 sprintf("SVNPath %s", $localpath),  
>   
>], ~0) # ~0 == AllowOverride All
> 
> 
> But, a few thing cannot be applied by means of
> $r->add_config. For example 
> "AllowOverride" needs a "Directory" block or
> "ProxyPassReverse" does 
> different things if it appears outside or inside a
> "Location" block. Further, 
> mod_perl-2.0.2 cannot apply "Options" if working
> under Apache 2.2. For these 
> situations I have posted a patch a few days ago
> (last Friday I think). I hope 
> it will make it into mod_perl 2.0.3 see
> 
>  
>
http://www.gossamer-threads.com/lists/modperl/modperl/87401
> 
> In fact, I am currently working on a module that can
> read the configuration 
> from a database and apply it on the fly. It already
> works pretty good. If you 
> want I can send you a current copy. I think of
> releasing it on CPAN later 
> this week or early next week.
> 
> Torsten
> 



Crypt::CBC

2006-04-10 Thread Martin Moss
All,

I had some code which ran the old version of
Crypt::CBC (2.12).

Using these headers to create the object:-

my $cipher = new
Crypt::CBC($ENCRYPTION_KEY,'Blowfish');

I've now built a new machine. Copied the database
values (encrpypted using the above) onto the new
machine DB using mysqldump etc..

However I've found a problem in that the new machine
is built with Crypt::CBC version 2.17..

The above code does not work anymore as I now get the
following error...:-

Ciphertext does not begin with a valid header for
'salt' header mode at /usr/local/lib/perl/.

I tried doing this:-

my $cipher = new Crypt::CBC(
-key => $ENCRYPTION_KEY,
-cipher => 'Crypt::Blowfish',
-insecure_legacy_decrypt =>1
-header =>'randomiv'
-salt =>'1'
);

But I still get the error...

Any ideas what on earth I'm supposed to do to be able
to use my old information?

Marty



___ 
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars 
online! http://uk.cars.yahoo.com/


Re: Crypt::CBC

2006-04-10 Thread Martin Moss
Genius:-)  I think for the time being this is the best
way to go...  At least I'm up and running.. But I
presume this is going to bite me in the bum at a later
date...

--- Ian Joyce <[EMAIL PROTECTED]> wrote:

> You can always use version 2.12.
> 
> http://search.cpan.org/~lds/Crypt-CBC-2.12/
> 
> --Ian
> 
> 
> On 4/10/06, Martin Moss
> <[EMAIL PROTECTED]> wrote:
> > All,
> >
> > I had some code which ran the old version of
> > Crypt::CBC (2.12).
> >
> > Using these headers to create the object:-
> >
> > my $cipher = new
> > Crypt::CBC($ENCRYPTION_KEY,'Blowfish');
> >
> > I've now built a new machine. Copied the database
> > values (encrpypted using the above) onto the new
> > machine DB using mysqldump etc..
> >
> > However I've found a problem in that the new
> machine
> > is built with Crypt::CBC version 2.17..
> >
> > The above code does not work anymore as I now get
> the
> > following error...:-
> >
> > Ciphertext does not begin with a valid header for
> > 'salt' header mode at /usr/local/lib/perl/.
> >
> > I tried doing this:-
> >
> > my $cipher = new Crypt::CBC(
> > -key => $ENCRYPTION_KEY,
> > -cipher => 'Crypt::Blowfish',
> > -insecure_legacy_decrypt =>1
> > -header =>'randomiv'
> > -salt =>'1'
> > );
> >
> > But I still get the error...
> >
> > Any ideas what on earth I'm supposed to do to be
> able
> > to use my old information?
> >
> > Marty
> >
> >
> >
> >
>
___
> > NEW Yahoo! Cars - sell your car and browse
> thousands of new and used cars online!
> http://uk.cars.yahoo.com/
> >
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


[MP2] Is there anything shared between threads in threaded MPMs like the Winnt one?

2006-04-15 Thread Lionel MARTIN



 

Hi,
 
I'm using MP v2.02, along with ActivePerl 
v5.8.8 and Apache v2.054, all that under Windows XP.
 
Under Win32, the Apache memory model is a threaded 
model, i.e. we have one master Apache process,and, then, one unique child 
process, containing several threads, that can, if needed, use Perl Interpreters 
taken from an interpreter pool.
This is what I have understood so far.
 
So, I'm trying to understand what's really shared 
when preloading modules from httpd.conf, and which benefits I could get from 
doing that.
 
The problem is that I can't really understand 
what's kept shared when new Perl interpreters are started.
 
From the MP docs, I have read that, among 
others:
Care is taken by Perl to copy only mutable data, 
which means that no runtime locking is required and read-only data such as the 
syntax tree is shared from the parent, which should reduce the overall mod_perl 
memory footprint. 
 
I made tests to understand that. For example, a 
simple basic test has been to create a module with a simple basic 
sub:
 

package Modules::MyPack;sub 
test{ 1;}1;


 
Then, I preloaded it in the parent process, 
including a "PerlRequire Modules/MyPack.pm" in httpd.conf.
 
At last, I wanted to make a test in a siple script, 
like that:
 


my $sub = \&Modules::MyPack::test;open 
FILE, ">>", "test.txt";print FILE $sub, "\n";close 
FILE;


 
The purpose of this test is to see what is the 
actual memory address of &Modules::MyPack::test.
 
I ran this test with 3 concurrent Perl Intepreters 
and noticed that the returned address is different for each of them, which makes 
me think that there isn't any memory sharing, even for a simple preloaded 
subroutine. Indeed, I would have believed, if this very basic subroutine had 
been shared among intepreters, them to have the same actual memory 
address.
 
Am I getting wrong?
 
What's actually being shared among intepreters? How 
could I simply test the fact stuff is actually shared?
 
Thanks in advance,
 
Lionel.
 


Re: How many people use the Windows combo of Apache2 + mod_perl2 ?

2006-04-26 Thread Lionel MARTIN

Hi,

I'm having the same kind of interrogation.

Concerning me, I'm working on a project that's still in development, and I'm
developing under Windows (MP2, ActivePerl 5.8.8 Build 816 , Apache 2.055)
I'll have to make a choice for the production environment, and I'm not sure
what to choose. I'll have to make tests.

Of course, most people seem to use a LAMP environment, and most docs are
Linux flavoured.

Under Windows, when launching my Apache Server, there seems to be 4 starts
in all (Start -> Restart -> Start -> Restart). I can see that with preloaded
modules, that are loaded 4 times in all.

Moreover, I'm not sure how efficient is the Winnt MPM, related to Perl.
As you know, under Windows, the server is working in a threaded environment
(one child process containing several threads). As there's just one child,
the PerlChildInitHandler is quite useless, and it would be good to have a
grasp at Thread starts (having something like a "PerlThreadInitHandler" or a
"PerlInterpInitHandler" to be able to initialize Perl Interpreter specific
stuff)

But I'm quite confident I'll be able to use a Windows environment for my
production server, things tseem to have improved a lot (even if I'll make
comparisons anyway with a LAMP environment, in term of CPU usage, and memory
sharing efficiency)

- Original Message - 
From: "Foo Ji-Haw" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, April 26, 2006 8:21 AM
Subject: How many people use the Windows combo of Apache2 + mod_perl2 ?



Just want to do a quick poll here.

Most of the comments I read here, come from people who use the Linux/ BSD
platform. Is there anybody who actually deploy the Windows combo on a
production server? For those who do, do you have any issues that are
Windows-specific?

For me for example, my gripe is that I cannot use
ServerUtil::restart_count to determine the instance of the final startup
of the service, due to the implementation nature of mp2



  1   2   >