RE: [mp2] apache/mod_perl starup failure using cvs 09

2003-03-05 Thread Beau E. Cox


 -Original Message-
 From: Stas Bekman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 04, 2003 9:23 PM
 To: Beau E. Cox
 Cc: Modperl
 Subject: Re: [mp2] apache/mod_perl starup failure using cvs 09
 
 
 [...]
 
 why does Mason needs $r at the server startup? There is no
 request object at
 the server startup, so it's only fair that mp reports the error.
 
 [...]
 
  Would you have and suggestions from the mod_perl perspective?
  I will take this query over to mason if you feel that is where
  it belongs - but I'll need some further insight into the mod_perl
  changes.
 
 I see what you mean. In mp1 you relied on Apache-request's not 
 being defined 
 as a side-effect to test whether you are inside request or not.
 
 I will explain why I've chosen to croak, rather than return 'undef'.
 
 In mp1 Apache-request was either undef (outside of request) or 
 $r (during the 
 request). You couldn't control that. In mp2 in order to optimize things, 
 keeping the global request around is optional. So if you don't 
 need it you get 
 some speed improvement.
 
 So if the user has the global request setting off and 
 Apache-request returns 
 undef, he may think that he is not inside the request phases 
 (precisely what 
 mason does), which is wrong.
 
 Therefore if you still wish to rely on this (which is no longer 
 always valid 
 under mp2), you can do:
 
eval { $r = Apache-request}
 
 to trap the croak.
 
 may be you should use something else as a predicate to calling 
 Apache-request. For example you could use:
 
 ModPerl::Util::current_callback() to figure out where you are. 
 Though it'll 
 incur a checking of several options. So perhaps we need a new 
 method or may be 
 not. Ideas are welcome.
 
 Philippe has agreed with my reasoning when I've suggested the change and 
 nobody else has objected (or had any opinion at all), so it went 
 in. Since 
 nothing is cast is stone (yet) on the mp2 API, you may suggest your 
 explanation why it should behave differently if you think that my 
 idea is wrong.
 
 __
 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
 

Yea, Stas, I clearly see your reasoning. However, this is not a change
of behaviour between mp1 and mp2, but rather between mp2-08 and the
current cvs (09). I will continue using mp2-08 and talk to the mason
list - but it seems that folks over there are not too anxious to
do much in the line of mp2 development until the 'request' is converted.

My only concern is that mp2 and mason will eventually work well
together - I feel a little like I am caught in the middle ;)

Please don't spend any more time on this until I get a mason answer.

Aloha = Beau; 



Re: [mp2] apache/mod_perl starup failure using cvs 09

2003-03-05 Thread Stas Bekman
Beau E. Cox wrote:
Yea, Stas, I clearly see your reasoning. However, this is not a change
of behaviour between mp1 and mp2, but rather between mp2-08 and the
current cvs (09). 
since 09  08, it *is* a change in behaviour between mp1 and mp2 ;) though 
potentially not the final one.

I will continue using mp2-08 and talk to the mason
meanwhile you can continue using the lates cvs, but add to the beginning of 
your startup to cheat on the latest change:

require Apache::RequestUtil;
no warnings 'redefine';
my $sub = *Apache::request{CODE};
*Apache::request = sub {
my $r;
eval { $r = $sub-('Apache'); };
# warn $@ if $@;
return $r;
};
list - but it seems that folks over there are not too anxious to
do much in the line of mp2 development until the 'request' is converted.
You mean Apache::Request?

My only concern is that mp2 and mason will eventually work well
together - I feel a little like I am caught in the middle ;)
if you don't mind to get frustrated here and there, that's the best position 
to learn things ;)

Please don't spend any more time on this until I get a mason answer.
;)

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::DBI on mp2

2003-03-05 Thread Ask Bjoern Hansen
On Wed, 5 Mar 2003, Stas Bekman wrote:

 Great. I've already committed that patch.

 Perhaps Ask could load 'Apache::compat' inside Apache::DBI if mp2 is used. Or
 to use the mp2 API if mp2 is used.

That seems like it'll be an easy solution.  I thought loading
Apache::compat would have global side effects though?  (i.e. for
people trying to make their system run without Apache::compat).


  - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::DBI on mp2

2003-03-05 Thread Stas Bekman
Ask Bjoern Hansen wrote:
On Wed, 5 Mar 2003, Stas Bekman wrote:


Great. I've already committed that patch.

Perhaps Ask could load 'Apache::compat' inside Apache::DBI if mp2 is used. Or
to use the mp2 API if mp2 is used.


That seems like it'll be an easy solution.  I thought loading
Apache::compat would have global side effects though?  (i.e. for
people trying to make their system run without Apache::compat).
Please scratch that idea than ;) Though it can be documented, including the 
Apache::compat warning ;)

And instead simply add the code to handle it differently if $mod_perl::VERSION 
= 1.99, using the 2.0 API.



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: [mp2] apache/mod_perl starup failure using cvs 09

2003-03-05 Thread Beau E. Cox
Hi Stas -

 -Original Message-
 From: Stas Bekman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 04, 2003 10:45 PM
 To: Beau E. Cox
 Cc: Modperl
 Subject: Re: [mp2] apache/mod_perl starup failure using cvs 09


 Beau E. Cox wrote:
  Yea, Stas, I clearly see your reasoning. However, this is not a change
  of behaviour between mp1 and mp2, but rather between mp2-08 and the
  current cvs (09).

 since 09  08, it *is* a change in behaviour between mp1 and mp2
 ;) though
 potentially not the final one.

  I will continue using mp2-08 and talk to the mason

 meanwhile you can continue using the lates cvs, but add to the
 beginning of
 your startup to cheat on the latest change:

 require Apache::RequestUtil;
 no warnings 'redefine';
 my $sub = *Apache::request{CODE};
 *Apache::request = sub {
  my $r;
  eval { $r = $sub-('Apache'); };
  # warn $@ if $@;
  return $r;
 };

  list - but it seems that folks over there are not too anxious to
  do much in the line of mp2 development until the 'request' is converted.

 You mean Apache::Request?

Yes...

 [...]

Your fix works perfectly - I'm a happy camper. I passed our discussion
to the mason list - will keep you folks informed.

Aloha = Beau;

PS: Have you ever noticed the closer your deadline becomes, the more
things go wrong and the more mistakes you make?




Reading an array from perl script

2003-03-05 Thread Devi .M
Hello All,
I have a perl script that would be running infinitely and updating
an array by processing some data. Now I would like to read the array
values that should not disturb this perl script.
I thought to use the concept of shared variable and write a method
in perl module which contains the array sharring with the infinitely
running perl script and return me the updated array values. But don't know 
how to proceed with this. Could anyone help me out?

Thanks in advance,
Devi




-
 Much of the excitement we get out of our work is 
that we don't really know what we are doing.






[mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Mark James
I'm having CGI redirect problems mp2 (cvs).

Instead of being redirected to the proper web page, I'm sometimes
getting a 302 Moved page containing a link to the correct URL.
Seems to be related to the following code in modperl_cgi.c:

if (location  (location[0] == '/')  (r-status == 200)) {
r-method = apr_pstrdup(r-pool, GET);
r-method_number = M_GET;
The Location field I'm redirecting to is a fully-qualified URL,
starting with http://, but still at the local server.  A debug
put in above this code confirms that location is set to a
string starting with http.
Why is the test for location[0] == '/' there?  Which section
of code is usually responsible for stripping off the server
part of the address if it is local?
Mark



Re: mp2 runs scripts as root?

2003-03-05 Thread Mark James
Stas Bekman wrote:

...
Well, actually this is not the case. It behaves exactly the same as in 
modperl 1.0. You can use Env::C module (available from CPAN) to easily 
debug this:
...
In any case you probably want to rely on getpwuid($), rather than 
$ENV{USER} if applicable.
Unfortunately ci (RCS) uses the USER variable to determine lock
permissions for edits.
But using your Env::C::setenv to set USER instead of assigning to
$ENV{'USER'} allowed me to remove the ENV assigments from start-up.pl.
This'll make my package more turn-key.
Thanks again -- Mark




Re: Reading an array from perl script

2003-03-05 Thread Mark James
Devi .M wrote:
Hello All,
	I have a perl script that would be running infinitely and updating
an array by processing some data. Now I would like to read the array
values that should not disturb this perl script.
	I thought to use the concept of shared variable and write a method
in perl module which contains the array sharring with the infinitely
running perl script and return me the updated array values. But don't know 
how to proceed with this. Could anyone help me out?
Perhaps this IPC::Shareable - share Perl variables between processes
package would be suitable:
http://search.cpan.org/author/BSUGARS/IPC-Shareable-0.60/lib/IPC/Shareable.pm

Mark



Re: mod_perl Cookbook example

2003-03-05 Thread Geoffrey Young


ASHISH MUKHERJEE wrote:
 Hello! I was trying Recipe 11.3 from the mod_perl Cookbook
 (Cookbook::Timer). Does this measure real download speed or does it
 merely measure server processing time?
well, it measures the time that it takes Apache to complete the response. 
this is dependent on a number of factors, such as the speed of your server 
as well as the end-user connection speed.

 I understand it takes the time
 diff between the PostReadRequet and Logging stages. Is the LogHandler
 phase entered only once the response has fully reached the client?
as many log handlers are run as are configured but yes, it runs after the 
client has received the response.  in reality, the connection to the client 
is still open, so the client may think there is more data coming, but there 
isn't.

HTH

--Geoff




Re: internal_redirect and returns

2003-03-05 Thread Geoffrey Young
[snip]
I use this subroutine:

sub let_through {
my ($self, $r, $p) = @_;
$r-set_handlers( PerlAuthzHandler = [\OK] );
$r-set_handlers( PerlAuthenHandler = [\OK] );
$p  $r-internal_redirect( $p );
return OK;
}
And under some circumstances might call:
return $self-let_through( $r, $login_page );
for instance.
When this happen I find that the page shows ( $login_page ), but the browser
continues to show loading.
I check the error log and find:
message type 0x50 arrived from server while idle
IIRC, you can only call internal_redirect from a content handler.  from your 
code I suspect that you're not doing that, since it would be too late to 
unset the auth phases.

HTH

--Geoff



Re: [ANNOUNCE] Apache Hello World Benchmarks v1.02

2003-03-05 Thread Josh Chamas
Ask Bjoern Hansen wrote:
On Tue, 4 Mar 2003, Josh Chamas wrote:


I thought it was interesting that Embperl 2 (barely) beat out PHP 4.3.0
on XSLT in both the XSLT Hello  XSLT Big tests.


Why is that interesting?  A bit more background would be
interesting. :-)   (post it to the list maybe).
My experience has been that raw mod_perl handlers, PHP scripts  Resin JSP
tend to be the fastest on the benchmarks generally ( aside from the pure
C handlers of course! ) ... so when Embperl2 beats out PHP on the XSLT tests,
I was a bit surprised, especially since both of the benchmarks are using
libxslt ( http://xmlsoft.org/XSLT/ ).
Neither environment seems to have a XSLT specific caching mechanism,
so I would have guessed that PHP would beat out Embperl2.  Gerald
must have done a fine job on the Embperl XSLT implementation to
beat out PHP here.
Perhaps its due to that PHP does not really integrate XSLT other than
some additional API calls.  The script itself is causing the XSLT
rendering to happen:
?php
$xmldoc = domxml_open_file('hxslt.xml');
$xsldoc = domxml_xslt_stylesheet_file('hello.xsl');
$result = $xsldoc-process($xmldoc);
echo $xsldoc-result_dump_mem($result);
?
This differs from Embperl where the application layer itself handles
the XSLT rending, not the script/XML file:
PerlSetEnv EMBPERL_RECIPE LibXSLT
PerlSetEnv EMBPERL_XSLTPROC libxslt
PerlSetEnv EMBPERL_XSLTSTYLESHEET $ROOT/hello.xsl
So perhaps Embperl 2 is able to do some things like caching of style
sheets and the like internally that PHP doesn't do for one?
Regards,

Josh


Josh Chamas, Founder   phone:925-552-0128
Chamas Enterprises Inc.http://www.chamas.com
NodeWorks Link Checkinghttp://www.nodeworks.com


Bug: system()-Call: CmdLine more than 128 Chars

2003-03-05 Thread Mark Plomer
Hi,
My Config:
  - Windows 98 SE (+ all WinUpdate-Patches)
  - Apache 2.0.44  (+ apr-Patch)
  - ActivePerl 5.8.0 (ActivePerl-5.8.0.804-MSWin32-x86.msi)
  - mod_perl 1.99_09-dev (ppm install
http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd;)

I have the following Problem:
When I call system() from a Perl-Script with a CommandLine
longer than (merged) about 128 Characters (not exact 128):

  system('prog','1234567890123456789012345678901234567890
1234567890123456789012345678901234567890
1234567890123456789012345678901234567890
1234567890'); # In one line

- then Perl does not execute the program, but the Apache-Console-Window
shows the DOS-Command-Prompt (as I started command.com),
and the Thread hangs, of course, and waits for input.

Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.

C:\

When I repeat this MaxThreads-times, Apache does not respond any more.

But:
- When I run the Perl-Script as CGI with Perl 5.8 it works fine.
- And also if I run ActivePerl-5.6.1.635 it works fine with mod_perl.

It seems to be a Bug in either mod_perl or Perl itself,
(Or a forgotton Workaround on a Windows-Bug *g*), i don't know.

Thanks
- Mark




Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Nick Tonkin

How are you telling the server to redirect? You do know it's different
from mp1, right?

In mp2 you need to do:

my $location = 'http://foo.bar.baz';

$r-headers_out-{'Location'} = $location;
# Or use $r-err_headers_out-{'Location'} which you will have
# to do with any other headers you want to have sent with the
# redirect, such as cookies

return Apache::HTTP_MOVED_TEMPORARILY;
# Apache::REDIRECT still supported, this is the correct
# constant though.

On Wed, 5 Mar 2003, Mark James wrote:

 I'm having CGI redirect problems mp2 (cvs).


How are you telling the server to redirect? You do know it's different
from mp1, right?

In mp2 you need to do:

my $location = 'http://foo.bar.baz';

$r-headers_out-{'Location'} = $location;
# Or use $r-err_headers_out-{'Location'} which you will have
# to do with any other headers you want to have sent with the
# redirect, such as cookies

return Apache::HTTP_MOVED_TEMPORARILY;
# Apache::REDIRECT still supported, this is the correct
# constant though.

Now that I think about it, maybe you're using CGI.pm to do your redirect?
If so, maybe the code in CGI.pm has not been correctly updated?


Hope this helps.

- nick

-- 


Nick Tonkin   {|8^)



Re: Tracing double accesshandler invocation

2003-03-05 Thread Nick Tonkin
On Wed, 5 Mar 2003, Richard Clarke wrote:

 Hi,
 I'm trying to figure out why my accesshandler is getting triggered twice
 for each request that I make. I'm 100% sure that I'm doing no explicit
 lookups/redirects anywhere in my code. The particular uri I am fetching
 should only invocate an accesshandler followed by a contenthandler.
 After watching the request with MOD_PERL_TRACE=h and MOD_PERL_TRACE=all I
 think I'm still non the wiser.
 Testing for $r-is_initial_req solves the problem but I'm more interested
 in finding out exactly why it's being called twice.
 Any tips for tracing this easier?

Nope, but FWIW I see the same behavior. I'm using mp2, but IIRC the same
thing used to happen on mp1 too.

I too would very much like to figure this out. I sort of suspect it is in
how the httpd.conf auth* directives are specified, but I've never had the
time to really muck around with them.

- nick

-- 


Nick Tonkin   {|8^)



register_cleanup on mod_perl 2.0

2003-03-05 Thread Denis Banovic
Hi!

I've a script that looks like this:

if ($runnung_on_mod_perl) {
Apache-request-register_cleanup(\init_globals);
}

Under mod_perl 1.0 works fine with Apache::Registry.

Can someone give me an Example how to make a register_cleanup with mod_perl
2?

Thanks a lot

Denis 


Re: Tracing double accesshandler invocation

2003-03-05 Thread Nick Tonkin
On Wed, 5 Mar 2003, Richard Clarke wrote:

 Hi,
 I'm trying to figure out why my accesshandler is getting triggered twice
 for each request that I make. I'm 100% sure that I'm doing no explicit
 lookups/redirects anywhere in my code. The particular uri I am fetching
 should only invocate an accesshandler followed by a contenthandler.
 After watching the request with MOD_PERL_TRACE=h and MOD_PERL_TRACE=all I
 think I'm still non the wiser.
 Testing for $r-is_initial_req solves the problem but I'm more interested
 in finding out exactly why it's being called twice.
 Any tips for tracing this easier?

 Ric.

Nope, but FWIW I see the same behavior. I'm using mp2, but IIRC the same
thing used to happen on mp1 too.

I too would very much like to figure this out. I sort of suspect it is in
how the httpd.conf auth* directives are specified, but I've never had the
time to really muck around with them.

- nick

-- 


Nick Tonkin   {|8^)



Serving two pages consecutively

2003-03-05 Thread Jim Morrison [Mailing-Lists]
Hi,

Anyone got a good/simple way of serving two pages consecutively with the
minimum of load/hassle etc? Preferably just serving two pages from the
same process.

The reason being that I need to go off and get quite a bit of date from
various places and I wanted to feed it back into the page piecemeal, so
the user gets the impression something's happening...  When all the data
is collected I'd like to move them onto a properly published page.. 

There is an example of the effect I'm after if you run a couple of
domains through:

 http://www.marketleap.com/siteindex/default.htm


Thanks,


Jimbo


_
Jim Morrison
Technology  Development Partner
Isotope Communications
9 Green Park Station
Bath, BA1 1JB, UK
+44 (0) 1225 444 674





RE: Serving two pages consecutively

2003-03-05 Thread FFabrizio

IIRC, we just had a thread on this a week or two back.  We discussed a
couple of solutions Randal had turned into columns in addition to some other
suggestions.  Maybe peek through the archives?  The thread title I believe
was 'Please wait Handler' but talked about ways to serve the data piecemeal
too.

-Fran

 -Original Message-
 From: Jim Morrison [Mailing-Lists] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 05, 2003 11:07 AM
 To: [EMAIL PROTECTED]
 Subject: Serving two pages consecutively
 
 
 Hi,
 
 Anyone got a good/simple way of serving two pages 
 consecutively with the
 minimum of load/hassle etc? Preferably just serving two pages from the
 same process.
 
 The reason being that I need to go off and get quite a bit of 
 date from
 various places and I wanted to feed it back into the page 
 piecemeal, so
 the user gets the impression something's happening...  When 
 all the data
 is collected I'd like to move them onto a properly published page.. 
 
 There is an example of the effect I'm after if you run a couple of
 domains through:
 
  http://www.marketleap.com/siteindex/default.htm
 
 
 Thanks,
 
 
 Jimbo
 
 
 _
 Jim Morrison
 Technology  Development Partner
 Isotope Communications
 9 Green Park Station
 Bath, BA1 1JB, UK
 +44 (0) 1225 444 674
 
 
 


RE: Trouble with sysread in modperl

2003-03-05 Thread Liu, Hui (GXS)
Title: RE: Trouble with sysread in modperl





Stas,


 Yes we tried reading STDIN and it works:


 while ($readData = STDIN) {
 $buffer .= $readData;
 $bufferLength = length($buffer);
 ..
 }


 But it's not working with sysread or read, here are the results for read, the last line is what we expected but it's null:

 while ($bytesRead = read(STDIN, $buffer, 4096)) {
 html(bytesRead=[$bytesRead] data="" if ($debug);
 }


Here's the results from the above code :


bytesRead=[4096] data="">
Content-Disposition: form-data; name=sessionId


SYSTEM-admin-156534-0993
-7d33e41f304f2
Content-Disposition: form-data; name=userId


SYSTEM-admin
-7d33e41f304f2
Content-Disposition: form-data; name=bankKey


RB_AFG
-7d33e41f304f2
Content-Disposition: form-data; name=returnTo


uploadFileToEnterprise.main
-7d33e41f304f2
Content-Disposition: form-data; name=target


_top
-7d33e41f304f2
Content-Disposition: form-data; name=enterpriseConfName


send810Chrysler
-7d33e41f304f2
Content-Disposition: form-data; name=uploadFile; filename=D:\webstuff\rbc\Docs\810credit
Content-Type: text/plain


HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3549
PR|2308|27042.11
VR|1B7GL22N5YS708674|DAKR/C|2000
IR||27042.11|1769.11
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3549
PR|2308|39611.40
VR|1B7KF23Z71J222401|RAMC/Q|2001
IR||39611.40|2591.40
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3549
PR|2308|25377.19
VR|2B4GP2537YR757792|CARAVN|2000
IR||25377.19|1660.19
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3587
PR|2308|30879.13
VR|1B4GP44L7YB689425|GRDCAR|2000
IR||30879.13|2020.13
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|33067.28
VR|1B4GP44L7YB680806|GRDCAR|2000
IR||33067.28|2163.28
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|41202.49
VR|1B4HS28N4YF243809|DURNGO|2000
IR||41202.49|2695.49
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|29377.92
VR|1B7GG22N3YS698862|DAKR/C|2000
IR||29377.92|1921.92
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|42183.68
VR|1B7KF236X1J219823|RAMC/Q|2001
IR||42183.68|2759.68
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|45825.96
VR|1B7KF23651J219504|RAMC/Q|2001
IR||45825.96|2997.96
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|42716.54
VR|1B7KF23661J219494|RAMC/Q|2001
IR||42716.54|2794.54
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|42183.68
VR|1B7KF23681J219822|RAMC/Q|2001
IR||42183.68|2759.68
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|47334.66
VR|1B7MF33621J228921|RAMC/Q|2001
IR||47334.66|3096.66
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|46155.52
VR|1B7MF33791J217374|RAMC/Q|2001
IR||46155.52|3019.52
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|25799.84
VR|2B4GP2534YR748242|CARAVN|2000
IR||25799.84|1687.84
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|31910.61
VR|2C3HH56JXYH323217|INTRED|2000
IR||31910.61|2087.61
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|31910.61
VR|2C3HH56J1YH323218|INTRED|2000
IR||31910.61|2087.61
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3804
PR|2308|28307.92
VR|3B7HC13Y41G193297|RAMC/Q|2001
IR||28307.92|1851.92
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3823
PR|2308|45550.97
VR|1B7KF23611J219659|RAMC/Q|2001
IR||45550.97|2979.97
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3823
PR|2308|49393.34
VR|1B7MF33701J216680|RAM]
bytesRead=[4096] data="">
IR||49393.34|3231.34
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3823
PR|2308|28950.99
VR|3B7HC12Y01G193301|RAMC/Q|2001
IR||28950.99|1893.99
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162
DR||3917
PR|2308|38028.87
VR|1B4HS28N0YF233603|DURNGO|2000
IR||38028.87|2487.87
TR
HR|810|P||2307|071034|DEBIT
MR|CHRYSLER CANADA|2479
BR|BANK OF MONTREAL|000124162

RE: Serving two pages consecutively

2003-03-05 Thread Jim Morrison [Mailing-Lists]
Cheers Fran,

Found it all... I'll have a play...

 - Jimbo

 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 Sent: 05 March 2003 16:29
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: Serving two pages consecutively
 
 
 IIRC, we just had a thread on this a week or two back.  We discussed a
 couple of solutions Randal had turned into columns in addition to some
 other
 suggestions.  Maybe peek through the archives?  The thread title I
believe
 was 'Please wait Handler' but talked about ways to serve the data
 piecemeal
 too.
 
 -Fran
 
  -Original Message-
  From: Jim Morrison [Mailing-Lists] [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 05, 2003 11:07 AM
  To: [EMAIL PROTECTED]
  Subject: Serving two pages consecutively
 
 
  Hi,
 
  Anyone got a good/simple way of serving two pages
  consecutively with the
  minimum of load/hassle etc? Preferably just serving two pages from
the
  same process.
 
  The reason being that I need to go off and get quite a bit of
  date from
  various places and I wanted to feed it back into the page
  piecemeal, so
  the user gets the impression something's happening...  When
  all the data
  is collected I'd like to move them onto a properly published page..
 
  There is an example of the effect I'm after if you run a couple of
  domains through:
 
   http://www.marketleap.com/siteindex/default.htm
 
 
  Thanks,
 
 
  Jimbo
 
 
  _
  Jim Morrison
  Technology  Development Partner
  Isotope Communications
  9 Green Park Station
  Bath, BA1 1JB, UK
  +44 (0) 1225 444 674
 
 
 



Can anyone Rcommend a good Apache mailing list

2003-03-05 Thread Martin Moss
All,

I'm having issues with conflicts between using Port and Listen directives
for access via LAN and ssh tunnel (or proxy).
Can anyone recommend a mailing list I can post my problem to?

Kind Regards

Marty

From les Rosbeufs to les Grenuoilles, Standing up to a bully bigger than
you is bravery in motion.  (Me.)



Wanted: Experience with EmbPerl on Win2000/Apache HTTPD?

2003-03-05 Thread Richard Heintze
Since I had such a tough time installing mod_perl on
Win2000, I thought I would solicit for experiences
getting Hello, World running with EmbPerl on Apache
HTTPD on Windows2000.

What URL did you download embperl from? 
Did you get any errors during installation?
What is the URL you used for installation
instructions?
What is the URL you used for the instructions for
getting HelloWorld to appear?

  Thanks,
  Siegfried

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Nick Tonkin
On Thu, 6 Mar 2003, Mark James wrote:

 Nick Tonkin wrote:

  Now that I think about it, maybe you're using CGI.pm to do your redirect?
  If so, maybe the code in CGI.pm has not been correctly updated?

 Yes Nick, I'm using CGI.pm version 2.91 (the latest).  Its redirect code
 sends a Status: 302 Moved.

That wouldn't be the problem, if there is one. The problem would be in how
CGI.pm sets the Location header, noting the differences in syntax I
pointed out earlier.

You might try one of the CGI mailing lists to see if anyone there knows
whether the code is compliant with what I posted before. The documentation
is at http://xrl.us/dfb

Otherwise, try setting the redirect location manually as I showed you and
see if the problem persists.


- nick

-- 


Nick Tonkin   {|8^)



Re: SetConsoleMode failed, LastError=|6| at C:/Perl/site/lib/Term/ReadKey.pmline 268, STDIN line 6.

2003-03-05 Thread Randy Kobes
On Tue, 4 Mar 2003, Richard Heintze wrote:

 I just downloaded the all-in-one and, as per Randy's
 instructions, abandoned my current installations of
 Apache2 and perl5.8 by uninstalling them.
 
 I just typed in the perl configure.pl command and I
 receive:
 
 SetConsoleMode failed, LastError=|6| at
 C:/Perl/site/lib/Term/ReadKey.pm line 26
 8, STDIN line 6.
 cpan
 
 Should I be concerned? Actually, here are all the
 error messages at the end of this email message.
 Apparently most of them are warning messages.

All of them are warnings - the majority are from converting the
pod to html, which can be ignored, and the last one, about
SetConsoleMode, is that the TERM environment variable is either
not set or else set to something that Term::ReadKey doesn't
understand. This can also be ignored, or else you can set the
TERM environment variable to something like 'dumb' to get rid of
the warning.

I thought of having the configure script run in silent mode to
suppress these warnings, but it takes so long for the html
conversion that I thought it might give the impression of being
hung up.
 
 Also, what is httpd-win.conf for? Which one is being
 used, httpd.conf or httpd-win.conf?

If you start Apache as
   Apache -k start
it'll use httpd.conf by default. You can alter this by using
the -f option - do a 'Apache -h' to get a list of options.
The httpd-win.conf file is the base one included in the
Apache2 distribution.

The supplied httpd.conf included in the distribution includes
some example configuration for a ModPerl::Registry script and for
a simple Hello World content handler, as well as a simple
Apache::ASP and HTML::Mason page (not Embperl yet, as that isn't
quite ready for Win32 Apache2/mod_perl2).

-- 
best regards,
randy



Re: Reading an array from perl script

2003-03-05 Thread Stas Bekman
Devi .M wrote:
Hello All,
	I have a perl script that would be running infinitely and updating
an array by processing some data. Now I would like to read the array
values that should not disturb this perl script.
	I thought to use the concept of shared variable and write a method
in perl module which contains the array sharring with the infinitely
running perl script and return me the updated array values. But don't know 
how to proceed with this. Could anyone help me out?
I'm assuming that you need to connect to it from mod_perl, otherwise this 
question is quite offtopic here ;)

As suggested by Mark, IPC::Shareable might work if the data set is small. If 
it's big you can use a simple dbm to store the data in and with proper locking
read/write to/from it without disturbing each other.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Stas Bekman
Mark James wrote:
I'm having CGI redirect problems mp2 (cvs).

Instead of being redirected to the proper web page, I'm sometimes
getting a 302 Moved page containing a link to the correct URL.
Seems to be related to the following code in modperl_cgi.c:

if (location  (location[0] == '/')  (r-status == 200)) {
r-method = apr_pstrdup(r-pool, GET);
r-method_number = M_GET;
The Location field I'm redirecting to is a fully-qualified URL,
starting with http://, but still at the local server.  A debug
put in above this code confirms that location is set to a
string starting with http.
Why is the test for location[0] == '/' there?  Which section
of code is usually responsible for stripping off the server
part of the address if it is local?
as the comment just above this line says, that code was copy-n-pasted from 
mod_cgi. Can you reproduce the same problem while running a cgi script?

Also could it be that it has to do with the recent change, I've applied which 
was already reported by Beau as broken. May be your headers don't get parsed 
What happens if you do:

Index: src/modules/perl/modperl_filter.c
===
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.54
diff -u -r1.54 modperl_filter.c
--- src/modules/perl/modperl_filter.c   3 Mar 2003 03:39:06 -   1.54
+++ src/modules/perl/modperl_filter.c   5 Mar 2003 23:15:44 -
@@ -55,7 +55,7 @@
 apr_bucket *bucket;
 const char *work_buf = buf;
-if (wb-header_parse  !wb-r-content_type) {
+if (wb-header_parse) {
 request_rec *r = wb-r;
 const char *bodytext = NULL;
 int status;


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Reading an array from perl script

2003-03-05 Thread Perrin Harkins
Stas Bekman wrote:
As suggested by Mark, IPC::Shareable might work if the data set is 
small. If it's big you can use a simple dbm to store the data in and 
with proper locking
read/write to/from it without disturbing each other.
Yes, and the MLDBM::Sync module would handle that for you behind the scenes.

- Perrin



Re: Can anyone Rcommend a good Apache mailing list

2003-03-05 Thread Stas Bekman
Martin Moss wrote:
All,

I'm having issues with conflicts between using Port and Listen directives
for access via LAN and ssh tunnel (or proxy).
Can anyone recommend a mailing list I can post my problem to?
http://httpd.apache.org/lists.html#http-users

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: register_cleanup on mod_perl 2.0

2003-03-05 Thread Stas Bekman
Denis Banovic wrote:
Hi!

I've a script that looks like this:

if ($runnung_on_mod_perl) {
Apache-request-register_cleanup(\init_globals);
}
Under mod_perl 1.0 works fine with Apache::Registry.

Can someone give me an Example how to make a register_cleanup with mod_perl
2?
A copy-n-paste from Apache/compat.pm:

sub register_cleanup {
shift-pool-cleanup_register(@_);
}
if you use Apache::compat, your mp1 code will work under mp2 unmodified.

__
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


Transparent front-end proxying for many VirtualHosts

2003-03-05 Thread Andrew Ho
Hello,

I've looked through the mod_rewrite and Guide documentation and can't seem
find an answer for this, but feel free to point me at TFM to R if I just
missed it.

I have an Apache with many VirtualHosts, and I want to setup proxying so
that a lightweight frontend Apache with mod_rewrite/mod_proxy proxies
Apache::Registry script requests back to a heavyweight backend Apache
running on a localhost-only port.

I want to simplify my configuration in two ways. I'd prefer not to
maintain two sets of VirtualHost configuration data, and I'd like it if
the block that proxies .pl files to the backend proxy not be replicated
per VirtualHost.

The conceptual behavior I want, is for FilesMatch \.pl$ to be proxied
by the backend server, and everything else by the frontend. I've tried
many combinations which don't work, which I can post if it's relevant...
it seems that having a map outside of VirtualHost blocks doesn't work (I
get a GET /real/path/on/filesystem/to/foo.pl HTTP/1.0 on the backend) and
that requests with path_info don't work.

Does anybody have a pointer to a setup that looks like this?

Thanks in advance!

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer1-800-555-TELL  Voice 650-930-9062
Tellme Networks, Inc. Fax 650-930-9101
--



Re: Tracing double accesshandler invocation

2003-03-05 Thread Stas Bekman
Nick Tonkin wrote:
On Wed, 5 Mar 2003, Richard Clarke wrote:


Hi,
   I'm trying to figure out why my accesshandler is getting triggered twice
for each request that I make. I'm 100% sure that I'm doing no explicit
lookups/redirects anywhere in my code. The particular uri I am fetching
should only invocate an accesshandler followed by a contenthandler.
After watching the request with MOD_PERL_TRACE=h and MOD_PERL_TRACE=all I
think I'm still non the wiser.
Testing for $r-is_initial_req solves the problem but I'm more interested
in finding out exactly why it's being called twice.
Any tips for tracing this easier?


Nope, but FWIW I see the same behavior. I'm using mp2, but IIRC the same
thing used to happen on mp1 too.
I too would very much like to figure this out. I sort of suspect it is in
how the httpd.conf auth* directives are specified, but I've never had the
time to really muck around with them.
If you provide me a simple mp2 setup where this happens, I can debug it. 
However if I run with mp2:

t/TEST -v hooks/access

and log from TestHooks/access.pm every time an access handler is called, I can 
see it called only once per request. So may be play with this test's config 
until you break it. if you succeed to break it, that would be the easiest for 
me to reproduce your problem.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: register_cleanup on mod_perl 2.0

2003-03-05 Thread Stas Bekman
Stas Bekman wrote:
Denis Banovic wrote:

Hi!

I've a script that looks like this:

if ($runnung_on_mod_perl) {
Apache-request-register_cleanup(\init_globals);
}
Under mod_perl 1.0 works fine with Apache::Registry.

Can someone give me an Example how to make a register_cleanup with 
mod_perl
2?


A copy-n-paste from Apache/compat.pm:

sub register_cleanup {
shift-pool-cleanup_register(@_);
}
if you use Apache::compat, your mp1 code will work under mp2 unmodified.
And it is documented here:
http://perl.apache.org/docs/2.0/user/compat/compat.html#C__r_E_gt_register_cleanup_
http://perl.apache.org/docs/2.0/user/compat/compat.html#C__s_E_gt_register_cleanup_
In the future please refer to the docs first, before asking on the list.



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::DBI on mp2

2003-03-05 Thread Perrin Harkins
Stas Bekman wrote:
FWIW, we are discussing the internal DBI pooling mechanism at the 
dbi-dev list and having already a sort-of-working prototype. So 
hopefully there will be no need for Apache::DBI in the near future, as 
DBI will be able to handle pooling internally. However it may take some 
time, as the drivers will have to adjust to support the new functionality.

You can see the thread here:
http://archive.develooper.com/[EMAIL PROTECTED]/index.html#02118
Some working examples are attached to this message:
http://archive.develooper.com/[EMAIL PROTECTED]/msg02134.html
This is totally cool, Stas!  Nice work.  I look forward to answering 
yes when people ask if mod_perl has database connections pooling.

By the way, to completely get rid of Apache::DBI this would need to 
cover the safety functionality in there as well, i.e. the pinging and 
the part where it rolls back any pending transactions when a a handle is 
returned to the pool.

- Perrin



Re: Apache::DBI on mp2

2003-03-05 Thread Stas Bekman
Perrin Harkins wrote:
Stas Bekman wrote:

FWIW, we are discussing the internal DBI pooling mechanism at the 
dbi-dev list and having already a sort-of-working prototype. So 
hopefully there will be no need for Apache::DBI in the near future, as 
DBI will be able to handle pooling internally. However it may take 
some time, as the drivers will have to adjust to support the new 
functionality.

You can see the thread here:
http://archive.develooper.com/[EMAIL PROTECTED]/index.html#02118
Some working examples are attached to this message:
http://archive.develooper.com/[EMAIL PROTECTED]/msg02134.html
This is totally cool, Stas!  Nice work.  I look forward to answering 
yes when people ask if mod_perl has database connections pooling.
;)

actually it's going to be: if perl has database connections pooling, which 
will include mod_perl by definition.

Also, the pooling mechanism should work transparently w/ and w/o threads on 
the user level.

By the way, to completely get rid of Apache::DBI this would need to 
cover the safety functionality in there as well, i.e. the pinging and 
the part where it rolls back any pending transactions when a a handle is 
returned to the pool.
Certainly. Quite a few features are missing. The first step was (is) to make 
the dbh shared between threads (which is far from trivial). The rest should be 
just a matter of coding.

re: rollback, the DBD drivers will perform the normal disconnect(), but 
without doing the physical disconnect, and normal DESTROY, without destroying 
the datastructures which maintain the physical connection, so there shouldn't 
be much to change for this feature.

Only the ping() is needed to be added to connect().

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Transparent front-end proxying for many VirtualHosts

2003-03-05 Thread Larry Leszczynski
Hi Andrew -

 I want to simplify my configuration in two ways. I'd prefer not to
 maintain two sets of VirtualHost configuration data, and I'd like it
 if the block that proxies .pl files to the backend proxy not be
 replicated per VirtualHost.

Have you looked at mod_macro?  Depending on how similar your virtual hosts
are to each other, it might be useful. For example, suppose you set up
config files like so:

FrontEndMacros.cfg:

   Macro MyVirtualHost $host $dir
  VirtualHost *
 ServerName $host
 DocumentRoot $dir
 LocationMatch \.pl$
RewriteRule ...rule to proxy to backend...
 /LocationMatch
 ...other frontend config stuff...
  /VirtualHost
   /Macro

BackEndMacros.cfg:

   Macro MyVirtualHost $host $dir
  VirtualHost *
 ServerName $host
 DocumentRoot $dir
 ...other backend config stuff...
  /VirtualHost
   /Macro

MyVirtualHosts.cfg:

   Use MyVirtualHost www.siteA.com /path/to/siteA/htdocs
   Use MyVirtualHost www.siteB.com /path/to/siteB/htdocs
   Use MyVirtualHost www.siteC.com /path/to/siteC/htdocs

httpd.conf for frontend:

   Listen 1.2.3.4:80
   NameVirtualHost *
   Include FrontEndMacros.cfg
   Include MyVirtualHosts.cfg

httpd.conf for backend:

   Listen 127.0.0.1:8080
   NameVirtualHost *
   Include BackEndMacros.cfg
   Include MyVirtualHosts.cfg


This could let you maintain just one included file that defined the list
of virtual hosts, and even though the proxying block would be replicated
for each frontend host, at least you wouldn't have to do that manually.  
You could probaly even combine the macro definitions in FrontEndMacros.cfg
and BackEndMacros.cfg with some appropriately placed IfDefine blocks.

More mod_macro info is at:
   http://www.coelho.net/mod_macro/
(It says it's an Apache 2 module but version 1.1.2 works with Apache
1.3.X)


HTH,
Larry Leszczynski
[EMAIL PROTECTED]




Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Mark James
Stas Bekman wrote:
Mark James wrote:
I'm having CGI redirect problems mp2 (cvs).
as the comment just above this line says, that code was copy-n-pasted 
from mod_cgi. Can you reproduce the same problem while running a cgi 
script?
No, them problem only manifests under mod_perl (2, haven't used 1).

Also could it be that it has to do with the recent change, I've applied 
which was already reported by Beau as broken. May be your headers don't 
get parsed What happens if you do:
[patch]
Applied the patch, but the problem still occurred. No change also
when I commented out the location[0]=='/' test.
The redirect header being printed by my perl script is:

Server: Apache/2.0.44 (Unix) mod_perl/1.99_09-dev Perl/v5.8.0
Status: 302 Moved
Date: Thu, 06 Mar 2003 01:10:54 GMT
Location: http://makethecase.net/db?auth=ckffb2a5c44ee0editCmds=compactfile=62
Which is returned as a 302 link page.  This is a redirect response to a POST.

Strangely, another redirect, with header:

Server: Apache/2.0.44 (Unix) mod_perl/1.99_09-dev Perl/v5.8.0
Status: 302 Moved
Date: Thu, 06 Mar 2003 01:15:54 GMT
Location: 
http://makethecase.net/db?_reason=6%20Case1Pro_restart=editPartcheckSequenceNumber=60cmd=authenticateeditCmds=compactfile=62partnum=
works just fine.  This is a redirect after a GET.

Mark



Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Stas Bekman
Mark James wrote:
Stas Bekman wrote:

Mark James wrote:

I'm having CGI redirect problems mp2 (cvs).


as the comment just above this line says, that code was copy-n-pasted 
from mod_cgi. Can you reproduce the same problem while running a cgi 
script?


No, them problem only manifests under mod_perl (2, haven't used 1).
Sorry, I'm not following your comment. I've suggested to test with mod_cgi 
(under Apache2), since mod_perl mimics mod_cgi's behavior here.

Also could it be that it has to do with the recent change, I've 
applied which was already reported by Beau as broken. May be your 
headers don't get parsed What happens if you do:
[patch]


Applied the patch, but the problem still occurred. No change also
when I commented out the location[0]=='/' test.
The redirect header being printed by my perl script is:

Server: Apache/2.0.44 (Unix) mod_perl/1.99_09-dev Perl/v5.8.0
Status: 302 Moved
Date: Thu, 06 Mar 2003 01:10:54 GMT
Location: 
http://makethecase.net/db?auth=ckffb2a5c44ee0editCmds=compactfile=62

Which is returned as a 302 link page.  This is a redirect response to a 
POST.

Strangely, another redirect, with header:

Server: Apache/2.0.44 (Unix) mod_perl/1.99_09-dev Perl/v5.8.0
Status: 302 Moved
Date: Thu, 06 Mar 2003 01:15:54 GMT
Location: 
http://makethecase.net/db?_reason=6%20Case1Pro_restart=editPartcheckSequenceNumber=60cmd=authenticateeditCmds=compactfile=62partnum= 

works just fine.  This is a redirect after a GET.
Should POST-redirect return 307?
http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html
http://rfc.net/rfc2616.html#s10.3.8
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Transparent front-end proxying for many VirtualHosts

2003-03-05 Thread Charlie Garrison
Good afternoon,

On 5/3/03 at 3:30 PM, Andrew Ho [EMAIL PROTECTED] wrote:

I have an Apache with many VirtualHosts, and I want to setup proxying so
that a lightweight frontend Apache with mod_rewrite/mod_proxy proxies
Apache::Registry script requests back to a heavyweight backend Apache
running on a localhost-only port.

I want to simplify my configuration in two ways. I'd prefer not to
maintain two sets of VirtualHost configuration data, and I'd like it if
the block that proxies .pl files to the backend proxy not be replicated
per VirtualHost.

I use mod_macro and IfDefine directives to simplify virtual host setups with
backend server.

First I do the bulk of the config in httpd.conf as usual (seperate conf files
for frontend and mod_perl) and then use Include directive to load files (one
for each virt host) from a directory.

Each included conf file is loaded by both frontend  mod_perl servers and
IfDefine controls which parts are used for each server.  This is a short
sample file (the Use directives are for mod_macro):

IfDefine IS_FRONT_END
VirtualHost 10.8.168.70:80
Use mSiteRoot gcs garrison.com.au

Use mSiteLogs_frontend gcs
Use mSiteUserGroup gcs

Use mSiteRootDirOptions gcs
Use mSiteCgiBinDirOptions gcs

Use mSetupRewrite
Use mSiteRewriteRules   

/VirtualHost
/IfDefine

IfDefine IS_PERL
VirtualHost 10.8.168.70:8520
Use mSiteRoot gcs garrison.com.au

Use mSiteLogs_modperl gcs
Use mSiteUserGroup gcs

Use mSiteRootDirOptions gcs
Use mSitePerlBinDirOptions gcs

/VirtualHost
/IfDefine


This setup doesn't put all the rewrite config in the main conf file, but it
does centralize it all to make maintenance much easier. And there is only one
conf file for each virt host.


Charlie
-- 
   Charlie Garrison[EMAIL PROTECTED]
   PO Box 141, Windsor, NSW 2756, Australia 


Re: [mp2] CGI redirects incorrectly handled?

2003-03-05 Thread Mark James
Mark James wrote:

303 See Other is the correct post-POST redirect response:
http://rfc.net/rfc2616.html#s10.3.4
which your first link suggests works in all browsers.
Well, taking a closer look, 303 doesn't work in Netscape 3 or 4.


CGI.pm always returns a 302, though, if necessary, I can edit
its reply in my script before printing it.  I'll give this a go.
This didn't work.  Got a 303 link page instead of a 302 one.



Env::C threads env flashback

2003-03-05 Thread Stas Bekman
When I've suggested to use Env::C::getenv to debug the problem with env vars, 
and Mark decided to use Env::C::setenv to solve it, I've forgotten to warn you 
that you shouldn't be using this workaround in the threaded env. If you could, 
modperl would have been doing the right thing in first place.

I've added the following section to Env::C doc and will upload the new version 
(with only the doc change on CPAN shortly).

---
=head1 Thread-safety and Thread-locality
This module should not be used in the threaded enviroment.

Thread-locality: the OS, which maintains the struct Cenviron, shares
it between all threads in the process. So if you modify it in one
thread, all other threads will see the new value. Something that will
most likely break the code.
This module is not thread-safe, since two threads may attempt to
modify/read the struct Cenviron at the same time. I could add
locking if in threaded-environment. However since the lock can't be
seen by other applications, they can still bypass it causing race
condition. But since thread-locality is not maintained, making this
module thread-safe is useless.
If you need to modify the C level of C%ENV for all threads to see,
do that before threads are started. (e.g. for mod_perl 2.0, at the
server startup).
---
Also see:
http://perl.apache.org/docs/2.0/user/coding/coding.html#Thread_environment_Issues
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Transparent front-end proxying for many VirtualHosts

2003-03-05 Thread Perrin Harkins
On Wed, 2003-03-05 at 18:30, Andrew Ho wrote:
 I want to simplify my configuration in two ways. I'd prefer not to
 maintain two sets of VirtualHost configuration data, and I'd like it if
 the block that proxies .pl files to the backend proxy not be replicated
 per VirtualHost.

As others pointed out, mod_macro is good for this.  Personally, I tend
to solve problems like this by generating my httpd.conf with a template
and a tiny Perl script.  That allows me to do absolutely anything in it,
including looking up data from a database to use in the conf file.

- Perrin



ImageMagick

2003-03-05 Thread Lee Goddard
-BEGIN PGP SIGNED MESSAGE-
Hash: MD5


A while ago someone on this list experienced a similar problem
to myself, with ImageMagick crashing an Apache mod_perl server.

If it was you, and if that problem related to Writing an image,
please get in touch off list: I've been given a potential fix for it.

Cheers
lee

-BEGIN PGP SIGNATURE-
Version: 2.6

iQCVAwUAPmb6L6drfekeF/QBAQGaeQQAmqEdHQbsg/4dBUuqSw9A8tn8od5taO8y
0TYuoINUspSt0I9tXs9uF8LCUYrAux2+RGmDND6DZrP2S8Ja6HGCwKxckL8c0P2e
/O0Ko1otMG+1j8XoE0EG3qVwvWCg8Lqt0Ak59K/kSmXke81/h0PbYuUH32BSOPdM
jLMz9GIqnAw=
=K6co
-END PGP SIGNATURE-