Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)

2017-01-19 Thread Issac Goldstand
That release was canceled due to lack of votes, but regardless there was 
very little effective difference between that and 2.13 - mostly around 
tests, docs and build scripts.  2.13 should run just fine on 2.4


  Issac

On 1/19/2017 6:30 AM, Jie Gao wrote:

There was a new release candidate over a month ago, and it is available at 
https://home.apache.org/~issac/libapreq2-2.14.tar.gz .

Regards,


Jie



* JW  wrote:


Date: Wed, 18 Jan 2017 20:06:41 +
From: JW 
To: "modperl@perl.apache.org" 
Subject: Question about Apache 2.4 and libapreq2 (Apache2::Request)


Hi,

I currently use Apache 2.2, mod_perl and libapreq2 (for Apache2::Request and 
Apache2::Cookie). I did a test installation of Apache 2.4 (yum), mod_perl 
(source) and libapreq2-2.13 (source). and it seems to work fine.

The last update of libapreq2 was in 2010. I'm aware that not every library has 
to be updated and frankly I'm pleased that it still works. However, before I 
make a permanent switch to Apache 2.4, I was wondering if anyone doing a 
similar upgrade experienced problems using libapreq2 and what alternative(s) 
they chose.

Thank you.

John









Re: Unable to set custom header

2015-10-06 Thread Issac Goldstand
$r->headers_out is what would go to the client.  You probably want to
add your headers to $r->headers_in to get it passed to the upstream server.

  Issac

On 10/6/2015 1:11 PM, Ashish Mukherjee wrote:
> Error log does not show anything. It's almost as if that piece of code
> never existed!
> 
> The request is already being created by mod_proxy. I am just trying to
> append some request headers.
> 
> On Tue, Oct 6, 2015 at 3:25 PM, Jie Gao  > wrote:
> 
> * Ashish Mukherjee  > wrote:
> 
> > Date: Tue, 6 Oct 2015 15:06:21 +0530
> > From: Ashish Mukherjee  >
> > To: Jie Gao >
> > CC: modperl@perl.apache.org ,
> sourabh@smartinsight.jp 
> > Subject: Re: Unable to set custom header
> >
> > Yes, I used that code just to try with foo => bar first, before doing
> > anything more complex. err_headers_out() does not work either. Should I 
> set
> > this handler in some other phase?
> 
> Your code does not seem to complete the response. Try to do it
> properly, by setting the content type and print a body, etc.
> 
> Also anything in the error log that would suggest why it did not work?
> 
> 
> -Jie
> 
> 
> > On Tue, Oct 6, 2015 at 2:53 PM, Jie Gao  > wrote:
> >
> > > Please think of our environment and only print this e-mail if
> necessary.
> > >
> > > * Ashish Mukherjee  > wrote:
> > >
> > > > Date: Tue, 6 Oct 2015 14:36:32 +0530
> > > > From: Ashish Mukherjee  >
> > > > To: modperl@perl.apache.org 
> > > > CC: sourabh@smartinsight.jp
> 
> > > > Subject: Unable to set custom header
> > > >
> > > > Hello,
> > > >
> > > > I am trying to set a custom header through a mod_perl handler.
> > > >
> > > > My perl handler code is:
> > > >
> > > > sub handler {
> > > > my $r = shift;
> > > >
> > > > $r->headers_out->add("foo" => "bar");
> > > > $r->log->error($r->connection->remote_ip()." is client IP");
> > > >
> > > > return Apache2::Const::OK;
> > > > }
> > > >
> > > > The handler gets called as I am able to see the log message,
> but the
> > > header
> > > > is not emitted.
> > >
> > > Is this the actual code you used? The response headers set by
> > > "headers_out" get cleared if there is an error, nor do they
> persist across
> > > internal redirects.
> > >
> > > You might want to try err_headers_out instead, depending on the
> > > circumstances.
> > >
> > > Regards,
> > >
> > >
> > >
> > > Jie
> > >
> > >
> > > > My Apache configuration is -
> > > >
> > > >   ProxyRequests On
> > > >   ProxyVia On
> > > >   ProxyRemote * http://localhost:3128
> > > >
> > > >   SetHandler modperl
> > > >   PerlPostReadRequestHandler +Foo::Proxy
> > > >
> > > >   
> > > > ProxyPass http://www.something.com/
> > > > ProxyPassReverse http://www.something.com/
> > > >
> > > >
> > > > When I do the same through mod_header like this it works -
> > > >
> > > > RequestHeader set foo bar
> > > >
> > > > I want foo: bar to go as a header in the HTTP request to my
> proxy on port
> > > > 3128.
> > > >
> > > > Can anyone advise why my perl handler doesn't work when it
> should be
> > > doing
> > > > the same thing as mod_headers?
> > > >
> > > > Regards,
> > > > Ashish
> > >
> 
> 



Re: [RELEASE CANDIDATE]: mod_perl-2.0.9 RC1

2015-05-13 Thread Issac Goldstand
Awesome!!! I'll need to find some time to build and test, but huge kudos
Steve!

On 5/13/2015 10:55 PM, Steve Hay wrote:
 Please download, test, and report back on this release candidate of
 the long-awaited mod_perl 2.0.9.
 
 http://people.apache.org/~stevehay/mod_perl-2.0.9-rc1.tar.gz
 
 MD5 = f4e5aa352aca25df31f86eb6503fe883
 SHA1 = db220c311b7848679a02ebec67ee41cc1334b460
 
 =item 2.0.9-rc1
 
 Add support for Apache httpd-2.4.x. [Torsten Foertsch, Jan Kaluza,
 Steve Hay, Gozer]
 
 Don't call modperl_threaded_mpm() et al. from XS code. Fixes Debian Bug
 #765174. [Niko Tyni nt...@debian.org]
 
 Make sure modperl_interp_select uses r-server rather than the passed s
 parameter to find the interpreter pool to pull an interpreter from. This
 fixes an issue with vhosts with a separate interpreter pool and runtime
 dir-config merges that used to pull the interpreter from the wrong pool.
 [Torsten Foertsch]
 
 PerlInterpScope is now more advisory. Using $(c|r)-pnotes will bind
 the current interpreter to that object for it's lifetime.
 $(c|r)-pnotes_kill() can be used to prematurely drop pnotes and
 remove this binding. [Torsten Foertsch]
 
 Now correctly invokes PerlCleanupHandlers, even if they are the only
 handler type configured for that request [Torsten Foertsch]
 
 For threaded MPMs, change interpreter managment to a new, reference-counted
 allocation model. [Torsten Foertsch]
 
 Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
 via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig
 [Torsten Foertsch]
 
 Expose modperl_interp_t via ModPerl::Interpreter [Torsten Foertsch]
 
 Fix t/compat/apache_file.t on Windows. Apache::File-tmpfile() wants TMPDIR
 or TEMP from the environment, or else defaults to /tmp. The latter is no
 good on Windows, so make sure the environment variables are passed through.
 (TEMP should be set to something suitable on Windows.) [Steve Hay]
 
 Fix t/api/err_headers_out.t with HTTP::Headers  6.00. [Rolando
 roloswo...@gmail.com]
 
 Fix the build with VC++ and dmake (rather than nmake) on Windows. The
 Makefile generated by Apache2::Build uses shell commands for the manifest
 file, but neglected to tell dmake to use the shell. [Steve Hay]
 
 Don't write an 'rpm' target into the Makefile on Windows. It isn't relevant
 on Windows, and the (hard-coded, not MakeMaker-generated) recipe group has
 syntax which dmake doesn't understand. [Steve Hay]
 



Re: Large File Download

2015-03-28 Thread Issac Goldstand
sendfile is much more efficient than that.  At the most basic level,
sendfile allows a file to be streamed directly from the block device (or
OS cache) to the network, all in kernel-space (see sendfile(2)).

What you describe below is less effective, since you need to ask the
kernel to read the data, chunk-by-chunk, send it to userspace, and then
from userspace back to kernel space to be sent to the net.

Beyond that, the Apache output filter stack is also spending time
examining your data, possibly buffering it differently than you are (for
example to make HTTP chunked-encoding) - by using sendfile, you'll be
bypassing the output filter chain (for the request, at least;
connection/protocol filters, such as HTTPS encryption will still get in
the way, but you probably want that to happen :)) further optimizing the
output.

If you're manipulating data, you need to stream yourself, but if you
have data on the disk and can serve it as-is, sendfile will almost
always perform much, much, much better.

  Issac

On 3/28/2015 7:40 PM, Dr James Smith wrote:
 You can effectively stream a file byte by byte - you just need to print
 a chunk at a time and mod_perl and apache will handle it
 appropriately... I do this all the time to handle large data downloads
 (the systems I manage are backed by peta bytes of data)...
 
 The art is often not in the output - but in the way you get and process
 data before sending it - I have code that will upload/download arbitrary
 large files (using HTML5's file objects) without using excessive amounts
 of memory... (all data is stored in chunks in a MySQL database)
 
 Streaming has other advantages with large data - if you wait till you
 generate all the data then you will find that you often get a time out -
 I have a script which can take up to 2 hours to generate all the output
 - but it never times out as it is sending a line of data at a time
 and do data is sent every 5-10 seconds... and the memory footprint is
 trivial - as only data for one line of output is in memory at a time..
 
 
 On 28/03/2015 16:25, John Dunlap wrote:
 sendfile sounds like its exactly what I'm looking for. I see it in the
 API documentation for Apache2::RequestIO but how do I get a reference
 to it from the reference to Apache2::RequestRec which is passed to my
 handler?

 On Sat, Mar 28, 2015 at 9:54 AM, Perrin Harkins phark...@gmail.com
 mailto:phark...@gmail.com wrote:

 Yeah, sendfile() is how I've done this in the past, although I was
 using mod_perl 1.x for it.

 On Sat, Mar 28, 2015 at 5:55 AM, André Warnier a...@ice-sa.com
 mailto:a...@ice-sa.com wrote:

 Randolf Richardson wrote:

 I know that it's possible(and arguably best practice)
 to use Apache to
 download large files efficiently and quickly, without
 passing them through
 mod_perl. However, the data I need to download from my
 application is both
 dynamically generated and sensitive so I cannot expose
 it to the internet
 for anonymous download via Apache. So, I'm wondering
 if mod_perl has a
 capability similar to the output stream of a java
 servlet. Specifically, I
 want to return bits and pieces of the file at a time
 over the wire so that
 I can avoid loading the entire file into memory prior
 to sending it to the
 browser. Currently, I'm loading the entire file into
 memory before sending
 it and

 Is this possible with mod_perl and, if so, how should
 I go about
 implementing it?


 Yes, it is possible -- instead of loading the
 entire contents of a file into RAM, just read blocks in a
 loop and keep sending them until you reach EoF (End of File).

 You can also use $r-flush along the way if you
 like, but as I understand it this isn't necessary because
 Apache HTTPd will send the data as soon as its internal
 buffers contain enough data.  Of course, if you can tune
 your block size in your loop to match Apache's output
 buffer size, then that will probably help.  (I don't know
 much about the details of Apache's output buffers because
 I've not read up too much on them, so I hope my
 assumptions about this are correct.)

 One of the added benefits you get from using a
 loop is that you can also implement rate limiting if that
 becomes useful.  You can certainly also implement access
 controls as well by cross-checking the file being sent
 with whatever internal database queries you'd normally use
 to ensure it's okay to 

Re: Something wrong with CPAN ?

2014-06-09 Thread Issac Goldstand
On 09/06/2014 14:23, André Warnier wrote:
 Hi guys.
 
 Is it only me, or does the search box in www.cpan.org not work anymore ?
 
 503 Service Unavailable
 No server is available to handle this request.
 
 (been like that for a couple of days now)

Confirmed.  Seen this for a week or so now.

 
 If it is not me alone, and if someone here knows where to send a message
 about this, could you advise ?

Sorry, no clue...



Re: mod_perl and Transfer-Encoding: chunked

2013-07-04 Thread Issac Goldstand
On 03/07/2013 21:53, Joseph Schaefer wrote:
 When you read from the input filter chain as $r-read does, the http
 input filter automatically handles the protocol and passes the dechunked
 data up to the caller. It does not spool the stream at all.
 
 You'd have to look at how mod perl implements read to see if it loops
 its ap_get_brigade calls on the input filter chain to fill the passed
 buffer to the desired length or not.  But under no circumstances should
 you have to deal with chunked data directly.

I'm pretty sure that it's not even a mod_perl thing.  IIRC, httpd itself
sticks a chunk/de-chunk filter near the respective ends of the filter
chain.  So if you can't find the code in mod_perl land, you might want
to check httpd source.

 
 HTH
 
 Sent from my iPhone
 
 On Jul 3, 2013, at 2:44 PM, Bill Moseley mose...@hank.org
 mailto:mose...@hank.org wrote:
 
 Hi Jim,

 This is the Transfer-Encoding: chunked I was writing about:

 http://tools.ietf.org/html/rfc2616#section-3.6.1



 On Wed, Jul 3, 2013 at 11:34 AM, Jim Schueler jschue...@eloquency.com
 mailto:jschue...@eloquency.com wrote:

 I played around with chunking recently in the context of media
 streaming: The client is only requesting a chunk of data.
  Chunking is how media players perform a seek.  It was
 originally implemented for FTP transfers:  E.g, to transfer a
 large file in (say 10K) chunks.  In the case that you describe
 below, if no Content-Length is specified, that indicates send the
 remainder.

 From what I know, a chunk request header is used this way to
 specify the server response.  It does not reflect anything about
 the data included in the body of the request.  So first, I would
 ask if you're confused about this request information.

 Hypothetically, some browsers might try to upload large files in
 small chunks and the chunk header might reflect a push transfer.
  I don't know if chunk is ever used for this purpose.  But it
 would require the following characteristics:

   1.  The browser would need to originally inquire if the server is
   capable of this type of request.
   2.  Each chunk of data will arrive in a separate and independent
 HTTP
   request.  Not necessarily in the order they were sent.
   3.  Two or more requests may be handled by separate processes
   simultaneously that can't be written into a single destination.
   4.  Somehow the server needs to request a resend if a chunk is
 missing.
   Solving this problem requires an imaginitive use of HTTP.

 Sounds messy.  But might be appropriate for 100M+ sized uploads.
  This *may* reflect your situation.  Can you please confirm?

 For a single process, the incoming content-length is unnecessary.
 Buffered I/O automatically knows when transmission is complete.
  The read() argument is the buffer size, not the content length.
  Whether you spool the buffer to disk or simply enlarge the buffer
 should be determined by your hardware capabilities.  This is
 standard IO behavior that has nothing to do with HTTP chunk.
  Without a Content-Length header, after looping your read()
 operation, determine the length of the aggregate data and pass
 that to Catalyst.

 But if you're confident that the complete request spans several
 smaller (chunked) HTTP requests, you'll need to address all the
 problems I've described above, plus the problem of re-assembling
 the whole thing for Catalyst.  I don't know anything about Plack,
 maybe it can perform all this required magic.

 Otherwise, if the whole purpose of the Plack temporary file is to
 pass a file handle, you can pass a buffer as a file handle.  Used
 to be IO::String, but now that functionality is built into the core.

 By your last paragraph, I'm really lost.  Since you're already
 passing the request as a file handle, I'm guessing that Catalyst
 creates the tempororary file for the *response* body.  Can you
 please clarify?  Also, what do you mean by de-chunking?  Is that
 the same think as re-assembling?

 Wish I could give a better answer.  Let me know if this helps.

 -Jim



 On Tue, 2 Jul 2013, Bill Moseley wrote:

 For requests that are chunked (Transfer-Encoding: chunked and no
 Content-Length header) calling $r-read returns unchunked data
 from the
 socket.
 That's indeed handy.  Is that mod_perl doing that un-chunking
 or is it
 Apache?

 But, it leads to some questions.   

 First, if $r-read reads unchunked data then why is there a
 Transfer-Encoding header saying that the content is chunked?  
 Shouldn't
 that header be removed?   How does one know if the content is
 chunked or
 not, otherwise?

 Second, if there's no Content-Length header then how does one
   

Re: mod_perl and Transfer-Encoding: chunked

2013-07-04 Thread Issac Goldstand
On 03/07/2013 23:26, Jim Schueler wrote:

 
 Second, if there's no Content-Length header then how
 does one know how much
 data to read using $r-read?   

 One answer is until $r-read returns zero bytes, of
 course.  But, is
 that guaranteed to always be the case, even for,
 say, pipelined requests?  
 My guess is yes because whatever is de-chunking the
 
 read() is blocking.  So it never returns 0, even in a pipeline request
 (if no data is available, it simply waits).  I don't wish to discuss the
 merits here, but there is no technical imperative for a content-length
 request in the request header.
 
  -Jim

Probably.  If you, for some reason, were doing the chunking work
yourself, each chunk says how many bytes are in it (or in the next one
perhaps; I forget offhand), so you'd know what size read to do.

 
 
 
 
 
 On Wed, 3 Jul 2013, Bill Moseley wrote:
 
 Hi Jim,
 This is the Transfer-Encoding: chunked I was writing about:

 http://tools.ietf.org/html/rfc2616#section-3.6.1



 On Wed, Jul 3, 2013 at 11:34 AM, Jim Schueler jschue...@eloquency.com
 wrote:
   I played around with chunking recently in the context of media
   streaming: The client is only requesting a chunk of data.
Chunking is how media players perform a seek.  It was
   originally implemented for FTP transfers:  E.g, to transfer a
   large file in (say 10K) chunks.  In the case that you describe
   below, if no Content-Length is specified, that indicates send
   the remainder.

   From what I know, a chunk request header is used this way to
   specify the server response.  It does not reflect anything about
   the data included in the body of the request.  So first, I would
   ask if you're confused about this request information.

   Hypothetically, some browsers might try to upload large files in
   small chunks and the chunk header might reflect a push
   transfer.  I don't know if chunk is ever used for this
   purpose.  But it would require the following characteristics:

 1.  The browser would need to originally inquire if the server
   is
 capable of this type of request.
 2.  Each chunk of data will arrive in a separate and
   independent HTTP
 request.  Not necessarily in the order they were sent.
 3.  Two or more requests may be handled by separate processes
 simultaneously that can't be written into a single
   destination.
 4.  Somehow the server needs to request a resend if a chunk is
   missing.
 Solving this problem requires an imaginitive use of HTTP.

   Sounds messy.  But might be appropriate for 100M+ sized uploads.
This *may* reflect your situation.  Can you please confirm?

   For a single process, the incoming content-length is
   unnecessary. Buffered I/O automatically knows when transmission
   is complete.  The read() argument is the buffer size, not the
   content length.  Whether you spool the buffer to disk or simply
   enlarge the buffer should be determined by your hardware
   capabilities.  This is standard IO behavior that has nothing to
   do with HTTP chunk.  Without a Content-Length header, after
   looping your read() operation, determine the length of the
   aggregate data and pass that to Catalyst.

   But if you're confident that the complete request spans several
   smaller (chunked) HTTP requests, you'll need to address all the
   problems I've described above, plus the problem of re-assembling
   the whole thing for Catalyst.  I don't know anything about
   Plack, maybe it can perform all this required magic.

   Otherwise, if the whole purpose of the Plack temporary file is
   to pass a file handle, you can pass a buffer as a file handle.
Used to be IO::String, but now that functionality is built into
   the core.

   By your last paragraph, I'm really lost.  Since you're already
   passing the request as a file handle, I'm guessing that Catalyst
   creates the tempororary file for the *response* body.  Can you
   please clarify?  Also, what do you mean by de-chunking?  Is
that the same think as re-assembling?

   Wish I could give a better answer.  Let me know if this helps.

   -Jim


   On Tue, 2 Jul 2013, Bill Moseley wrote:

 For requests that are chunked (Transfer-Encoding:
 chunked and no
 Content-Length header) calling $r-read returns
 unchunked data from the
 socket.
 That's indeed handy.  Is that mod_perl doing that
 un-chunking or is it
 Apache?

 But, it leads to some questions.   

 First, if $r-read reads unchunked data then why is
 there a
 Transfer-Encoding 

Re: New Windows mod_perl binaries available

2013-04-29 Thread Issac Goldstand
First of all, see if you can get a stacktrace.

There's also always spreading print/debug statements around - I'm
unfortunately not so up-to-date on the various perl profiling modules
around, but they might be helpful.

  Issac

On 29/04/2013 14:16, Michiel Beijen wrote:
 Hi Issac,
 
 Thanks for your response.
 On Mon, Apr 29, 2013 at 12:54 PM, Issac Goldstand mar...@beamartyr.net 
 wrote:
 
 This is a known issue related to the winnt MPM.  You're likely seeing
 your worker segfault.  On linux, there are usually extra processes so if
 one segfaults there's another process that can step in fast enough.  But
 on the winnt MPM, there's one master and exactly one multi-threader
 worker.  So when that worker blows up, the master needs to completely
 tear it down, and bring it back up, which is what you're seeing.

 Look for a bug in user-code, not in the mod_perl binary.
 
 But if the worker 'blows up', this is still caused by some code I run right?
 If I set the Apache log level to 'debug' I still see nothing in the
 logs except for the restart.
 
 What should I do to find out *what* is causing the restart?
 --
 Mike
 



Re: highscalability.com report

2012-04-04 Thread Issac Goldstand
On 04/04/2012 10:31, William A. Rowe Jr. wrote:
 On 4/3/2012 9:50 PM, Jim Schueler wrote:
 Hope this doesn't get trapped by too many spam filters.

 Sad news.  Just saw a blog

   http://www.highscalability.com/

 that reports YouPorn.com switched from Perl to PHP.  Apparently there's a 
 reported 10%
 improvement in speed, but I haven't noticed :).

 After a couple months of total immersion, I have less inclination towards
 PHP than ever.  Fight's not out of me yet.
 If one is comparing an every-connection mod_perl enabled environment
 to a specific-content, fastcgi-proxied php buildout, there's no contest.

 When was the last time you built perl with no threading support?  It's
 certainly a 5%-15% win.
Agreed.  Honestly, I love mod_perl for easy Apache internals and for
doing really cool things with the httpd API  but if I was given a blank
RD department and told to build a web site (a public-facing HTML-based
beast, not a webservice or some other API endpoint), I'd very likely
pick PHP.  It's faster and simpler (not easier, but simpler) for people
to work with and if set up properly can be fast enough to serve.  Since
PHP's APC stabilized, I've always considered it to be good enough
against the speed advantage of registry scripts

  Issac



Re: Problem with long http request generation time - process restarting

2011-12-14 Thread Issac Goldstand
That stinks of a segfault.  The admission to using Windows at the end
makes me suspect it even more, as Windows has an unfortunate habit, due
to the MPM implementation, of a thread segfault taking the whole server
down with it, causing a several second delay while it cleans up the old
process and replaces it with a new one (with mod_perl doing all its init
stuff again)

I used to hate having to deal with that :)

Having said that, I don't think it's a chunking issue, as httpd core
handles that, not mod_perl.  Can you supply more info?  Not sure what,
but my gut says there's a missing piece here.

  Issac

On 14/12/2011 23:44, Andrew Merton wrote:
 Hi --

 I am getting the following message recurring in my log:

 Parent: child process exited with status 255 -- Restarting.

 followed by the process restart sequence.

 I have tracked it down to a call to $r-content which doesn't seem to
 return properly.

 It would appear that

 1. The POST request has Encoding-type: chunked (message total length
 is ~5kb);

 2. The client sends the HTTP headers, then pauses 3-4 seconds while it
 generates the body of the message (confirmed with WireShark);

 3. So when I call $r-content, when it succeeds I see a 3-4 second
 pause before it completes;

 4. If another request arrives during the call to $r-content, the
 process aborts and restarts - I assume it is interfering with the
 read() call in $r-content.

 Since the pause is so long, it is very likely to be interrupted even
 though I only have 5 clients currently :(

 Given the the chunked implemenation in mod_perl 2.0 is apparently
 incomplete, have I struck one area where this affects the result?

 Can anyone make suggestions as to how I can work around this problem?
  I wondered about maybe moving my handler to the log phase (currently
 it's a Response handler), by which time I assume the entire message
 must be available, but it seems like a major kludge and presumably
 would lead to other issues anyway.

 Or is there some multi-threading thing I should have done - currently
 I have not really done anything specific...

 I am using Apache2.2 on Win7 (no flames please :)), with ActiveState
 Perl (v5.12.2) built for MSWin32-x86-multi-thread.

 Andrew 





Re: How to configure mod_perl files in Apache , i mean where to put them?

2011-11-17 Thread Issac Goldstand
On 17/11/2011 16:27, Meir Yanovich wrote:
 There lots of tutorials on the web on how to configure the mod_perl
 filters but info i didn't understand and its like no where written ,
 where to put them and how to tell mod_perl/apache about there path
 /location . i mean only the filters part not the ordinary perl files

You mean this?

http://www.beamartyr.net/osdc2006/mp2intro/img36.html

  Issac


Re: How to configure mod_perl files in Apache , i mean where to put them?

2011-11-17 Thread Issac Goldstand
Anywhere in @INC

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

On 17/11/2011 17:33, Meir Yanovich wrote:
 Hi
 and thanks for the fast reply ,
 what i meant is for example , i have written filter
 called Myfilter.pm or MyFilter.pl
 where to put them ? physically ? relative to what in which directory ?
 also where to configure the path to this directory.
 Thanks

 On Thu, Nov 17, 2011 at 4:34 PM, Issac Goldstand mar...@beamartyr.net
 mailto:mar...@beamartyr.net wrote:

 On 17/11/2011 16:27, Meir Yanovich wrote:
  There lots of tutorials on the web on how to configure the mod_perl
  filters but info i didn't understand and its like no where written ,
  where to put them and how to tell mod_perl/apache about there path
  /location . i mean only the filters part not the ordinary perl files

 You mean this?

 http://www.beamartyr.net/osdc2006/mp2intro/img36.html

  Issac





Re: Internal apreq error

2010-12-04 Thread Issac Goldstand
Try setting LogLevel to debug?

On 03/12/2010 18:24, Rolf Schaufelberger wrote:
 Hi, 

 (server  Apache/2.2.14, OS Ubunto 10.04 LTS, libapreq 2.12.2 )
  
 I'm getting sometimes an 

 Internal apreq error

 which appears in my apache log with no more information that just that string.
 I would like to know where this error happens and why. 
 Can I  force apreq  to be a bit more verbose about errors ?
 The problem is, I can't reproduce the error, so running apache in debugger is 
 no option. 

 The only thing I (mean to) know so far: The error happens during large file 
 uploads. 
 I have a form  where a user can uploald 13 files   which may have have more 
 than 100MB.
 The apreq  is  patched to allow more that that (MAX set to 1000MB). 



 Regards

 Rolf Schaufelberger







[RELEASE CANDIDATE] libapreq2 2.13 RC

2010-11-25 Thread Issac Goldstand

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
After a year and a half, the apreq team would like to release version
2.13 of libapreq.  Please test and vote on the following tarball:

http://people.apache.org/~issac/libapreq2-2.13.tar.gz
http://people.apache.org/~issac/libapreq2-2.13.tar.gz.asc
http://people.apache.org/~issac/libapreq2-2.13.tar.gz.md5

Thanks, folks!
  Issac
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iEYEARECAAYFAkzuulcACgkQ7bEFiW+VIthPngCeN1V8AzC9lsuCWjJt/EsJnZ0r
DS0AniVDbyqUi6GO74mefdyTACi2wa+5
=OF6j
-END PGP SIGNATURE-



Re: ApacheCon

2010-10-05 Thread Issac Goldstand
 On 05/10/2010 18:56, Fred Moyer wrote:
 Anyone going to Apachecon in Atlanta this year?

 http://na.apachecon.com/c/acna2010/
Not sure yet


Re: [RELEASE CANDIDATE] Apache-Test-1.33 RC1

2010-09-11 Thread Issac Goldstand
 On 9/11/2010 4:32 PM, Torsten Förtsch wrote:
 On Saturday, September 11, 2010 08:38:46 Fred Moyer wrote:
  http://people.apache.org/~phred/Apache-Test-1.33-rc2.tar.gz
+1

Debian Lenny (5.0.6)

Server version: Apache/2.2.14 (Unix)
Server built:   May 23 2010 23:00:52

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
osname=linux, osvers=2.6.26-2-amd64,
archname=i486-linux-gnu-thread-multi
uname='linux puccini 2.6.26-2-amd64 #1 smp fri aug 14 07:12:04 utc
2009 i686 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl/5.10.0
-Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio
-Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib
-Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2 -g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing
-pipe -I/usr/local/include'
ccversion='', gccversion='4.3.2', 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, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib64
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so.5.10.0
gnulibc_version='2.7'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
  Built under linux
  Compiled at Aug 28 2009 22:15:29
  %ENV:
PERL5LIB=/home/issac/perl/lib/perl/5.8.3/auto
  @INC:
/home/issac/perl/lib/perl/5.8.3/auto
/etc/perl
/usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl





Re: Caveats to using Perl Sections for server configuration?

2010-01-15 Thread Issac Goldstand
FWIW, you can look at the source of Apache::UploadMeter to see an
example of Perl sections in use - they're actually called during the
httpd.conf parsing triggered by statements found in the httpd.conf

  Issac

Perrin Harkins wrote:
 I don't use them, but in a startup.pl you would be in a different package.

 - Perrin

 On Wed, Jan 13, 2010 at 8:59 PM, Boysenberry Payne
 boysenbe...@habitatlife.com wrote:
   
 Do you know if the scope of Perl Sections are the same as when using a 
 startup.pl?

 -bop

 On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote:

 
 On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
 boysenbe...@habitatlife.com wrote:
   
 I'm using Perl blocks in my apache conf files for early server 
 configuration.
 I remember reading someone on this list saying they wouldn't use Perl 
 Sections at all.
 
 That might have been me.  I don't like to use them.  I find it simpler
 to put all the perl code in a startup.pl.  I also like to generate my
 httpd.conf from templates, and this means I can also generate conf
 files for non-mod_perl servers, like my proxy.

 - Perrin
   
 



Re: Plack

2009-10-15 Thread Issac Goldstand
Whaddaya know...

Ironically, this might have saved Plone at my workplace had I known that
this was on the way.  We were looking at writing custom WSGI components
in Python and shuddering (well, I was shuddering)

Jonathan Vanasco wrote:

 Has anyone here played with Plack yet ? ( http://plackperl.org/ )

 It's about a week old or so publicly, but I'm sure a few of you folks
 here were privvy to a preview...



 // Jonathan Vanasco

 e. jonat...@2xlp.com mailto:jonat...@2xlp.com
 w. http://findmeon.com/user/jvanasco
 blog. http://destructuring.net http://destructuring.net/

 |   -   -   -   -   -   -   -   -   -   -
 |   Founder/CEO - FindMeOn, Inc.
 |  FindMeOn.com - The cure for Multiple Web Personality Disorder
 |   -   -   -   -   -   -   -   -   -   -
 |   CTO - ArtWeLove, LLC
 |  ArtWeLove.com - Explore Art On Your Own Terms
 |   -   -   -   -   -   -   -   -   -   -
 |  RoadSound.com - Tools for Bands, Stuff for Fans
 |   -   -   -   -   -   -   -   -   -   -




Re: mod_perl handler and PHP

2009-03-21 Thread Issac Goldstand
daniel.angil...@imperia.net wrote:
 
 Hello,
 
 I found a way to parse the output of mod_perl through PHP with debian
 linux.
 
 
 PHP has to be compiled with apxs2filter:
 --
 apt-get install apache2-threaded-dev
 for apxs2
 
 download latest php
 
 .configure --with-apxs2filter=/usr/bin/apxs2
 make
 
 attention: you run in trouble using an empty httpd.conf. You can fill it
 like this:
 
 /# This is here for backwards compatability reasons and to support/
 /#  installing 3rd party modules directly via apxs2, rather than/
 /#  through the /etc/apache2/mods-{available,enabled} mechanism./
 /#/
 /#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so/
 
 
 make install
 mkdir -p /etc/php5/apache2
 cp php.ini-dist /etc/php5/apache2/php.ini
 
 
 For debian
 strip --strip-debug /usr/lib/apache2/modules/libphp5.so
 strip --strip-unneeded /usr/lib/apache2/modules/libphp5.so
 
 ln -s /etc/apache2/mods-available/php5.load
 /etc/apache2/mods-enabled/php5.load
 ln -s /etc/apache2/mods-available/php5.conf
 /etc/apache2/mods-enabled/php5.conf
 
 make clean
 --
 
 
 
 Apache
 --
 - apache module mod_filter has to be enabled
 
 vhost.conf:
 
 Location /ls/app/demo
 SetHandler modperl
 PerlHandler My::Handler
 FilterProvider PHPFILTER PHP resp=PHPFILTER *
 FilterTrace PHPFILTER 0
 FilterChain PHPFILTER
 /Location
 --
 
 
 
 Has someone done this for windows? Or does someone know where I get php
 with apxs2filter for windows?
 
 

Just use the php5apache2_filter.dll module instead of php5apache2.dll
and you're set to go

  Issac



[RELEASE CANDIDATE] libapreq2 2.11

2009-01-20 Thread Issac Goldstand

The apreq developers are planning a maintenance release of
libapreq2.  This version addresses several bugfixes and includes new features.

Changes since the last release version include:

- Interactive CGI module [issac]
 Allow cgi module to interactively prompt for parameters and cookies when
 running a script from the command line and not from a CGI interface

- Perl Glue [joes]
 Fix the linking of the perl modules to libapreq2 and libapr
 on Solaris.

- Perl Glue [joes]
 Fix install-time linking issue of the .so modules.
 Previously they would remain linked against the src
 library path, not the install path.

- C API [joes]
 Add optional interface for apreq_handle_apache2().

- C API [joes]
 Clean up buggy apreq_hook_find_param().

- Perl Glue Build [Philip M. Gollucci]
 config.status format changed format yet again in autoconf 2.62+.

- License [Mladen Turk]
 Add libapreq.rc and generate libapreq.res

- Build [Mladen Turk]
 Add APREQ_DECLARE_EXPORT/APREQ_DECLARE_STATIC
 in the same way as APR declares so that dllexport/dllimport
 get correctly handled.

- Build [Randy Kobes]
 Add appropriate manifest command to embed manifest files on Win32
 when using VC8

- C API [Andy Grundman, joes]
 Add missing bytes_read initializer to apreq_handle_custom().

- C API [suggested by Vinay Y S, tested by Steve Hay and Peter Walsham]
 For Win32, remove the
flag |= APR_FILE_NOCLEANUP | APR_SHARELOCK;
 in apreq_file_cleanup, to avoid problems with file uploads.

- C API [joes]
 Fix leak associated to calling apreq_brigade_fwrite() on an upload
 brigade.

- Build [Philip M. Gollucci]
 SunOS (Solaris)
 Users must use gmake not make for building.

- Build [Philip M. Gollucci]
 SunOS (Solaris)
 Code around bug in libtool (at least in 1.5.18, 1.5.20, 1.5.22)
 causing mod_apreq2 to be built instead of mod_apreq2.so

- C API [Philip M. Gollucci]
 Fix comparison signed vs unsigned comparison
 in apreq_fwritev() on SunOS/gcc where iovec.iov_len is a long.

- Build [Philip M. Gollucci]
 SunOS (Solaris)
 fix duplicate link error to libexpat.so -- by using the one from httpd
 exclusively now.

- Build [Philip M. Gollucci]
 code around |#_!!_#| autoconf 2.60 bug.




Please give the tarball at

http://people.apache.org/~issac/libapreq2-2.11.tar.gz

a try and report comments/problems/etc. to the apreq-dev list
at apreq-...@httpd.apache.org.

Thanks,
 Issac



[OT] Re: unsubscribe

2009-01-19 Thread Issac Goldstand
It is already included.  Check your headers.

list-help: mailto:modperl-h...@perl.apache.org
list-unsubscribe: mailto:modperl-unsubscr...@perl.apache.org
List-Post: mailto:modperl@perl.apache.org


Michael Ludwig wrote:
 Try: modperl-unsubscr...@perl.apache.org

 Maybe it would help to have this bit of information, obvious as it
 should be, appended to each message, as is the case with many other
 mailing lists. (While even that may be ignored in certain cases, it
 certainly wouldn't be in all cases.)

 At the moment, the unsubscribe address appears only in the mail headers.
 Apart from being listed on the website, of course.

 Michael Ludwig



CFP Open For ApacheCon Europe 2009

2008-10-02 Thread Issac Goldstand

The Call for Papers for ApacheCon Europe 2009, to be held in Amsterdam,
from 23rd to 27th March, is now open! Submit your proposals at
http://eu.apachecon.com/c/aceu2009/cfp/ before 24th October.

Remember that early bird prices for ApacheCon US 2008, to be held in New
Orleans, from 3rd to 7th November, will go up this Friday, at midnight
Eastern time!

Sponsorship opportunities for ApacheCon US 2008 and ApacheCon EU 2009
are still available. If you or your company are interested in becoming a
sponsor, please contact Delia Frees at [EMAIL PROTECTED] for details.

***

If you want all the details:

ApacheCon Europe 2009 - Leading the Wave of Open Source
Amsterdam, The Netherlands
23rd to 27th March, 2009

Call for Papers Opens for ApacheCon Europe 2009

The Apache Software Foundation (ASF) invites submissions to its official
conference, ApacheCon Europe 2009. To be held 23rd to 27th March, 2009
at the Mövenpick Hotel Amsterdam City Centre, ApacheCon serves as a
forum for showcasing the ASF's latest developments, including its
projects, membership, and community. ApacheCon offers unparalleled
educational opportunities, with dedicated presentations, hands-on
trainings, and sessions that address core technology, development,
business/marketing, and licensing issues in Open Source.

ApacheCon's wide range of activities are designed to promote the
exchange of ideas amongst ASF Members, innovators, developers, vendors,
and users interested in the future of Open Source technology. The
conference program includes competitively selected presentations,
trainings/workshops, and a small number of invited speakers. All
sessions undergo a peer review process by the ApacheCon Conference
Planning team. The following information provides presentation category
descriptions, and information about how to submit your
proposal.

Conference Themes and Topics

APACHECON 2009 - LEADING THE WAVE OF OPEN SOURCE

Building on the success of the last two years, we are excited to return
to Amsterdam in 2009. We'll be continuing to offer our very popular
two-day trainings, including certifications of completion for those who
fulfill all the requirements of these trainings.

The ASF comprises some of the most active and recognized developers in
the Open Source community. By bringing together the pioneers,
developers, and users of flagship Open Source technologies, ApacheCon
provides an influential platform for dialogue, between the speaker and
the audience, between project contributors and the community at large,
traversing a wide range of ideas, expertise, and personalities.

ApacheCon welcomes submissions from like-minded delegates across many
fields, geographic locations, and areas of development. The breadth and
loosely-structured nature of the Apache community lends itself to
conference content that is also somewhat loosely-structured. Common
themes of interest address groundbreaking technologies and emerging
trends, successful practices (from development to deployment), and
lessons learned (tips, tools, and tricks). In addition to technical
content, ApacheCon invites Business Track submissions that address Open
Source business, marketing, and legal/licensing issues.

Topics appropriate for submission to this conference are manifold, and
may include but are not restricted to:

- Apache HTTP server topics such as installation, configuration, and
migration
- ASF-wide projects such as Lucene, SpamAssassin, Jackrabbit, and Maven
- Scripting languages and dynamic content such as Java, Perl, Python,
Ruby, XSL, and PHP
- Security and e-commerce
- Performance tuning, load balancing and high availability
- New technologies and broader initiatives such as Web Services and Web 2.0
- ASF-Incubated projects such as Sling, UIMA, and Shindig


Submission Guidelines
Submissions must include
- Title
- Speaker name, with affiliation and email address
- Speaker bio (100 words or less)
- Short description (50 words or less)
- Full description including abstract and objectives (200 words or
less)
- Expertise level (beginner to advanced)
- Format and duration (trainings vs. general presentation; half-, full-
or two-day workshop, etc.)
- Intended audience and maximum number of participants (trainings only)
- Background knowledge expected of the participants (trainings only)


Types of Presentations

- Trainings/Workshops
- General Sessions
- Case Studies/Industry Profiles
- Invited Keynotes/Panels/Speakers
- Corporate Showcases  Demonstrations

BoF sessions and Fast Feather Track talks will be selected separately

Pre Conference Trainings/Workshops
Held on the first and second day of the conference – 2008-03-23 and
2008-03-24, Trainings require a registration fee beyond the regular
conference fee. Proposals may be submitted for half-day (3 hours),
full-day (6 hours), or two-day (12 hours) training sessions, aimed at
providing in-depth, hands-on development experience or related
continuing education. Training submissions are welcome at beginner,

Re: [OT] Solaris + Apache 2.2 / PHP 5 cluster config help

2008-05-20 Thread Issac Goldstand



Perrin Harkins wrote:

On Sun, May 18, 2008 at 8:05 AM, Issac Goldstand [EMAIL PROTECTED] wrote:

Also, do people have concrete
benchmarks of keeping a read-only replication mysql on the webservers vs a
single read/write shared mysql server?


Any time you can spread the reads over multiple servers it will help.
This is particularly true for MyISAM tables where reads blocks
writers.  (InnoDB tables behave like Oracle and Postgres, with a MVCC
model.)



Right - I know that in theory, but was worried about the disk/ram/cpu 
overhead of replicating the writes to all of the slave servers 
offsetting that benefit...



I also thought to buffer common DB query results (like php's sessions) in
memcached on reads


I suspect that caching on the level of db queries will get annoying if
you try to do it everywhere.  You'd be better off caching at a higher
object level if you can, or just caching specific high-value
queries.



Well, yes, I meant the objects or data structures that result from the 
DB query - not the query or the result itself (I'd use Mysql's query 
cache for that anyway, not memcached).


Thanks for your input Perrin.

  Issac


- Perrin


[OT] Solaris + Apache 2.2 / PHP 5 cluster config help

2008-05-18 Thread Issac Goldstand

Hi all,
 I know that bits and pieces of high-load configuration questions have 
been posted to this list ([EMAIL PROTECTED]) and am CC-ing the mod_perl folks 
(since I know there are a bunch of knowledgeable people on the subject 
lurking there, but please post responses to [EMAIL PROTECTED]), but I'd like 
to put a bunch of configuration questions in one neat post.  Apologies 
if some people can think of a more appropriate place to have posted.


The short story is that I need to design a Apache/MySQL/PHP cluster 
(dual [redundant] firewalls + switches + dual [redundant] LBs and/or 
frontend caching proxies (likely squid) + switches + 4-6 webservers 
(likely running Solaris) with read-only replicating mysqls - with the 
hopes that we can scale these up just by adding more hardware and just 
telling the LBs + dual [redundant] mysql replication masters + shared 
storage - hopefully a NetApp :)), and am looking for the smartest design 
for the webservers and application layer in general.  I know plenty of 
theory on the subject, but it's really the first time I've had to design 
such a setup on my own.


My thoughts were to build httpd-2.2.x-worker, and mod_fastcgi + PHP with 
the FastCGI SAPI (to keep apache threaded, but allow for non-threadsafe 
PHP components - since even if I could be sure we weren't using 
non-threadsafe components in PHP, some unsuspecting developer will 
undoubtedly screw-up down the line if I build mod_php5).  Also, do 
people have concrete benchmarks of keeping a read-only replication mysql 
on the webservers vs a single read/write shared mysql server?


I also thought to buffer common DB query results (like php's sessions) 
in memcached on reads (though don't have any experience there and 
looking for tips on how to set it up best, how to update on writes - I 
assume update memcached + backend - and how to prune the old entries 
from memcached ).


I'm also looking to pre-compile the PHP scripts - preferably in shared 
memory on each webserver - for faster execution (think 
ModPerl::Registry), and am a bit stuck there.  I've previously used 
eAccellerator/Turck mmcache, but have found that it doesn't seem to work 
(for me, at least) with PHP objects and classes, and we use those 
heavily (at the moment, anyway - if that's the only way to get 
pre-compilation, then I may force them to stop using OO).  We actually 
already have Zend Guard, but I've been led to understand that that's not 
really helpful performance-wise, unless you have the full Zend Server, 
which I'm not sure I'd want to migrate to.


Any helpful pointers would be appreciated.

 Issac




Re: [ANNOUNCE] mod_perl-2.0.4

2008-04-17 Thread Issac Goldstand


I think we knew that (or am I getting mixed up with the mp1 RC?) and it 
was supposed to be a known issue...


  Issac

Foo JH wrote:

Alas, I have bad news to report:

Tech stack:
Windows 2003 Server
Apache 2.2.4
Perl 5.10.0
mod_perl 2.0.4 from 10xx/ path

Observations:
1. mod_perl is able to start
2. mod_perl is unable to survive an Apache restart signal
3. (relavant) error log available below:

[Thu Apr 17 23:39:34 2008] [notice] Parent: Received restart signal -- 
Restarting the server.
[Thu Apr 17 23:39:34 2008] [notice] Child 4532: Exit event signaled. 
Child process is ending.
[Thu Apr 17 23:39:34 2008] [notice] Apache/2.2.8 (Win32) 
mod_perl/2.0.4-dev Perl/v5.10.0 configured -- resuming normal operations

[Thu Apr 17 23:39:34 2008] [notice] Server built: Jan 18 2008 00:37:19
[Thu Apr 17 23:39:34 2008] [crit] (22)Invalid argument: Parent: Failed 
to create the child process.
[Thu Apr 17 23:39:34 2008] [crit] (OS 6)The handle is invalid.  : 
master_main: create child process failed. Exiting.
[Thu Apr 17 23:39:34 2008] [notice] Parent: Forcing termination of child 
process 36

[Thu Apr 17 23:39:35 2008] [notice] Child 4532: Released the start mutex
[Thu Apr 17 23:39:36 2008] [notice] Child 4532: All worker threads have 
exited.

[Thu Apr 17 23:39:36 2008] [notice] Child 4532: Child process is exiting




Philippe M. Chiasson wrote:

Finally, it's here and it works with Perl 5.10!


[OT] Re: Apache configuration question - restrict folder access to local machine only

2008-04-11 Thread Issac Goldstand


This really belongs on [EMAIL PROTECTED], but having been asked already...

You could put it into a separate VirtualHost container, which listens on 
127.0.0.1  Then you don't need to worry about Allow from to begin with.


  Issac

John Zhang wrote:

I have this question, and not sure if this is the
right place.  If not, I do appreciate someone pointing
me to the right place.

We have a situation that we would like to restrict the
access to certain folders only to requests from the
local machine.  Here is why:
When a page is processed by our filter, the filter
(based on page logic) may request pages (just like a
regular web page request) that should never go to the
browser.  We put these pages in a folder.  And would
like to use apache config to restrict the access to
only the local machine.  Here is the config
LocationMatch /secrete-stuff/
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#Allow from localhost
/LocationMatch

The issue we face:
When our filter issues the request, we use the
hostname from the original request. eg, original
request
http://1.2.3.4/index.html
our filter might issue
http://1.2.3.4/something/secrete-stuff/server.js

In order to make the above directive work, we will
have to put the ip (1.2.3.4) in the Allow section. 
However, we are planning to deply many servers, it
would be very hard for us to edit each config file. 
So we are wondering if there are anyway we can achieve

the same result without make ip-specific changes.

Thanks in advanvce for your help.
John


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-03 Thread Issac Goldstand




Randy Kobes wrote:

On Wed, 2 Apr 2008, Issac Goldstand wrote:


Philippe M. Chiasson wrote:
The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is 
ready. It can be downloaded here:

[ ... ]


win32 vc6 FAIL

Sorry folks, still segfaulting. Backtrace below:


I also get this crash on startup on Win32:
  perl-5.10.0 (ActivePerl 1002), Apache/1.3.34
However, given that

- it works with perl-5.8 (ActivePerl 822), where all tests pass

- most likely mod_perl-2 is used by most Windows users by now

- as Steve Hay found, it's something to do with the particular 
compile-time settings used by ActivePerl


- this looks like it may take some time to track down

I again don't want to hold this up, unless there's a
strong objection, so take this as a +1; we could put a
note in the README saying that it doesn't work yet
on perl-5.10 ActivePerl.



+1 FWIW

I need to test the 2.04 RC - somehow I missed the original notice, and 
only now noticed Randy's +1 :)


  Issac


Re: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-03 Thread Issac Goldstand




Randy Kobes wrote:

On Tue, 1 Apr 2008, Philippe M. Chiasson wrote:

The mod_perl 2.0.4 release candidate 1 Works with Perl 5.10 is 
ready. It can be downloaded here:


http://www.apache.org/~gozer/mp2/mod_perl-2.0.4-rc1.tar.gz

MD5:  1f0a941e8b5f26b6102126ae67ddbb43
SHA1: 8b2ceede3c783b9b2cc9e0fe63a095b0e4a1f000

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 on Windows.


Tested on

- linux: perl-5.8.7, Apache/2.0.55 preform - all tests pass

- Win32: perl-5.10.0 (ActivePerl 1002), Apache/2.2.8 -
'nmake test' crashes on t/modules/apache_status, but this
test passes when run individually, and also passes when
all the t/modules/* tests are run (as well as some random
combinations of earlier tests). I need to run t/SMOKE
to narrow down the combination that fails. This is something
relatively recent from svn. However, I won't be able to get
to this for a week or so, and don't want to hold this
release up, so +1.



I don't get any crash at all in my dev-env - passes all tests.

I compiled my ActivePerl (with default compile settings - this was due 
to the suspicions we had with 1.34-RC3) and was too lazy to put the 
standard binary dist back in place...


C:\mod_perl-2.0.4-rc1perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 
-D_CONSOLE -
DNO_STRICT -DHAVE_DES_FCRYPT  -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC 
-DPERL_I

MPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='12.00.8168', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, 
Off_t='__int64', lseeksi

ze=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf 
-libpath:c:

\perl\lib\CORE  -machine:x86'
libpth=\lib
libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
 comdlg32
.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib 
uuid.lib ws2_

32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib 
winspool.lib  comd
lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib 
uuid.lib

ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib
gnulibc_version=''
  Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug 
-opt:ref,icf  -

libpath:c:\perl\lib\CORE  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE
  Locally applied patches:
ActivePerl Build 1002
32809 Load 'loadable object' with non-default file extension
32728 64-bit fix for Time::Local
  Built under MSWin32
  Compiled at Feb 29 2008 13:42:32
  @INC:
C:/Perl/site/lib
C:/Perl/lib
.

C:\mod_perl-2.0.4-rc1




Re: [RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-03 Thread Issac Goldstand



Randy Kobes wrote:

On Wed, 2 Apr 2008, Issac Goldstand wrote:


Philippe M. Chiasson wrote:
The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is 
ready. It can be downloaded here:

[ ... ]


win32 vc6 FAIL

Sorry folks, still segfaulting. Backtrace below:


I also get this crash on startup on Win32:
  perl-5.10.0 (ActivePerl 1002), Apache/1.3.34
However, given that

- it works with perl-5.8 (ActivePerl 822), where all tests pass

- most likely mod_perl-2 is used by most Windows users by now

- as Steve Hay found, it's something to do with the particular 
compile-time settings used by ActivePerl


- this looks like it may take some time to track down

I again don't want to hold this up, unless there's a
strong objection, so take this as a +1; we could put a
note in the README saying that it doesn't work yet
on perl-5.10 ActivePerl.



If someone could whip it up fast, maybe detect AP-1002 in Makefile.PL 
and abort?


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-02 Thread Issac Goldstand


win32 vc6 FAIL

Sorry folks, still segfaulting. Backtrace below:

NTDLL! 7c918fea()
NTDLL! 7c90104b()
PerlIOUnix_open(interpreter * 0x009a4084, _PerlIO_funcs * 0x280cb548 
_PerlIO_unix, PerlIO_list_s * 0x008230fc, long 0, const char * 
0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 2633
PerlIOBuf_open(interpreter * 0x0001, _PerlIO_funcs * 0x280cb708 
_PerlIO_crlf, PerlIO_list_s * 0x008230fc, long 1, const char * 
0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 3692 + 27 bytes
PerlIO_openn(interpreter * 0x009a4084, const char * 0x, const 
char * 0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, 
int 0, sv * * 0x) line 1604 + 29 bytes

PerlIO_fdopen(int 0, const char * 0x280be174 `string') line 4995 + 22 bytes
PerlIO_stdstreams(interpreter * 0x009a4084) line 1212
PerlIO_resolve_layers(interpreter * 0x008230fc, const char * 0x, 
const char * 0x280b3b74 `string', int 1, sv * * 0x0012db64) line 1493 + 
6 bytes
PerlIO_openn(interpreter * 0x009a4084, const char * 0x, const 
char * 0x280b3b74 `string', int -1, int 0, int 0, _PerlIO * * 
0x, int 1, sv * * 0x0012db64) line 1575 + 20 bytes
PerlIO_open(const char * 0x0082316c, const char * 0x280b3b74 `string') 
line 5004 + 21 bytes
S_open_script(interpreter * 0x009a4084, const char * 0x0082316c, char 0, 
sv * 0x009a6adc, int * 0x0012dbec, _PerlIO * * * 0x0012dbc4) line 3705 + 
11 bytes
S_parse_body(interpreter * 0x, char * * 0x, void 
(interpreter *)* 0x10026750 mod_perl_xs_init(interpreter *)) line 2056
perl_parse(interpreter * 0x009a4084, void (interpreter *)* 0x10026750 
mod_perl_xs_init(interpreter *), int 4, char * * 0x0012dd2c, char * * 
0x) line 1651

perl_startup(server_rec * 0x003f8e88, pool * 0x003f8e60) line 704 + 27 bytes
perl_cmd_require(cmd_parms * 0x0012fe34, void * 0x003fa8f8, char * 
0x003faa88) line 621 + 28 bytes
invoke_cmd(const command_struct * 0x10094c20, cmd_parms * 0x0012fe34, 
void * 0x003fa8f8, const char * 0x0012de30) line 877 + 6 bytes
ap_handle_command(cmd_parms * 0x009a0108, void * 0x003f9a28, const char 
* 0x0012de24) line 989

ap_srm_command_loop(cmd_parms * 0x0012fe34, void * 0x003f9a28) line 1003
ap_process_resource_config(server_rec * 0x003f8e88, char * 0x6ffae000 
_ap_server_confname, pool * 0x003f8e60, pool * 0x009a0058) line 1294 + 
13 bytes
ap_read_config(pool * 0x003f8e60, pool * 0x009a0058, char * 0x6ffae000 
_ap_server_confname) line 1579

apache_main(int 6, char * * 0x00820110) line 7880 + 23 bytes
main(int 6, char * * 0x00820110) line 33 + 13 bytes
APACHE! mainCRTStartup + 227 bytes
KERNEL32! 7c816d4f()



Philippe M. Chiasson wrote:
The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is ready. 
It can be downloaded here:


http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc4.tar.gz

MD5:  ba12ce36c4c738bccfa93ab646a6824c
SHA1: 2de6ce29f44505cfdca34b7aa6499d961c72953b

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10.

The summary of what has changed since 1.30 are (from Changes):

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]



Re: [RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-02 Thread Issac Goldstand


Just to clarify a bit, this is against the exact same Apache + Perl I 
tried (and segfaulted) RC3 against.  I can't seem to grab the .mdmp from 
temp but if anyone knows how to make a dump from within the vc6 ide or 
on-demand from any other JIT debugger, I'd be happy to make one.


  Issac

Issac Goldstand wrote:


win32 vc6 FAIL

Sorry folks, still segfaulting. Backtrace below:

NTDLL! 7c918fea()
NTDLL! 7c90104b()
PerlIOUnix_open(interpreter * 0x009a4084, _PerlIO_funcs * 0x280cb548 
_PerlIO_unix, PerlIO_list_s * 0x008230fc, long 0, const char * 
0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 2633
PerlIOBuf_open(interpreter * 0x0001, _PerlIO_funcs * 0x280cb708 
_PerlIO_crlf, PerlIO_list_s * 0x008230fc, long 1, const char * 
0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 3692 + 27 bytes
PerlIO_openn(interpreter * 0x009a4084, const char * 0x, const 
char * 0x280be174 `string', int 0, int 0, int 0, _PerlIO * * 0x, 
int 0, sv * * 0x) line 1604 + 29 bytes

PerlIO_fdopen(int 0, const char * 0x280be174 `string') line 4995 + 22 bytes
PerlIO_stdstreams(interpreter * 0x009a4084) line 1212
PerlIO_resolve_layers(interpreter * 0x008230fc, const char * 0x, 
const char * 0x280b3b74 `string', int 1, sv * * 0x0012db64) line 1493 + 
6 bytes
PerlIO_openn(interpreter * 0x009a4084, const char * 0x, const 
char * 0x280b3b74 `string', int -1, int 0, int 0, _PerlIO * * 
0x, int 1, sv * * 0x0012db64) line 1575 + 20 bytes
PerlIO_open(const char * 0x0082316c, const char * 0x280b3b74 `string') 
line 5004 + 21 bytes
S_open_script(interpreter * 0x009a4084, const char * 0x0082316c, char 0, 
sv * 0x009a6adc, int * 0x0012dbec, _PerlIO * * * 0x0012dbc4) line 3705 + 
11 bytes
S_parse_body(interpreter * 0x, char * * 0x, void 
(interpreter *)* 0x10026750 mod_perl_xs_init(interpreter *)) line 2056
perl_parse(interpreter * 0x009a4084, void (interpreter *)* 0x10026750 
mod_perl_xs_init(interpreter *), int 4, char * * 0x0012dd2c, char * * 
0x) line 1651
perl_startup(server_rec * 0x003f8e88, pool * 0x003f8e60) line 704 + 27 
bytes
perl_cmd_require(cmd_parms * 0x0012fe34, void * 0x003fa8f8, char * 
0x003faa88) line 621 + 28 bytes
invoke_cmd(const command_struct * 0x10094c20, cmd_parms * 0x0012fe34, 
void * 0x003fa8f8, const char * 0x0012de30) line 877 + 6 bytes
ap_handle_command(cmd_parms * 0x009a0108, void * 0x003f9a28, const char 
* 0x0012de24) line 989

ap_srm_command_loop(cmd_parms * 0x0012fe34, void * 0x003f9a28) line 1003
ap_process_resource_config(server_rec * 0x003f8e88, char * 0x6ffae000 
_ap_server_confname, pool * 0x003f8e60, pool * 0x009a0058) line 1294 + 
13 bytes
ap_read_config(pool * 0x003f8e60, pool * 0x009a0058, char * 0x6ffae000 
_ap_server_confname) line 1579

apache_main(int 6, char * * 0x00820110) line 7880 + 23 bytes
main(int 6, char * * 0x00820110) line 33 + 13 bytes
APACHE! mainCRTStartup + 227 bytes
KERNEL32! 7c816d4f()



Philippe M. Chiasson wrote:
The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is ready. 
It can be downloaded here:


http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc4.tar.gz

MD5:  ba12ce36c4c738bccfa93ab646a6824c
SHA1: 2de6ce29f44505cfdca34b7aa6499d961c72953b

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10.

The summary of what has changed since 1.30 are (from Changes):

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]



Re: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-02 Thread Issac Goldstand


Ahem,

On that subject, libapreq1 is already a year and a half into it's latest 
release cycle.  We're still waiting for a PMC vote to finish the 
release...  Someone remind me to do a lightning talk about this next 
time I'm at AC :)


Foo JH wrote:

Fantastic! Can I assume that libapreq will be compatible with this version?

In all likelihood the only way is to try it yourself...

Philippe M. Chiasson wrote:
The mod_perl 2.0.4 release candidate 1 Works with Perl 5.10 is 
ready. It can be downloaded here:


http://www.apache.org/~gozer/mp2/mod_perl-2.0.4-rc1.tar.gz

MD5:  1f0a941e8b5f26b6102126ae67ddbb43
SHA1: 8b2ceede3c783b9b2cc9e0fe63a095b0e4a1f000

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 on Windows.

The summary of what has changed since 2.0.3 are (from Changes):

Fix $r-location corruption under certain conditions
[Gozer]

Fix a crash when spawning Perl threads under Perl 5.10
[Gozer]

Fix erratic behaviour when filters were used with Perl 5.10
[Gozer]

Fix problems with redefinitions of perl_free as free and perl_malloc
as malloc on Win32, as described at
 http://marc.info/?l=apache-modperlm=119896407510526w=2
[Tom Donovan]

Fix a crash when running a sub-request from within a filter where
mod_perl was not the content handler. [Gozer]

Refactor tests to use keepalives instead of same_interp [Gozer, Phred]

Apache2::Reload has been moved to an externally maintained
CPAN distribution [Fred Moyer [EMAIL PROTECTED]]

PerlCleanupHandler are now registered with a subpool of $r-pool,
instead of $r-pool itself, ensuring they run _before_ any other
$r-pool cleanups [Torsten Foertsch]

Fix a bug that would prevent pnotes from being cleaned up properly
at the end of the request [Torsten Foertsch]

On Win32, embed the manifest file, if present, in mod_perl.so,
so as to work with VC 8 [Steve Hay, Randy Kobes]

Expose apr_thread_rwlock_t with the APR::ThreadRWLock module
[Torsten Foertsch]

Don't waste an extra interpreter anymore under threaded MPMs when using a
modperl handler [Torsten Foertsch]

Fix a bug that could cause a crash when using $r-push_handlers() 
multiple

times for a phase that has no configured handlers [Torsten Foertsch]

Catch up with some httpd API changes
  2.2.4:
   The full server version information is now included in the error 
log at

startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description(). [Jeff Trawick]

  2.3.0:
ap_get_server_version() has been removed. Third-party modules must
now use ap_get_server_banner() or ap_get_server_description().
[Gozer]

fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
issues [Joshua Hoblitt]

*) SECURITY: CVE-2007-1349 (cve.mitre.org)
fix unescaped variable interprolation in regular expression
[Randal L. Schwartz [EMAIL PROTECTED], Fred Moyer 
[EMAIL PROTECTED]]


Make $r-the_request() writeable
[Fred Moyer [EMAIL PROTECTED]]

fix ModPerl::RegistryCooker::read_script to handle all possible
errors, previously there was a case where Apache2::Const::OK was
returned on an error.  [Eivind Eklund [EMAIL PROTECTED]]

a minor compilation warning resolved in modperl_handler_new_from_sv
[Stas]

a minor compilation warning resolved in modperl_gtop_size_string
[Stas]

Prevent direct use of _deprecated_ Apache2::ReadConfig in
Perl sections with httpd Alias directives from
incorrectly generating
'The Alias directive in x at line y will probably never match'
messages.
[Philip M. Gollucci [EMAIL PROTECTED]]

Prevent Apache2::PerSections::symdump() from returning invalid
httpd.conf snippets like 'Alias undef'
[Philip M. Gollucci [EMAIL PROTECTED]]

Require B-Size 0.9 for Apache2::Status which fixes
Can't call method script_name on an undefined value
[Philip M. Gollucci [EMAIL PROTECTED]]

-march=pentium4 or anything with an = in it in CCFLAGS or @ARGV
that gets passed to xs/APR/APR/Makefile.PL broke the @ARGV
parsing.  I.E. FreeBSD port builds when users had CPUTYPE
set in /etc/make.conf.
[Philip M. Gollucci [EMAIL PROTECTED]]

Fixes to get bleed-ithread (5.9.5+) to comile again.
[Philip M. Gollucci [EMAIL PROTECTED]]



Re: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-02 Thread Issac Goldstand


William A. Rowe, Jr. wrote:

Issac Goldstand wrote:


Ahem,

On that subject, libapreq1 is already a year and a half into it's 
latest release cycle.  We're still waiting for a PMC vote to finish 
the release...  Someone remind me to do a lightning talk about this 
next time I'm at AC :)


Time for a FFT presentation - 15 minutes on cutting edge POST handling
using apreq?  Just give [EMAIL PROTECTED] a title, 
abstract,

presenter and short bio.



Not I - I won't be there.  I'm trying to get my wife (and boss, but he's 
less of an issue if I can talk there) to come around to the idea of AC 
US 2008.  I can do it then.


Re: modperl with SSL

2008-03-24 Thread Issac Goldstand


a backend server - the server that REALly serves the request.

Foo JH wrote:

What is a realserver?

J. Peng wrote:

hello list,

we have our own realserver called QHttpd.
This realserver doesn't support SSL protocal (https).
So I have to develop a proxy before QHttpd to get it be compatible 
with SSL.

I was thinking using modperl handler to do it.
modperl accept the SSL connection from clients, do the verification,
and if it's valid, redirect it to realserver with non-SSL (common
http) protocal.
Is it possible? if so, how to begin with it? at which stage?
Thanks in advance.

B. Regards,
Joy P.
  


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC3

2008-02-29 Thread Issac Goldstand


Randy, I'm going to start building from scratch using ASF source + AS 
source, using default compile options, and we'll see where it goes. 
Have I mentioned lately how much I *hate* bootstrapping CPAN (for 
prereqs) on Win32? :-p


  Issac

Steve Hay wrote:

Randy Kobes wrote:

On Thu, 28 Feb 2008, Issac Goldstand wrote:


Steve Hay wrote:

Issac Goldstand wrote:


win32  (xp sp2, vc6 - no SDK upgrade) - Apache 1.41 binary -
ActivePerl 5.10 (build 1002) FAIL

(sorry, folks)

Segfault at startup.

I wonder if this is caused by mis-matched CRTs? ActivePerl is built
using VC6 (and therefore uses MSVCRT.dll). You're also using VC6 for
mod_perl, but where did that Apache binary come from? What compiler
was it built with? 


Does it work if you build everything yourself from source with the
same compiler? 


I'm reasonably sure that Apache's binaries are still being built
with vc6, which is what prompted me to test this particular set of
prerequisites (since binary Apache + binary ActivePerl will be the
assumed building blocks for a binary PPM package to be installed
upon).   Bill, am I wrong about the compiler used for the ASF binary
release of apache-1.3 win32? 

I also got a segfault at startup with ActivePerl 1002
(perl-5.10), using an ASF apache binary and VC++ 6.
All tests passed with the latest ActivePerl 8xx, based on
perl-5.8, using the same Apache binary and compiler.
Steve, is your Perl built using the ActivePerl sources,
with the same compile-time flags as ActivePerl?


No, mine is built from the official 5.10.0 source with my usual
configuration changes (USE_MULTI, USE_ITHREADS, USE_IMP_SYS and
USE_LARGE_FILES switched off, and PERL_MALLOC and DEBUG_MSTATS switched
on).


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC3

2008-02-28 Thread Issac Goldstand


Steve Hay wrote:

Issac Goldstand wrote:
  

win32  (xp sp2, vc6 - no SDK upgrade) - Apache 1.41 binary -
ActivePerl 
5.10 (build 1002)

FAIL

(sorry, folks)

Segfault at startup.



I wonder if this is caused by mis-matched CRTs? ActivePerl is built
using VC6 (and therefore uses MSVCRT.dll). You're also using VC6 for
mod_perl, but where did that Apache binary come from? What compiler was
it built with?

Does it work if you build everything yourself from source with the same
compiler?
  
I'm reasonably sure that Apache's binaries are still being built with 
vc6, which is what prompted me to test this particular set of 
prerequisites (since binary Apache + binary ActivePerl will be the 
assumed building blocks for a binary PPM package to be installed 
upon).   Bill, am I wrong about the compiler used for the ASF binary 
release of apache-1.3 win32?


I'm going to try to make time over the weekend to build apache + 
activeperl from source and see if that changes anything.


 Issac

In any case, I'll try to grab ActiveState's source distro and build with 
that.


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC3

2008-02-26 Thread Issac Goldstand


win32  (xp sp2, vc6 - no SDK upgrade) - Apache 1.41 binary - ActivePerl 
5.10 (build 1002)

FAIL

(sorry, folks)

Segfault at startup.

last line in mod_perl-land:
mod_perl.c : 704
   status = perl_parse(perl, mod_perl_xs_init, argc, argv, NULL);

I can't download the AS perl source - it keeps stopping  or hanging in 
the middle, but that NULL going up the stack doesn't look healthy...


backtrace:

NTDLL! 7c918fea()
NTDLL! 7c90104b()
PerlIOUnix_open(interpreter * 0x009ac144, _PerlIO_funcs * 0x280cb548 
_PerlIO_unix, PerlIO_list_s * 0x008243cc, long 0, const char * 
0x280be25c `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 2633
PerlIOBuf_open(interpreter * 0x0001, _PerlIO_funcs * 0x280cb708 
_PerlIO_crlf, PerlIO_list_s * 0x008243cc, long 1, const char * 
0x280be25c `string', int 0, int 0, int 0, _PerlIO * * 0x, int 0, 
sv * * 0x) line 3692 + 27 bytes
PerlIO_openn(interpreter * 0x009ac144, const char * 0x, const 
char * 0x280be25c `string', int 0, int 0, int 0, _PerlIO * * 0x, 
int 0, sv * * 0x) line 1604 + 29 bytes

PerlIO_fdopen(int 0, const char * 0x280be25c `string') line 4995 + 22 bytes
PerlIO_stdstreams(interpreter * 0x009ac144) line 1212
PerlIO_resolve_layers(interpreter * 0x008243cc, const char * 0x, 
const char * 0x280b3c5c `string', int 1, sv * * 0x0012fc58) line 1493 + 
6 bytes
PerlIO_openn(interpreter * 0x009ac144, const char * 0x, const 
char * 0x280b3c5c `string', int -1, int 0, int 0, _PerlIO * * 
0x, int 1, sv * * 0x0012fc58) line 1575 + 20 bytes
PerlIO_open(const char * 0x0082443c, const char * 0x280b3c5c `string') 
line 5004 + 21 bytes
S_open_script(interpreter * 0x009ac144, const char * 0x0082443c, char 0, 
sv * 0x009aebcc, int * 0x0012fce0, _PerlIO * * * 0x0012fcb8) line 3705 + 
11 bytes
S_parse_body(interpreter * 0x, char * * 0x, void 
(interpreter *)* 0x10026740 mod_perl_xs_init(interpreter *)) line 2056
perl_parse(interpreter * 0x009ac144, void (interpreter *)* 0x10026740 
mod_perl_xs_init(interpreter *), int 2, char * * 0x0012fe20, char * * 
0x) line 1651

perl_startup(server_rec * 0x003f8ee8, pool * 0x003f8ec0) line 704 + 27 bytes
perl_module_init(server_rec * 0x003f8ee8, pool * 0x003f8ec0) line 571 + 
13 bytes
ap_init_modules(pool * 0x003f8ec0, server_rec * 0x003f8ee8) line 1607 + 
4 bytes

post_parse_init() line 7450
apache_main(int 1, char * * 0x00820040) line 7943
main(int 1, char * * 0x00820040) line 33 + 13 bytes
APACHE! mainCRTStartup + 227 bytes
KERNEL32! 7c816d4f()


Philippe M. Chiasson wrote:
The mod_perl 1.31 release candidate 3 Works with Perl 5.10 is ready. 
It can be downloaded here:


http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc3.tar.gz

MD5:  979059e20febef686e7c2a4d55fe3683
SHA1: c747ef7d605694ca935795ea7793ea7c77dfa920

The summary of what has changed since 1.30 are (from Changes):

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]





Re: Visual Studio 2008 and ActiveState Perl 5.10 updates

2007-12-29 Thread Issac Goldstand
-0.5

I would actually like to see builds prepared against MSVCRT80, which is
available in the Vista SDK's bundled free compiler, rather than having
users need to download the SDK + VS Express Edition + configure the one
to find and work with the other (a royal pain).  As long as the latest
SDKs are bundled with compilers (for x86, amd64 and even the ia64 for
those who find that useful) there's no reason not to keep the build
procedure as simple as possible for those of us *cough* who prefer not
to buy a new VS suite every time MS feels like trying to send me one :-)

My $0.02,
  Issac

William A. Rowe, Jr. wrote:
 Well folks, here's the news...
 
 Studio 2008, true to form, proves that MS is incapable of keeping
 around a stdc library any longer than one product cycle.  Yes, our
 long awaited (not) MSVCR90 is here.
 
 Just to put it in perspective, cross-library malloc/free, stdio and
 some other facilities are tightly integrated into the clib, such that
 compiling the application under one flavor, and using a library of
 another which modifies the application's memory/stdio allocations
 causes no end of troubles.
 
 You might be also curious if AS is making progress at coming to a new
 baseline msvcrt for perl, since they had adopted Studio 2003's msvcr71
 for python.  Unfortunately, this version is also built under msvcrt.
 
 The obvious question, why not compile apache and perl under vc 8 or 9
 but link to msvcrt.dll?  The trouble which comes in here is that their
 std headers correspond to msvcr90, not to msvcrt.  As that library
 evolves, it's going to inevitably drift from the msvcrt.lib.
 
 My instinct, with 2008 adding the new SDK features for apr such as
 multicast group filtering, and the continued availability of a 2008
 'express'/'lite' free version, is to take httpd 2.4 (3.0?) binaries
 for apache httpd to this 2008 release.  Yes, probably retain either
 .dsp files, or a makefile structure which allows folks to build to
 anything from VC6 to a 'plain SDK' (it now includes the compilers
 and tools), but for binaries, this will become foobar for folks who
 use ActiveState.
 
 Perl 5.10 is interesting for it's attention to Win32 64P model builds
 (64ILP reflects an OS which represents int, long, pointer as 64 bits,
 so Win32's 64P model reflects a 32 bit int/long, and 64 bit pointer).
 Because 64P is unusual in the family of 64 bit OS's, it's received the
 least attention of all of the platforms.  Perl 5.10 is purported to catch
 win32 up significantly to the tried-and-true linux, solaris, bsd 64 bit
 flavors.
 
 So I'm posting this mostly for feedback to the rational of moving to
 a compiler that will generate reliable 32 *and* 64 bit builds of httpd,
 will be freely available (the point of the ASF is the source, and that
 users can do something with it), and that decision will be locked at
 the 2.4 release based on our strong commitment to binary compatibility.
 
 It's very true that modules compiled for another runtime can coexist
 very happily when the module does not free allocations from another
 component, don't attempt to share faux-posix stdio resources, etc.
 mod_aspdotnet is a great example; compiled with VS.NET or VS2005 it
 lives very happily in a VC6 build of httpd.  But the way that perl,
 mod_perl and httpd interact is not that trivial, and highly prone to
 this class of problems.  So I figure if there's a plan here, it will
 likely satisfy the 80/20.
 
 If AS Perl can't part of that solution, so be it.
 
 Bill
 


Re: Hook Ordering

2007-11-27 Thread Issac Goldstand
Access handler always comes *before* authentication/authorization.
Maybe add the legal agreement as part of the authorization handler or as
a Fixup handler?

See
http://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases

  Issac

David Eisner wrote:
 We have a section of our website that is protected by Basic
 username/password authentication.  I've been asked to setup a system
 where, once successfully authenticated, users are taken to a legal
 agreement page which they are asked to accept before they can continue
 to the page they requested.
 
 I'm using mod_perl 2.0.3 to implement this.  The basic system now
 works.  I have a PerlAccessHandler installed for the protected portion
 of the site, which checks for the presence of an ACCEPT_LA cookie.
 If the cookie is not set, the user is redirected to a form with the
 agreement and I Agree / I Do Not Agree buttons.  If they agree,
 the ACCEPT_LA cookie is set and they are redirected to the page they
 originally requested.
 
 The only problem right now is that when visiting a URL in the
 protected part of the site, the user *first* gets taken to the legal
 agreement, and if they accept it, they are *then* asked to login.  The
 desired behavior is that the user first gets the Basic AuthType
 username/password dialog, and if they successfully login, then they
 get taken to the agreement page.
 
 How can I change the ordering of the handlers to achieve this?  I
 checked the documentation and it seems incomplete, indicating that
 Hook Ordering is not working.  [1]  Is that the end of the story?
 
 Thanks.
 
 -David
 
 [1] 
 http://perl.apache.org/docs/2.0/user/handlers/intro.html#Hook_Ordering__Position_
 
 


Re: REST

2007-11-27 Thread Issac Goldstand
Excellent question, and very easily doable.  You want to look at the
PerlTransHandler

http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlTransHandler

  Issac

Beginner wrote:
 Hi,
 
 I hope this isn't a dumb question. 
 
 I want to try and create a small REST style installation and was 
 considering how to overcome the problem of urls in the form
 
 http://www.myfactory.com/parts/1234
 
 The resource after /parts could in theory be any number but you would 
 not want to have a Location for each part that existed. Rather 
 you'd want the handler responsible for /parts to check your db and 
 return either content or 400. 
 
 On the face of it this is the sort of thing mod_perl should excel at. 
 Does it? Can you intercept requests like this one above? Which API 
 methods should I be looking at?
 
 TIA,
 Dp.


Re: dev environment

2007-11-05 Thread Issac Goldstand
For what it's worth, that's exactly how I handle my dev environments.
Samba share on a VMware machine configured the same as the server.  The
samba share is taken from subversion (eg, a local working copy) and I
can manage commits even from windows systems.  I also have the advantage
of having the same software installed as on the production server, so
less chances of different behavior on each end.  MySQL is kept up-do-dte
via replication from the live server.

  Issac

Jeff Armstrong wrote:
  Original Message 
 Subject: Re:32  64 bit memory differences
 From: Mark Maunder [EMAIL PROTECTED]
 To: Octavian Rasnita [EMAIL PROTECTED]
 CC: modperl@perl.apache.org
 Date: 05 November 2007 06:32:11
 
 I wouldn't recommend doing dev on windows for a linux environment.
 Dual boot your machine with Ubuntu linux and use that instead. It'll
 save you a lot of time and headaches.
 
 
 Or even make yourself a virtual PC using MS Virtual PC and install a
 Linux / Apache / Modperl / Samba / MySQL / SVN etc into it (e.g. Debian
 is easy, or whatever you need for your prod).
 
 Put samba on the virtual linux box so you can edit code directly using
 your fav PC editor. Each developer gets his own Linux environment, which
 he can cart around on laptops etc, and can bounce apache without killing
 anyone else etc. And once you have made one virtual Linux box, it is
 easy to clone it.
 
 Jeff



Re: UDP support in mod_perl2/apache

2007-11-01 Thread Issac Goldstand
I put out a patchset a few months ago to support UDP in trunk and 2.2.x
branches of httpd (for a mod_dns protocol module that we're  currently
in the process of releasing to the public).  The patchset only works for
the unix flavor of APR and the prefork MPM at the moment (I'm sure if it
gets adopted we can work out the other MPMs and APR flavors)

You can grab the patchset for trunk at
http://www.mail-archive.com/[EMAIL PROTECTED]/msg37727.html

The same patchset can be used for 2.2.x branch pretty much as is with
the single addition of backporting the apr_socket_sendto function from
trunk (it's broken in the APR that ships with 2.2.x)

If you have any issues applying it/using it/integrating with mod_per
(though I don't think the mod_perl API should need any tweaking to
utilize this), I'd be happy to work with you (or whomever else).

With ApacheCon  the hackathon coming up soon, this would be a great
time to ping [EMAIL PROTECTED] for possible inclusion in trunk...

  Issac

Rolf Banting wrote:
 Hi,
 
 I'd like to able to transplant a kind of gateway app I have written
 from a POE to mod_perl2. Why? Well mainly so I have an excuse to get
 into mod_perl2  apache.
 
 What the app does is accept client requests in a proprietrary protocol
 carried over UDP and translate them either into synchronous CORBA
 calls or asynchronous requests over the proprietrary protocol to an
 external server. In turn server repsonses are then translated and sent
 back to the original client.
 
 I have scanned the mail archives and found references to some UDP
 based work that different people were doing but I can't see if
 anything got released.
 
 Did the mod_udp development get into release mode or are there other
 ways to get mod_perl to listen to UDP ?
 
 Thanks in advance,
 
 Rolf



Re: Test Server

2007-10-16 Thread Issac Goldstand
I've had amazing experience setting up development sandboxes with VMWare
Workstation and deploying them on Player (which means less investment in
licenses).  I use MySQL replication from the live server for keeping the
DBs in sync and SVN for file management.  If I've got people who use
win32 as their workstation OS (I frequently do), I add a samba share to
make file editing even easier.  I find that with 128-256 MB RAM and a
few GB diskspace spare on the developers workstations this makes
development easier on everyone.

If you have need/want, you can use VMWare ACE to further control access
to the dev sandboxes (from dealing with consultants who need temporary
access to renegade employees) but that costs more.

  Issac

Perrin Harkins wrote:
 On 10/15/07, jk jk [EMAIL PROTECTED] wrote:
 Sorry, 1 server under which all developers run a separate copy of the app
 using their own URI.
 
 I think you have your answer then: run a separate server for each
 developer.  That's what I consider the normal way to do it, and it's
 easy.  You don't even need to install separate binaries -- just start
 the server with a custom httpd.conf specifying the port or IP to use.
 
 I think it's even better when each developer runs their own server on
 their own machine, but that's not necessary for fixing your current
 problem.
 
 There are some other things you could try for running a different @INC
 per VirtualServer with mod_perl 2, which you'll find in the mail
 archives.  I find it a lot more convenient to have an actual separate
 server so you can restart it when you need to.  (Apache2::Reload is
 not perfect, since Perl really has no way to reload a module.)
 
 - Perrin


Re: redirect

2007-10-06 Thread Issac Goldstand
Send a Location: header back instead of a full response and return
HTTP_MOVED_TEMPORARILY from your handler.

If you want/need to return a response from the page, you can
alternatively use an HTML META tag in the header to accomplish the same
effect.

  Issac

Eli Shemer wrote:
 Hey there,
 
 I constructed a logout button which simply refers you to a page that
 takes away your cookie and then redirects you the main page.
 
 Internal_redirect however does not seem to be the best use in this case
 since, apparently, the address bar is not updated accordingly and even
 the cookie is not taken into account yet(I have to refresh the main page
 again)
 
  
 
 One possible option might be porting Apache::Request::Redirect to
 mod_perl2 but I wanted to hear more suggestions if possible.
 
 Preferrebly not using mod_rewrite or modifying any other apache
 configuration.
 
  
 
 Thanks all.
 


Re: Downloading SpreadSheet Data with Apache

2007-09-23 Thread Issac Goldstand
Make sure that you set a TimeOut in httpd.conf greater than your 
script's delay:

http://httpd.apache.org/docs/2.2/mod/core.html#timeout

 Issac

Tyler Bird wrote:

Michael Peters wrote:

Tyler Bird wrote:

 
I run this script and the log files show the incrementing numbers in 
the

for loop, but
whats weird is that the browser seems to still be downloading you 
know

that little icon seems to be spinning
and I see no output not and html header of any line of text.



You need to tell the server not to buffer your output. Do something 
like this at

the top of the routine you use to output the stream.

  local $| = 1;

 

any ideas on why the browser is not receiving or the webserver is not
sending this content?



If you need to know what's happening HTTP wise, use some network 
analyzing tool
like ethereal. But my guess is just that your web server isn't 
sending the info

yet cause it's buffer isn't full.

  
Yes I did try this ( putting in the $| = 1 ) and the behavior did not 
change the browser still appeared to be downloading
and the log files had all the numbers in the for() loop.   my browser 
didn't seem to receive the content-type or the body of the response ( 
statments below for loop )

I am going to re look over $|


Here is the full version incase there is something I am missing.

--cut

local $| = 1;

require in;

my $max = 60 * 8;

foreach ( my $i = 0; $i  $max; $i++)
{
   warn(sleeping, iteration:  . $i);
   sleep(1);

}

in::ct();
print(I rendered);

-- end


Re: post data

2007-09-15 Thread Issac Goldstand
I'd personally go with Apache2::Request (for the fast C parsers).
CGI.pm is useful if you need more portable code (although
Apache2::Request could be used for normal CGI these days if APR is
available)

  Issac

Eli Shemer wrote:
 Hey there.
 
  
 
 I yesterday compiled and installed  apache2  on our company's server but
 it's currently on port 8080 for further testing.
 
 I'm currently updating our perl code to run natural mod_perl 2 code and
 there's something I've stumbled upon.
 
  
 
 Usually what we do is grep the POST data using the apache request's
 content method which I see is no more available.
 
  
 
 $r = Apache-request();
 
  %params = $r-method eq 'POST' ? $r-content : $r-args;
 
 This is unusable code now days I gather.
 
  
 
 Currently I'm using Apache::RequestRec in my tests but it only supports
 the args method which doesn’t fit my needs, cross project.
 
  
 
 I've read through the docs and saw that I have two available options:
 
 1.   using libapreq's Apache2::Request And then something like
 $apr-param('var') would work.
 
 2.   using Apache2::RequestIO directly and it's read method. Which
 seems a bit dirty.
 
  
 
 I would appreciate if someone could provide some more information and
 possibly suggest the preferred way of doing this, before I implement it
 to all of the files.
 
  
 
 Thanks a lot.
 
  
 


Re: apr

2007-09-15 Thread Issac Goldstand
Probably because the $r you're passing it is just Apache2::RequestRec
and not really the request object that Apache2::Request wants...

  Issac

Eli Shemer wrote:
 Hey again
 
 Once I add the apr object I get no error but I also receive no output on
 the screen.
 
 Any thoughts ?
 
  
 
 #!/usr/bin/perl
 
 use Apache2::Request;
 
  
 
 my $r=Apache2::RequestRec;
 
 #my $apr = Apache2::Request-new($r);   
 
 $r-content_type('text/html');
 
 $r-headers_out();
 
 print bla;
 


Re: [RELEASE CANDIDATE] libapreq2 2.09-RC2

2007-08-09 Thread Issac Goldstand
Phillip,
  If it helps you move along better and have more time to review both 1
 2, I'll voulenteer to pick up RMing 2.09 in addition to 1.34 so we can
get them both out the door.  Let me know.

  Issac

Philip M. Gollucci wrote:
 Are we going to have 2.09 release? It's been quite some time since RC2
 actually, i'd like to see an RC3-- there was an issue I kept
 complaining about  that Joe was going to solve thanks to some testing
 by [EMAIL PROTECTED] -- reference the posting on 2007.05.25
 The RC3 was what I meant.

 what are you doing there, if you don't mind me asking... i noticed
 that they were hiring ruby people a while back.  i feared we lost you.
 The only and only System Admin (FreeBSD + ruby/rails) and worthless
 'windows business' network.

 The fun comes soon when we move into Equinix.





Re: [mp2] Segmentation faults with threaded worker-mpm

2007-06-04 Thread Issac Goldstand
I'm a bit confused here...  Perrin, isn't what Jani is mentioning here
exactly what Stas wanted to accomplish (well, one specific detail of
what he wanted to accomplish) with mp2, with the specific result in mind
of eliminating the common Apache 1 issue of using the 2 backend
(mp/static) with a single front-end, or am I dreaming?

  Issac

Perrin Harkins wrote:
 On 6/4/07, Jani M. [EMAIL PROTECTED] wrote:
 With prefork, running ~ 600 processes results in roughly 700MB of memory
 consumption. This obviously gives us 600 client download slots, and
 600 perl interpreters, and leaves some memory for other processes and
 disk caching.

 With the threaded worker mpm, I can run ~150 processes, each with 20
 threads, and 3 perl interpreters. This will use about the same about of
 memory, so roughly 700MB. This in turn gives us 3000 client download
 slots, but only 450 perl interpreters.

 There's no reason to run more interpreters under prefork.  Don't make
 your mod_perl server handle static files.  Serve them with a separate
 apache or some other proxy server.

 But I think the bigger picture that you're missing here is
 copy-on-write sharing.  When you fork processes, most of the memory is
 actually shared internally by the virtual memory system, so it isn't
 using physical RAM.  You might have very large processes which only
 use a few MBs of actual RAM each.  Threads don't get this benefit.
 They have to copy everything when a new thread is started and there is
 no copy-on-write sharing.  It results in some really large differences
 in terms of physical RAM needed per perl interpreter.  If you run 100
 interpreters with a threaded MPM and 100 with prefork, the prefork
 ones will use a lot less of your real memory.

 When most of the time the client uses is not spent inside the mod_perl
 handlers or filters, but rather downloading the actual content,
 'PerlInterpScope handler' can be a lifesaver - a few interpreters can
 easily handle the load for a much higher number of client threads.

 That's what the proxy setup is for.  The mod_perl setup just dumps the
 file very quickly to the proxy, and the proxy deals with spooning it
 out the clients.

 I know what you mean, but the problem here is that this mod_perl server
 *is* the reverse proxy :) There are several backend servers which this
 server will both proxy and cache the content for - mod_perl is, putting
 it simply, just needed for additional intelligence.

 If what you're saying is that you can't separate out the mod_perl bits
 with a proxy because they do things like authentication, you might be
 interested in seeing what LiveJournal does with their proxy called
 perlbal.  They use a system of internal redirects to let mod_perl
 handle auth functions and pass the file serving off to perlbal.  You
 can read about it in Brad Fitzpatrick's presentation (around silde
 45):
 http://www.danga.com/words/2007_04_linuxfest_nw/linuxfest.pdf

 - Perrin



[RELEASE CANDIDATE] libapreq 1.34-RC3

2007-05-30 Thread Issac Goldstand
The apreq developers are planning a maintenance release of
libapreq1.  This version primarily addresses an issue noted
with FireFox 2.0 truncating file uploads in SSL mode.

Additionally, the memory allocation algorithm for multipart
requests has been improved.

Please give the tarball at

http://people.apache.org/~issac/libapreq-1.34-RC3.tar.gz

a try and report comments/problems/etc. to the apreq-dev list
at [EMAIL PROTECTED]

Thanks,
  Issac



Re: Odd problem

2007-05-08 Thread Issac Goldstand
What OS?  Is Perl on the system path?

The Doctor wrote:
 I am runnng Apache 2.059 and perl 5.8.8 .

 I am trying to compile the most recent version of mod_perl 2

 however once install, Apache says  it cannot find the so even
 tough it is there.

 Pointers please.

   



[RELEASE CANDIDATE] libapreq 1.34-RC2

2007-04-27 Thread Issac Goldstand
The apreq developers are planning a maintenance release of
libapreq1.  This version primarily addresses an issue noted
with FireFox 2.0 truncating file uploads in SSL mode.

Please give the tarball at

http://people.apache.org/~issac/libapreq-1.34-RC2.tar.gz

a try and report comments/problems/etc. to the apreq-dev list
at [EMAIL PROTECTED]

Thanks,
  Issac


[RELEASE CANDIDATE] libapreq 1.34-RC1

2007-04-23 Thread Issac Goldstand
The apreq developers are planning a maintenance release of
libapreq1.  This version primarily addresses an issue noted
with FireFox 2.0 truncating file uploads in SSL mode.

Please give the tarball at

http://people.apache.org/~issac/libapreq-1.34-RC1.tar.gz

a try and report comments/problems/etc. to the apreq-dev list
at [EMAIL PROTECTED] 

Thanks,
  Issac


Re: [Fwd: Call for Papers Opens for ApacheCon US 2007]

2007-04-16 Thread Issac Goldstand
ISn't that kind of short notice?  Even for a proposal and certainly for
the paper...

Geoffrey Young wrote:
 The paper submission deadline is Monday, 28 April 2007, Midnight GMT.
 
 note that the date (april 28) is correct, but it's a saturday not a monday.
 
 --Geoff


Re: Apache2::Request for ActivePerl Win32

2007-03-29 Thread Issac Goldstand
Absolutely.  Set up Randy Kobes's PPM repository
(http://theoryx5.uwinnipeg.ca/ppms/ for latest ActivePerl with PPM4
(build 819 and above) or
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58 for
earlier versions).  There's also a binary mod_perl2 there.

  Issac

Kelvin Wu wrote:
 Hi list,
  
 Is there a Apache2::Request module for ActivePerl Win32 (v5.8.8 built
 for MSWin32-x86-multi-thread) and mod_perl 2?
  
 I am trying to read parameters from query, the $r-args() call in
 mod_perl 2 simply returns whole URI rather than key/value hash which
 mod_perl1 does. After some research, Apache2::Request does parse query
 parameters but ActivePerl seems not provide such module. How can I
 install this module under Windows? Or is there any other way to get
 parameters from GET/POST?
  
 Windows XP, ActivePerl 5.8.8, mod_perl 2, Apache 2.2.3
  
 Thanks
 
 
 -- 
 Sent from my BlackBerry. Ignore the typos unless they're funny.


Re: [mp2] aborting a file upload

2007-03-08 Thread Issac Goldstand
I'm not positive, but I think it's dangerous as it can screw up
pipelined requests - that's why discard_request_body exists.  I've cc-ed
[EMAIL PROTECTED] as all the smart HTTP people hang out there :-)  and maybe one
of them can either confirm or correct that statement.

  Issac

Matt Williamson wrote:
 I wrote a filter which I think does the trick. It seems to work. In the
 filter I send end of stream (eos) if the content length is too large,
 otherwise just pass the data along. The filter is registered as a
 PerlInputFilterHandler, which according to the docs only gets called on
 the body, not the headers.
 
 Since I am new to mod_perl, could anyone comment on whether this is a
 dangerous thing to do?
 
 Code below 
 
 Matt
 
 use base qw(Apache2::Filter);
 
 use Apache2::Const -compile = qw(OK :log);
 use APR::Const-compile = qw(SUCCESS);
 use Apache2::RequestRec ();
 use Apache2::Log ();
 
 use constant BUFF_LEN = 4092;
 
 use constant CONTENT_LIMIT = 104857600;
 
 sub handler : FilterRequestHandler {
 my $f = shift;
 # get the request.
 my $r = $f-r;
 my $contentLength = $r-headers_in-{'Content-Length'};
 if ($contentLength  CONTENT_LIMIT) {
   # send an end of stream
   $f-seen_eos(1);
 } else {
   while ($f-read(my $buffer, BUFF_LEN)) {
   $f-print($buffer);
   }
 }
 
 Apache2::Const::OK;
 } 
 


Re: [mp2] aborting a file upload

2007-03-06 Thread Issac Goldstand
I'm not sure it's possible to abort the read.  I think the server must
finish the read before the client will accept any response data.  IIRC,
discard_request_body still performs a read on the socket; it just
doesn't do anything with the read data.

  Issac

Matt Williamson wrote:
 I am trying to write a mod_perl handler to take POST requests which have
 some parameters encoded in the url string, and a body that needs to be
 saved to a file. It is not like a conventional file upload from a form.
 
 I want to implement a limit on the size of the body that can be
 uploaded. However, I do not want to return a failure to the client in
 that case, rather I want to process the header information (saving it to
 a database), but just not save the file. The problem I am having is that
 I cannot figure out how to throw away the data if it is above a certain
 size limit, without loading all the data.
 
 I have a module registered as a PerlResponseHander, with code somewhat
 like 
 
 my $contentLimit = 104857600;
 
 sub handler {
 my $r = shift;
 my $req = Apache2::Request-new($r);
 my $contentLength = $r-headers_in-{'Content-Length'};
 
 # figure out if we have been sent too much stuff
 if ($contentLength  $contentLimit) {
r-log_error($r, not saving because:  . $req-body_status());
 } else {
saveZipData($r, $outFile);
 }
 
   # write data from headers to database
   persistHeaderInfo(...);
 
   # return ok
   return Apache2::Const::OK;
 }
 
 sub saveZipData {
 my ($r, $outFile) = @_;
 my $buffer;
 my $data;
 open OUT, $outFile or die Could not open $outFile for output:
 $!;
 binmode OUT;
 while ($r-read($buffer, 4092)) {
 $data .= $buffer;
 print OUT $buffer;
 }
 close OUT;
 }
 
 I find that the very large file gets completely loaded, just not saved
 to disk. What I want to happen in the case of a large upload is for the
 file not to be uploaded, and just the headers processed and the database
 updated. E.g. so that that response time for the client with a very
 large upload is short.
 
 I have tried POST_MAX on the Apache2::Request creation, but that just
 appears to write an error message. 
 
 I have tried reading the documentation on filters. Do I need to make an
 input filter to throw away the data if it is larger than a certain size?
 If so, how? Should I be saving the data to file in a filter or is it ok
 to do it in a PerlResponseHandler?
 
 There are also calls on the RequestRec object like
 discard_request_body(), but these don't seem to alter the behavior that
 I see.
 
 Any help would be much appreciated
 
 Cheers
 
 Matt
 


Re: How to obtain the raw http content?

2007-02-13 Thread Issac Goldstand
 Foo JH wrote:
 Hi all,

 Can anyone point me in the right direction? I am expecting POST with
 XML content, so the usual parser won't work...I think.

FYI, The libapreq (aka, Apache::Request) API (at least, the C API) lets
you define your own parsers.  See
http://httpd.apache.org/apreq/docs/libapreq2/apreq__parser_8h.html#562191171c5df0a83360435d0fe1a667

The Perl docs mention an APR::Request::Parser object that can be passed
to apreq, but I don't see any docs for it, and don't know the XS glue
for version 2 well enough to comment further, but if it interests you,
it might be worth looking into.

  Issac


Re: [RFC] two ajax-related packages

2007-02-06 Thread Issac Goldstand
Randy Kobes wrote:
 I'd be interested in any comments about these
 packages, including their names. CGI::Apache2::Ajax
 was tentatively chosen because, first of all, it only
 provides CGI.pm-compatible methods that the above two Ajax-related
 applications need, and also, CGI::Ajax
 expects the CGI object to satisfy
ref($cgi) =~ /^CGI.*/
 Note though that, due to the nature of the APR::* modules
 used, CGI::Apache2::Ajax can also be used in a CGI
 environment. Thanks.
 

Maybe I'm missing something, but why not autodetect Apache2::Request +
mod_perl2 presence and fallback to CGI if it doesn't work?

Something like:

if (exists $ENV{MOD_PERL_API_VERSION} 
$ENV{MOD_PERL_API_VERSION} = 2 
eval {require Apache2::Request}) {
... mod_perl mode ...
} else {
... CGI mode ...
}

  Issac


Re: [RFC] two ajax-related packages

2007-02-06 Thread Issac Goldstand


Randy Kobes wrote:
 On Tue, 6 Feb 2007, Issac Goldstand wrote:
 
 Randy Kobes wrote:
 I'd be interested in any comments about these
 packages, including their names. CGI::Apache2::Ajax
 was tentatively chosen because, first of all, it only
 provides CGI.pm-compatible methods that the above two Ajax-related
 applications need, and also, CGI::Ajax
 expects the CGI object to satisfy
ref($cgi) =~ /^CGI.*/
 Note though that, due to the nature of the APR::* modules
 used, CGI::Apache2::Ajax can also be used in a CGI
 environment. Thanks.


 Maybe I'm missing something, but why not autodetect Apache2::Request +
 mod_perl2 presence and fallback to CGI if it doesn't work?

 Something like:

 if (exists $ENV{MOD_PERL_API_VERSION} 
$ENV{MOD_PERL_API_VERSION} = 2 
eval {require Apache2::Request}) {
... mod_perl mode ...
 } else {
... CGI mode ...
 }
 
 This type of check is done to see if one is running in a
 mod_perl environment, and if so, the Apache2::RequestRec
 object $r is used for things like setting the content-type
 header. For fetching parameters, however, Apache2::Request
 can also be used in a CGI environment, which may be
 useful for applications for which speed and/or memory
 is a concern. Thus, CGI::Apache2::Ajax relies completely
 on mod_perl2 and libapreq2, the intent being that it's
 up to the package needing these methods to use CGI if
 CGI::Apache2::Ajax isn't available (which Apache2-Ajax
 and Apache2-Autocomplete do).
 

Right, but I don't know of too many people using libapreq's perl glue
without mod_perl (and frankly wouldn't expect to at least until APR's
perl glue is separated from the rest of mod_perl)


Re: How to extract a parameter

2007-01-16 Thread Issac Goldstand


Fred Moyer wrote:
 Issac Goldstand wrote:
 I personally never liked using CGI with mod_perl; if I'm going through
 the trouble of writing optimized handlers to make my application that
 much faster, why use a pure-perl solution that needs to do full parsing
 in perl-land, when a lighter-weight C-based alternative is available
 that takes full advantage of Apache's internal I/O handling inside the
 server already?

 So it's a bit of a learning curve.  So what?  You learned mod_perl's ins
 and outs already - libapreq is significantly easier to grasp IMHO.
 
 I agree it's much more powerful, and it is my power tool of choice :) In
 the original context of the question though, the poster was asking how
 to grab the the query string arguments.  In that situation where someone
 is not familiar with the basic operations of request parameter handling,
 I would recommend CGI because it's a lot easier to get the desired
 result quickly, which I think is important for someone learning
 modperl.  CGI is installed on most systems, and while that extra speed
 from libapreq is nice, I've seen the libapreq install trip up beginners
 (and a few experts from time to time, including myself!).

When libapreq2 was being developed, we realized that the learning curve
for the new interfaces (APR::Request::xxx) might be tricky for some
people to get the hang of (especially if they were used to the old
libapreq1 way of doing things), so Apache2::Request was added to make
things simple and as backwards-compatible as possible.  How would you
envision it being simpler than it currently is?

Instead of doing:
my $q=CGI-new;
my $param=$q-param('foo');

One needs to do:
my $req=Apache2::Request-new($r);
my $param=$req-param('foo');

I still fail to see the difficulty...  If someone can think of an even
simpler way, I'd be all for getting it included in future libapreq
releases...

  Issac


Re: How to extract a parameter

2007-01-15 Thread Issac Goldstand
Issac Goldstand wrote:
 Jonathan Vanasco wrote:
 On Jan 14, 2007, at 6:45 PM, Fred Moyer wrote:
 But it's really much easier to use CGI :)
 There's also libapreq
 
 OK - so out of the corner of my eye, I saw the link again as the
 previous mail was being copied to my sent-mail and noticed that it said
 RequestRec::args and not Request::args.  So I put my foot in my mouth :-)
 
 As Jonathan correctly said, there's also libapreq:
 
 http://httpd.apache.org/apreq/docs/libapreq2/modules.html
 

Boy, I'm on a roll this morning.  The previous email ended up going to
Jonathan only and not to the entire list.

The important part of it [other than me incorrectly stating that
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_args_ was
a link to libapreq :-)] was:

I personally never liked using CGI with mod_perl; if I'm going through
the trouble of writing optimized handlers to make my application that
much faster, why use a pure-perl solution that needs to do full parsing
in perl-land, when a lighter-weight C-based alternative is available
that takes full advantage of Apache's internal I/O handling inside the
server already?

So it's a bit of a learning curve.  So what?  You learned mod_perl's ins
and outs already - libapreq is significantly easier to grasp IMHO.

Just my (biased) $0.02,
  Issac


Re: How to extract a parameter

2007-01-14 Thread Issac Goldstand
Jonathan Vanasco wrote:
 On Jan 14, 2007, at 6:45 PM, Fred Moyer wrote:
 But it's really much easier to use CGI :)
 
 There's also libapreq

OK - so out of the corner of my eye, I saw the link again as the
previous mail was being copied to my sent-mail and noticed that it said
RequestRec::args and not Request::args.  So I put my foot in my mouth :-)

As Jonathan correctly said, there's also libapreq:

http://httpd.apache.org/apreq/docs/libapreq2/modules.html


Re: apxs nor ap_release.h not found in libapach2-mod-perl

2006-12-21 Thread Issac Goldstand
These would be in the Apache development headers, not in the mod_perl
distribution.  Did you install a binary package of Apache or build it
yourself?  If the former, you'll need to install the corresponding
development package; if the latter, apxs should be installed to the
httpd/bin directory.

  Issac

Genesis X1 wrote:
 Hi,
 
 Im trying to get NTLM Authentication working for Apache 2xx.
 
 So that Windows Users can access  Apache Web Server with their Windows
 Domain credentials. (Single Sign On)
 
 I have installed Perl 5 and Apache HTTPD Server 2.2.3 correctly.
 
 I Downloaded the Apache2-AuthenNTLM-0.02.tar module and tried to
 compiled it.
 
 Compilation needed mod_perl and hence i downloaded
 mod_perl-2.0-current.tarand tried to run perl Makefile.PL and get the
 following error.
 
 sh-3.1$ perl Makefile.PL
 no conflicting prior mod_perl version found - good.
 * WARNING *
 
  Your Perl is configured to link against libgdbm,
  but libgdbm.so was not found.
  You could just symlink it to /usr/lib/libgdbm.so.3.0.0
 
 
 * WARNING *
 
 Next we need to know where the 'apxs' script is located. This script
 provides a lot of information about the Apache installation, and makes
 it easier to find things on your system. Normally it's located in the
 same directory as the 'httpd' executable.
 
 If you don't yet have Apache installed you can build Apache against
 the Apache source code, but you won't be able to run the test suite (a
 very important step). Therefore you may want to install Apache before
 proceeding.
 
 Please provide a full path to 'apxs' executable
 (press Enter if you don't have it installed):
 
 Please provide the location of the Apache directory:  /etc/apache2/
 [  error] Unable to open /etc/apache2//ap_release.h: No such file or
 directory
 [  error] Unable to determine server version, aborting.
 [  error] Please specify MP_APXS or MP_AP_PREFIX.
 sh-3.1$
 
 
 
 Neither apxs nor ap_release.h files are stored in my Unix Box ??
 
 Please Help me !
 


Re: apxs nor ap_release.h not found in libapach2-mod-perl

2006-12-21 Thread Issac Goldstand
Try apt-get install apache2-dev

Genesis X1 wrote:
 Yes i used apt-get install apache2 to install the HTTPD server.
 I searched my box using find files/folders utility but couldnt locate
 the file needed.
 
 GenesisX1
 
 
 On 12/21/06, Issac Goldstand [EMAIL PROTECTED] wrote:
 These would be in the Apache development headers, not in the mod_perl
 distribution.  Did you install a binary package of Apache or build it
 yourself?  If the former, you'll need to install the corresponding
 development package; if the latter, apxs should be installed to the
 httpd/bin directory.

   Issac

 Genesis X1 wrote:
  Hi,
 
  Im trying to get NTLM Authentication working for Apache 2xx.
 
  So that Windows Users can access  Apache Web Server with their Windows
  Domain credentials. (Single Sign On)
 
  I have installed Perl 5 and Apache HTTPD Server 2.2.3 correctly.
 
  I Downloaded the Apache2-AuthenNTLM-0.02.tar module and tried to
  compiled it.
 
  Compilation needed mod_perl and hence i downloaded
  mod_perl-2.0-current.tarand tried to run perl Makefile.PL and get the
  following error.
 
  sh-3.1$ perl Makefile.PL
  no conflicting prior mod_perl version found - good.
  * WARNING *
 
   Your Perl is configured to link against libgdbm,
   but libgdbm.so was not found.
   You could just symlink it to /usr/lib/libgdbm.so.3.0.0
 
 
  * WARNING *
 
  Next we need to know where the 'apxs' script is located. This script
  provides a lot of information about the Apache installation, and makes
  it easier to find things on your system. Normally it's located in the
  same directory as the 'httpd' executable.
 
  If you don't yet have Apache installed you can build Apache against
  the Apache source code, but you won't be able to run the test suite (a
  very important step). Therefore you may want to install Apache before
  proceeding.
 
  Please provide a full path to 'apxs' executable
  (press Enter if you don't have it installed):
 
  Please provide the location of the Apache directory:  /etc/apache2/
  [  error] Unable to open /etc/apache2//ap_release.h: No such file or
  directory
  [  error] Unable to determine server version, aborting.
  [  error] Please specify MP_APXS or MP_AP_PREFIX.
  sh-3.1$
 
 

 
 
  Neither apxs nor ap_release.h files are stored in my Unix Box ??
 
  Please Help me !
 

 
 


Re: [RELEASE CANDIDATE]: mod_perl-2.0.3 RC3

2006-11-24 Thread Issac Goldstand
PASS Win32 Perl-5.8.8 + Apache 2.2.3

Philip M. Gollucci wrote:
 A release candidate for mod_perl 2.0.3-rc3 is now available for testing.
 
 Please grab the candidate from
 http://people.apache.org/~pgollucci/mp2/mod_perl-2.0.3-rc3.tar.gz
 
 and report back successes or failures. When reporting failures, please see
 the bug reporting guidelines at
 
 http://perl.apache.org/bugs/
 
 so that your report can get the best attention possible.
 
 CHANGES since 2.0.3-rc2:
 --
 http://svn.apache.org/viewvc?view=revrev=473085
   CYGWIN legacy ifs removed
 
 http://svn.apache.org/viewvc?view=revrev=475903
   Fixed typo relating to Linux::Smaps
 


Re: [RELEASE CANDIDATE]: Apache-Test-1.29-RC3

2006-11-24 Thread Issac Goldstand
PASS Win32 Perl-5.8.8 + Apache 2.2.3

Philip M. Gollucci wrote:
 A release candidate for Apache-Test 1.29-rc3 is now available.
 
 http://people.apache.org/~pgollucci/at/Apache-Test-1.29-rc3.tar.gz
 
 Please take the time to exercise the candidate through all your existing
 applications that use Apache-Test and report back successes or failures.
 
 Changes Since 1.29-rc2:
 
 http://svn.apache.org/viewvc?view=revrev=473808
   Required Module::Build 0.18
   RT: http://rt.cpan.org/Ticket/Display.html?id=19513
 
 
 
 
 Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
 Consultant / http://p6m7g8.net/Resume/resume.shtml
 Senior Software Engineer - TicketMaster - http://ticketmaster.com
 1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F
 
 I never had a dream come true
 'Til the day that I found you.
 Even though I pretend that I've moved on
 You'll always be my baby.
 I never found the words to say
 You're the one I think about each day
 And I know no matter where life takes me to
 A part of me will always be...
 A part of me will always be with you.


Re: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-21 Thread Issac Goldstand
CC-ing to [EMAIL PROTECTED] in the hopes that someone (**cough**wrowe?**cough**) 
might shed some deeper insight into why things were/are done the way 
they are, and what, if anything, would be needed to be done to make 
things better.


I don't think that the problem is mod_perl, as much as the winnt MPM in 
Apache2.  The bottom line is that if anything goes wrong, you need the 
singleton child process to recycle itself, and very often in the case of 
mod_perl that can take a long time.  But the essential problem still 
exists with PHP, mod_python, even theoretically in a minimal vanilla 
httpd install.


 Issac

Foo JH wrote:
This is a disappointing piece of news. Perl itself is very useful on 
the Windows environment. If modperl cannot be reliably deployed on 
Windows, how can we expect the Windows developers (which form the 
majority of developers) to consider adopting perl/ modperl for the 
enterprise?


I hope we can find people who can testify otherwise...

Issac Goldstand wrote:
YES!  While it's acceptable for light and smallish applications, I've 
never found it to be really usable once you're serving concurrent 
connections.


 Issac

Foo JH wrote:

Hello guys,

Just want to get some feedback from people here who use MP2 on 
Windows for their production enviromment. For myself I have done MP2 
on both FreeBSD and Windows platforms, and it seems to me that the 
FreeBSD combo is more reliable. The Windows version on occasion (but 
sure to happen) will throw out an error, and Apache will restart 
automatically. Does anyone share the same experience?


Re: Windows + MP2 in a production environment

2006-11-21 Thread Issac Goldstand
It took me a while to get everything together, and I was involved in a
minor pile-up car accident (I'm fine - car needs body work) so this got
delayed more than I originally intended.  Apologies to people who were
standing by with test environments to try to work this out.

Getting to the point (quoting this from the developer who was in charge
of this issue):
--- BEGIN QUOTE ---
The crash occurs on computer with Microsoft Windows Server 2003 Standard
Edition Service Pack 1. With dual Intel XEON HyperThreading CPU 3.00 GHZ
and 3.00 GB RAM

We originally found the bug when We used Apache 2.0.2 ,Mod_perl
1.99-dev,Perl 5.8.3, and also the bug still occurred when we upgraded
the server to Apache 2.2.3,Mod_perl 2.0.3 RC2,Perl 5.8.8

The event log message is Faulting application httpd.exe version
2.2.3.0, faulting module perl58.dll version 0.0.0.0, fault address
0x0015bdb4

The configuration of the server:
PerlInterpMax 10 and more
# Creates 7 interpreter threads when Apache starts up (def 3)
PerlInterpStart 7 and up
# Leave a maximum of 7 spare threads (not used threads)
PerlInterpMaxSpare 7 and up.
Httpd.conf :
ThreadsPerChild 250
MaxRequestsPerChild 0

After compiling the perl with debug symbols and running it using the
Windbg application I got the following stack trace:
perl58!VMem::Free+0x5e
perl58!CPerlHost::FreeShared+0x2a
perl58!PerlMemSharedFree+0x1a
perl58!Perl_newCONSTUB+0x28a
perl58!S_cv_clone2+0x8ce
perl58!Perl_cv_clone+0x1a
perl58!Perl_pp_anoncode+0x46
perl58!Perl_runops_debug+0x18f
perl58!S_call_body+0x52
perl58!Perl_call_sv+0x703
perl58!S_call_list_body+0x57
perl58!Perl_call_list+0x18a
perl58!Perl_newATTRSUB+0x1306
perl58!Perl_utilize+0x4e3
perl58!Perl_yyparse+0x1543
perl58!S_doeval+0x3a8
perl58!Perl_pp_require+0x19c9
mod_perl!modperl_pp_require+0xd
perl58!Perl_runops_debug+0x18f
perl58!S_call_body+0x52

In order to avoid the problem I used the __try and __catch which are
used in Microsoft win32 applications changing  :
inline void FreeShared(void* ptr)
{
GetLockShared();
__try{
m_pVMemShared-Free(ptr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{   
}   
FreeLockShared();
};
Located in win32\perlhost.h file.
The crash occurs in VMem::free function  probably during freeing  of the
block of memory there.

--- END QUOTE ---

  Issac


Issac Goldstand wrote:
 Unfortunately, so far not yet...  We haven't been able to get it to
 reproduce on a test machine yet - the setup on the problematic machine
 is Dual hyperthreading 3.0Ghz Xeons with 3GB RAM, running Win2003 Server
 SP1.
 The closest we've got to match that setup is with a dual core Pentium-D
 3.4 Ghz machine with XP SP2, or a VMWare VM with 2 virtual processors
 (host machine is a Pentium 4-HT 2.8 Ghz machine) with 1.2GB RAM running
 win2003 SP1.
 
 I'll post the exact error messages, as well as a workaround that someone
 put together (definitely workaround and not fix - he just wraps the
 deepest crashing subroutine in a Visual C __try {} block, as I
 understand; I haven't seen it myself yet), as soon as I can.
 
  Issac
 
 Randy Kobes wrote:
 On Sun, 19 Nov 2006, Issac Goldstand wrote:

 Foo JH wrote:
 Issac Goldstand wrote:
 We were originally using 5.8.3, but reproduced the problem with both
 activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM
 repository)
 as well as our own built perl + mod_perl 2.0.3-rc2

 I wonder if modperl on apache 2.2 will resolve this issue...

 We're using 2.2.3 - Upgrading everything to the latest stable versions
 was the first thing we tried.

 Is it possible to provide a minimal script that illustrates
 the problem? There's some people on the list that have
 threads-enabled unix setups; it would be interesting to
 see if it's also a problem there.

 


JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-19 Thread Issac Goldstand
YES!  While it's acceptable for light and smallish applications, I've 
never found it to be really usable once you're serving concurrent 
connections.


On that note, I have a contract (job) offer for anyone who knows their 
way inside Perl (5.8) and mod_perl  (2) enough to help troubleshoot a 
win32-related crash.  In short, once we put heavy load on the server, we 
see a crash reported from inside libperl58.dll - my theory is that it's 
thread-related, but I don't have the time to look into it properly.  If 
anyone thinks that they are capable of identifying and fixing the 
problem, please email me.


 Issac

Foo JH wrote:

Hello guys,

Just want to get some feedback from people here who use MP2 on Windows 
for their production enviromment. For myself I have done MP2 on both 
FreeBSD and Windows platforms, and it seems to me that the FreeBSD 
combo is more reliable. The Windows version on occasion (but sure to 
happen) will throw out an error, and Apache will restart 
automatically. Does anyone share the same experience?


Re: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-19 Thread Issac Goldstand
We were originally using 5.8.3, but reproduced the problem with both
activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM repository)
as well as our own built perl + mod_perl 2.0.3-rc2

Randy Kobes wrote:
 On Sun, 19 Nov 2006, Foo JH wrote:
 
 Issac Goldstand wrote:
 YES!  While it's acceptable for light and smallish applications, I've
 never found it to be really usable once you're serving concurrent
 connections.

 On that note, I have a contract (job) offer for anyone who knows
 their way inside Perl (5.8) and mod_perl  (2) enough to help
 troubleshoot a win32-related crash.  In short, once we put heavy load
 on the server, we see a crash reported from inside libperl58.dll - my
 theory is that it's thread-related, but I don't have the time to look
 into it properly.  If anyone thinks that they are capable of
 identifying and fixing the problem, please email me.
 
 What version of perl are you using? There were some
 threads-related fixes introduced in perl-5.8.8 that
 solved some problems with earlier versions.
 


Re: Windows + MP2 in a production environment

2006-11-19 Thread Issac Goldstand
We're using 2.2.3 - Upgrading everything to the latest stable versions
was the first thing we tried.

  Issac

Foo JH wrote:
 Issac Goldstand wrote:
 We were originally using 5.8.3, but reproduced the problem with both
 activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM repository)
 as well as our own built perl + mod_perl 2.0.3-rc2
   
 I wonder if modperl on apache 2.2 will resolve this issue...


Re: [mp2] PAR in production?

2006-11-15 Thread Issac Goldstand

Cool!

But, what license does it have?

Foo JH wrote:
Are you guys referring to this tool ActiveState released for 
relocating Perl:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/ActiveState/RelocateTree.html 




Frank Wiles wrote:

On Mon, 13 Nov 2006 10:24:21 +0200
Issac Goldstand [EMAIL PROTECTED] wrote:

 

Frank Wiles wrote:
   

   I believe this is how Sophos' PureMessage installs itself.
Basically putting your own Perl binary and module paths in
   say /usr/local/myapp/bin/perl.  This is probably the best way to 
   ensure you have full control over everything about your
application.   

I actually imagine that Sophos does it exactly the same way
ActivePerl does it; until recently they owned ActiveState, and thus
had access to the ActivePerl setup scripts :-)



   hehe good point! :)  
 

FYI, it's not just @INC and binary - there are also changes needed,
for example, in Config.pm, or you won't be able to install new
modules to your new perl site...



   What I meant was build a custom Perl with say
   --prefix=/usr/local/myapp, install all of your modules with it, and
   reproduce the entire structure with your packager ( for example
   RPM ).
   Most apps that are after this sort of setup aren't interested in 
   allowing the user to install new modules, they specifically want

   to control the entire environment to avoid version bugs and
   support issues.
 -
   Frank Wiles [EMAIL PROTECTED]
   http://www.wiles.org
 -

  


Re: [mp2] PAR in production?

2006-11-15 Thread Issac Goldstand
Not Sophos.  ActivePerl.

ActivePerl costs $0.00 to download and use, but AFAIK it's not free
software, thus the question :-)

  Issac

Frank Wiles wrote:
 On Wed, 15 Nov 2006 12:34:50 +0200
 Issac Goldstand [EMAIL PROTECTED] wrote:
 
 Cool!

 But, what license does it have?
 
Sophos is a commercial product. 
 
  -
Frank Wiles [EMAIL PROTECTED]
http://www.wiles.org
  -
 
 
 Foo JH wrote:
 Are you guys referring to this tool ActiveState released for 
 relocating Perl:
 http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/ActiveState/RelocateTree.html
  



 Frank Wiles wrote:
 On Mon, 13 Nov 2006 10:24:21 +0200
 Issac Goldstand [EMAIL PROTECTED] wrote:

  
 Frank Wiles wrote:

I believe this is how Sophos' PureMessage installs itself.
 Basically putting your own Perl binary and module paths in
say /usr/local/myapp/bin/perl.  This is probably the best way
 to ensure you have full control over everything about your
 application.   
 I actually imagine that Sophos does it exactly the same way
 ActivePerl does it; until recently they owned ActiveState, and
 thus had access to the ActivePerl setup scripts :-)
 
hehe good point! :)  
  
 FYI, it's not just @INC and binary - there are also changes
 needed, for example, in Config.pm, or you won't be able to
 install new modules to your new perl site...
 
What I meant was build a custom Perl with say
--prefix=/usr/local/myapp, install all of your modules with it,
 and reproduce the entire structure with your packager ( for example
RPM ).
Most apps that are after this sort of setup aren't interested
 in allowing the user to install new modules, they specifically want
to control the entire environment to avoid version bugs and
support issues.
  -
Frank Wiles [EMAIL PROTECTED]
http://www.wiles.org
  -

   
 


Re: [mp2] PAR in production?

2006-11-13 Thread Issac Goldstand



Frank Wiles wrote:

   I believe this is how Sophos' PureMessage installs itself.  Basically
   putting your own Perl binary and module paths in
   say /usr/local/myapp/bin/perl.  This is probably the best way to 
   ensure you have full control over everything about your application. 
  
I actually imagine that Sophos does it exactly the same way ActivePerl 
does it; until recently they owned ActiveState, and thus had access to 
the ActivePerl setup scripts :-)


FYI, it's not just @INC and binary - there are also changes needed, for 
example, in Config.pm, or you won't be able to install new modules to 
your new perl site...


 Issac


Re: [RELEASE CANDIDATE] Apache-Test-1.27 RC2 + mod_perl2.03-RC2 + apreq 2.09-RC2

2006-11-09 Thread Issac Goldstand
Win32 (VS2003) - httpd/2.2.3 - ActivePerl 5.8.8.819

PASS Apache-Test
PASS mod_perl
FAIL libapreq2

libapreq passed the 2 sets of C-based tests and failed the 3rd set
(quite miserably), so it may just be a bug in Apache-Test.  I'll look
into it and send a proper bug report with details to apreq-dev shortly.





Re: Win32 ppm packages

2006-10-31 Thread Issac Goldstand
I tend to use 2.0 where I need subversion or PHP (which ship with 2.0 
modules only) and 2.2 everywhere else...  I personally find the naming a 
bit tricky (2-2.2).  and would frankly rather see the modules called 
mod_perl20 (or mod_perl2.0) and mod_perl/libapreq22/2.2; I'd rather type 
the couple of extra chars and always know what I'm installing without 
needing to look up the most current naming scheme.


 Issac

Randy Kobes wrote:

I'd like to get a sense from Win32 ppm users of mod_perl
and/or libapreq2 about the following. Right now in our
   http://theoryx5.uwinnipeg.ca/ppms/
ppm repository, there's ppm packages for mod_perl
and libapreq2. The ones compatible with Apache/2.0 are
called mod_perl and libapreq2, respectively, while
those for Apache/2.2 are mod_perl-2.2 and libapreq2-2.2,
respectively. What I'm wondering is, if Apache/2.2
is by now mostly used, should I switch the names:
mod_perl and libapreq2 for Apache/2.2, and
mod_perl-2.0 and libapreq-2.0 for Apache/2.0?
Thoughts?



Re: X-Forwarded-For

2006-08-04 Thread Issac Goldstand
IIRC, it's not needed for mp2, since it's been implemented directly in
mod_proxy

  Issac

Jonathan Vanasco wrote:
 my mp2 needs to get the ip of the remote address
 
 on some installations, mp2 is on port 80
 
 on other installations, mp2 is on 80xx and the ip is in X-Forwarded-For
 
 i'd like to ensure that i pull the ip off the right place, under the
 right conditions.  all of my get_ip() calls  happen in a shared library
 though, so I need to figure out a way to handle this  under those
 constraints, and not deal with spoofs.
 
 first i found this module
 Apache::ForwardedFor
 
 http://search.cpan.org/~jlawrenc/Apache-ForwardedFor-0.5/lib/Apache/ForwardedFor.pm
 
 
 but its
 Apache1
 not porting nicely
 designed oddly- doesn't seem to forw
 
 short of rewriting it , which i might have to do, maybe someone has an
 apach2 compatible solution already?
 
 i'm thinking that the easiest way to do this would be:
 
 httpd.conf-
 run a preliminary handler that strips all x-forwarded-for headers
 unless:
 we're running on port 80
 we're running on port 80 but there's some internal lan header
 marking that says its coming off a load balancer i control
 
 although i could just do a conditional rewrite of headers in a new
 forwarded module


Re: Authentication

2006-08-04 Thread Issac Goldstand
Not necessarily so.  Like Jonathan mentioned, many huge ISPs (like AOL,
for example, IIRC) route requests through load balanced transparent
proxies.  This can cause the same person to appear to browse from a
number of different IPs - changing perhaps even more often than Jonathan
reported.

  Issac

Radoslaw Zielinski wrote:
 Jonathan Vanasco [EMAIL PROTECTED] [03-08-2006 21:24]:
 On Aug 3, 2006, at 12:31 PM, Radoslaw Zielinski wrote:
 Valid: exists, hasn't expired, client's IP matches (ID might have been
 stolen somehow), etc.
 I find IP matching to be utterly useless.  IPs for dialup/broadband  
 users change like crazy as their ISPs funnel stuff into/out of proxies.
 
 my own ip can change every 3 minutes at times.  its annoying.
 
 Uh, that's extreme.  But I'd call it a broken network, not a problem
 with the idea of matching IP.  With something like this, any service
 using long-lasting connections will have problems.
 


Re: Cannot load mod_perl.so

2006-05-16 Thread Issac Goldstand
You may need to add (to httpd.conf)
LoadFile c:/path/to/perl/bin/perl58.dll

before the LoadModule line.

  Issac

Tracy E Schreiber wrote:
 Hi,

 I hope this isn't too much of a newbie question...

 I am trying to upgrade from Apache 2.0.55 using mod_perl V1.0 to Apache 
 2.2.2 using mod_perl V2.0. This installation is on a Windows XP Pro SP2 
 machine. I get this error:

 httpd.exe: Syntax error on line 31 of D:/Apache2.2/conf/httpd.conf: Cannot 
 load
 D:/Apache2.2/modules/mod_perl.so into server: The specified module could not 
 be
 found.

 The module is in the directory. Am I doing something wrong or is the module 
 not compatible with Apache 2.2.2?

 Thank You,
 Tracy


   



Re: mod_proxy_add_forward

2006-05-05 Thread Issac Goldstand
In Apache 2, it's built in to mod_proxy.  In Apache 1 (as of a couple of
years ago, at least) it wasn't - that's why mod_proxy_add_forward was
originally written :)

 Issac

Michael Schout wrote:
 David Romero wrote:
 Hi
 I need the client ip on a backend server.
 
 Plain old mod_proxy will pass along the ip in an X-Forwarded-For header.
 
 Regards,
 Michael Schout


Re: Progress bar for file uploads

2006-04-28 Thread Issac Goldstand
No.  Actually, the main reason it never saw a 1.0 version is because of
lack of an intelligent method to configure multiple forms.  Patches are
welcome, though :-)

  Issac

Barry Hoggard wrote:
 On Apr 27, 2006, at 10:09 AM, Perrin Harkins wrote:
 Martin Moss wrote:
 Does anybody know of a progress bar type class for
 file uploads? (apache 1)

 Apache::UploadMeter.
 
 
 The docs for this seems to suggest setting it up for a single form. 
 Does it work OK with run-time configuration of those variables?  I have
 a number of forms on my web site with uploads.
 
 
 
 
 -- 
 Barry Hoggard
 www.ArtCat.com -self-managed websites for artists/galleries
 www.ArtCal.net - gallery/art guide
 www.bloggy.com - weblog
 AIM/Yahoo: hoggardb
 


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

2006-04-26 Thread Issac Goldstand
I provide contracting services for a company who has a web-based (LAMP)
product.  Around a year ago, they got a big client who wanted the
webserver to run on a win32 platform.  They were using mod_perl for
registry services on the old setup, and I ported them to a windows
environment with mod_perl included.  They still only use it for registry
scripts, but they have 100 production servers already using it and hop[e
to have another 1000 in the coming year.

The only issue we encountered was an issue with mod_ssl that kept
killing the single child process (it would ressurect itself, but it
would take 30 seconds to do so which was too long), which we worked
around by ditching mod_ssl and setting up stunnel instead.

  Issac

Foo Ji-Haw wrote:
 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


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

2006-04-26 Thread Issac Goldstand
IIRC, PerlEx was discontinued a few years ago, I think shortly after the
Sophos acquisition.  I've recently seen it quietly reappear in standard
ActivePerl distributions, but not sure where (if anywhere) the great
folks at ActiveState are going with it...

  Issac

Philip M. Gollucci wrote:
 Foo Ji-Haw wrote:
 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

 Back in 2000, I _sadly_ used to deploy ActiveState Perl 6xx, PerlEx
 2.1 with IIS 5.0.  the code didn't get that advanced.  My biggest
 gripe was the ppm repositories were far behind that of CPAN, or
 modules were only available in ActiveState Perl 8xx.

 That particular behavior (restart_count) trips a lot of people up even
 on BSD / Linux based platforms.

 Its been a while and Phillippe will probably correct me here, but I
 remember there be hard memory limit of 8GB with PerlEx.  We had filed
 a bug report, but I don't think it was high enough priority for them
 to look at at the time.

 I wasn't really a big fan of setting things like Interpreter threads,
 tracing, and etc... in the Windows registry either.

 HTH





Re: [OT] Database transaction across multiple web requests

2006-04-04 Thread Issac Goldstand


Greg Sabino Mullane wrote:
 
 Granted, I use a few MySQL features for this; I'm not sure if LIMIT
 exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS
 directive (which will return the total rows in a select statement
 regardless of the LIMIT directives) doesn't...
 
 Postgres has LIMIT and OFFSET. To determine the number of rows returned,
 you can simply look at the return value of execute, or you can call
 $sth-rows:
 
 my $numrows = $sth-execute(1,2,42);
 
 my $numrows2 = $sth-rows;

But will this return the total rows or just the rows that match the
LIMIT ... OFFSET ... directive?

In MySQL, at least, it will return the latter.  The SQL_CALC_FOUND_ROWS
directive is to calculate the former.

  Issac


Re: Database transaction across multiple web requests

2006-04-03 Thread Issac Goldstand
If anything, it really doesn't make sense to cache something in the
query cache with limits intact; LIMIT is just a modifier which trims the
result set on the server side.  Since LIMIT doesn't actually affect the
result set, per se, it doesn't make sense for the query cache to pay
attention to it any more than it would pay attention to HIGH_PRIORITY,
BIG_RESULT or any other modifier.

I can think of a few scenarios where I also saw a performance boost with
the query cache on limits, BUT IIRC, they're all queries that I've used
SQL_CALC_FOUND_ROWS (which causes the query to run to the end, instead
of aborting when LIMIT is matched).  My thought was that the queries in
question were being cached since the results ran to the end, and the
LIMIT modifier on subsequent queries just took the result set from the
query cache and returned the limits from there.

Recall, also, that when running the query the first time, it'll start
slurping tables indexes into the key buffer, which might make subsequent
queries to the same underlying tables a bit faster in some (mostly
low-volume or development) environments.

By the way, apparently MySQL also supports the PostgreSQL syntax of
LIMIT ... OFFSET ...

  Issac

Jonathan Field wrote:
 From here you can watch in real time for Qcache_hits.  Questions is the 
 total number of queries.  Indeed, LIMIT queries are cached, but just the
 part that was returned.
 
 If the query is the slightest bit different when run again, or if any of
 the underlying tables have been written to, the query cache will be
 ignored.  But the data itself will most likely be in memory the next
 time around so it will be faster than the first run anyways.
 
 Just some food for thought.
 
 Cheers,
 Jonathan Field
 
 On Sun, 2 Apr 2006, Perrin Harkins wrote:
 
 On Mon, 2006-04-03 at 10:28 +0800, Foo Ji-Haw wrote:
 Perrin Harkins wrote:
 Jeff wrote:
 Your application simply uses approach (b) and MySQL does the rest
 automatically. So if you
 Have you tried this?  I was under the impression that MySQL would just
 stop when it finds enough row to satisfy LIMIT, so it wouldn't cache
 the whole result set.
 I have, and I can verify that MySQL does some kind of internal
 'caching', so that the next limit call is very fast.

 How do you know it isn't just the operating system caching the disk
 fetches?  The docs certainly make it sound like a query cached with
 LIMIT will not be useful when different LIMIT values are applied.

 - Perrin



Re: [OT] Re: Database transaction across multiple web requests

2006-04-03 Thread Issac Goldstand
Right - that was the line I was trying to find earlier.  So much for my
theory about ignoring the LIMITs :-(

All I can think of to explain the speedup that people (including myself)
tend to see anyway is the indexes being cached in the key_buffer the
second+ times around.

  Issac

Jeff wrote:
  Original Message  
 From: Perrin Harkins [EMAIL PROTECTED]
 Subject: Re:Database transaction across multiple web requests
 Date: Mon Apr 03 2006 03:55:54
 
 How do you know it isn't just the operating system caching the disk
 fetches?  The docs certainly make it sound like a query cached with
 LIMIT will not be useful when different LIMIT values are applied.

 
 Having looked at the docs, at least for the v4 server, I have to agree
 with Perrin. The docs don't specifically mention LIMIT, but they do say
 that the SQL has to match, byte for byte. They give an example:
   SELECT * from mytable
 and
   Select * from mytable
 and say that the second statement will NOT use the first statements
 cache because it does not match byte-for-byte (case is different). At a
 guess, they probably just MD5 the SQL and add in some basic checks (for
 MD5 collision) to identify the result set in the cache. Here is the URL
 
   http://dev.mysql.com/doc/refman/4.1/en/query-cache-how.html
 
 Saying that though, we have a highly interactive webapp, with about 100
 active users per day from a user base of just under 1000. In the last 60
 days, the qcache_hits shows 67 million hits. In our case, the underlying
 data changes reasonably frequently. I believe that we would notice a
 difference if the qcache was turned off! On a site with more static
 underlying data, you would expect even better results.
 
 As to the OS file cache - that works well too! If MySQL can't satisfy
 the query from cache, it will query files that the OS has cached in
 memory, meaning that even the fallback is better than disk access
 speeds. We run about 20G of database per db server, and there is usually
 about 2G of file cache memory in use.
 
 For us, MySQL performance is blistering! Having worked for years with
 Sybase, on big expensive hardware, my subjective feeling is that we get
 about 10x the update and about 5x the read access on hardware that costs
 1/10th the price, with 1/10th of the db tuning required. My Oracle
 experience is less extensive, but I generally found Oracle was not much
 faster than Sybase, but did have a bigger db admin overhead, and for
 some reason seemed to always end up with bloated apps.
 
 Regards
 Jeff


Re: pnotes MP1-MP2

2006-04-03 Thread Issac Goldstand
It should work fine.  I wrote the same thing today (albeit without
method calls)...

# Trans handler
sub lookup_handler {
  my $r=shift;
  my $dbh=GTS::Util::connectdb(); # essentially a wrapper for DBI-connect
  ...
  $r-pnotes(dbh=$dbh);
  return Apache2::Const::DECLINED;
}

# Response handler
sub fullresponse_handler {
  my $r=shift;
  # Get direction from DB
  my $dbh=$r-pnotes('dbh');
  ...
}

  Issac

John Russell wrote:
 Thank you. Tried it, unfortunately no difference.
 I'll try Geoffrey Young's test.
 


Re: Database transaction across multiple web requests

2006-04-02 Thread Issac Goldstand


Frank Wiles wrote:
 On Fri, 31 Mar 2006 14:47:37 +0200
 Issac Goldstand [EMAIL PROTECTED] wrote:
 
 Granted, I use a few MySQL features for this; I'm not sure if LIMIT
 exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS
 directive (which will return the total rows in a select statement
 regardless of the LIMIT directives) doesn't...
 
   PostgreSQL has LIMIT... it's a SQL standard.  And I don't really see
   why you would need SQL_CALC_FOUND_ROWS unless you where going to
   show the total number of pages.  For simple Next/Previous paging
   you just keep going until you fall off the end. 
 
   If you need to get a count you can just do a count() on a particular
   column without the LIMIT and get a total. 
 

Not the total number of pages per se, but numbered result pages.  And if
there are, say, left joins (or other operations which prevent being able
to do count() on a nice clean index) involved, it's usually cheaper to
do CALC_FOUND_ROWS on the one operation, rather than having to run the
complex filtering operation again in a second SQL statement (for COUNT())

  Issac


Re: Database transaction across multiple web requests

2006-03-31 Thread Issac Goldstand
Hi there,
  I also tend to go with this variant of B.  I keep $start_from and
$max_results in the session (or the query string).  This gives me the
options of allowing flexible number of results per page, flexible
breadcrumbs for navigating the search results, etc.  If it's critical
that it's a single table, then the full result set can be slurped into
another temporary table (you'd need to implement a gc routine to clean
those tables up) and then play with that table.

Granted, I use a few MySQL features for this; I'm not sure if LIMIT
exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS
directive (which will return the total rows in a select statement
regardless of the LIMIT directives) doesn't...

  Issac

 
 add b) That sounds the best option at least this is the one I chose the
last time you can do a LIMIT $start, $end (at least in MySQL). A
potential problem in this situation is that the datasource may
have been changed in the meantime ;-)


Re: Controlling subversion access

2006-03-26 Thread Issac Goldstand
PerlAuthenHandler requires that you have at least one require directive
and an AuthType directive in place, else it won't be called.

See
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAuthenHandler

(paragraph beginning with It's not enough to enable this handler for
the authentication to work.)

  Issac

Dennis Sinelnikov wrote:
 Cool, thanks Torsten!
 
 I ended up using PerlAccessHandler. 
 
 I ran into problems using PerlAuthenHandler, maybe because I'm using a
 client certificate to authenticate the user (SSLCACertificateFile,
 SSLVerifyClient directives).  Thoughts?
 
 -Dennis
 
 Log errors when trying to use PerlAuthenHandler:
 [Sun Mar 26 18:07:41 2006] [error] [client 69.140.49.249] Could not fetch
 resource information.  [301, #0]
 [Sun Mar 26 18:07:41 2006] [error] [client 69.140.49.249] (2)No such file or
 directory: Requests for a collection must have a trailing slash on the URI.
 [301, #0]
  
 
 -Original Message-
 From: Torsten Foertsch [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, March 26, 2006 3:02 PM
 To: modperl@perl.apache.org
 Subject: Re: Controlling subversion access
 
 On Sunday 26 March 2006 21:37, Dennis Sinelnikov wrote:
 Right, read the doc over 20 times already :)
 It could be my environment or the client cert I'm using.
 I did try different environment configurations (i.e. older openssl
 versions). I got tired of looking through apache's c code and
 openssl code, to see if I could pinpoint where the problem is.
 In any case, it wasn't getting set while I know UID is there
 because I see it when I log the full DN.

 So that's why I decided to go mod_perl route, which I like b/c
 I have more control and flexibility, plus the best part --
 I'm learning mod_perl in the meantime :)
 
 Well, if you want to do it in Perl you need to write a PerlAuthenHandler to 
 set $r-user. To access mod_ssl variables at this stage you need 
 Apache2::ModSSL or Apache::SSLLookup.
 
 Torsten


Re: Concurrency with mod_perl 2.01 on Windows

2006-03-07 Thread Issac Goldstand
Hey Rod,

You're only supposed to get 2 processes on win32.  The win32 mpm
supports only one master process and one child processes (which causes
all sorts of issues and delays when the child process segfaults :-( ).
The child process loads by default with 250 worker threads which are the
instances you seem to be referring to.  By default mod_perl loads 1
perl interpreter into the parent process and then clones it 3 times
(tunable - see
http://perl.apache.org/docs/2.0/user/config/config.html#Threads_Mode_Specific_Directives)
 into the child process.  The clones are then made available to the
worker threads as explained at
http://perl.apache.org/docs/2.0/user/intro/overview.html#Threads_Support
(someone please correct me if that's wrong - my mp internals knowledge
is still somewhat limited)

So you'll always see 2 processes on win32 in the task manager
processlist though you can also check the thread counts to see the
workers).  Hope that helps somewhat.

 Issac

Rod Morris wrote:
 Hi all,
 
 I'm porting some old perl code to a new installation of Apache/2.0.54
 (Win32) mod_perl/2.0.1 on Windows 2003 Server. In testing some file
 locking code, I noticed that response seemed very slow when I dumped in
 multiple jobs via multiple browsers to the server. I added a timer and
 saw the scripts waiting for one to finish before the next started as if
 they were queued waiting for the server.
 
 I've got another server running freeBSD and it's set up to run mutilple
 instance of Apache which seems to deal with this. But on Windows, I
 haven't added anything for this and it comes up by default with 2
 instances of Apache.
 
 It's my impression that threading should be used to deal with mutilple
 requests for one script, but that's not what I'm seeing. I'm seeing one
 script wait and then start when the last one finishes. MY script just
 gets the time, sleeps and then gets the time again.
 
 Am I missing a configuration option or do I need a different version of
 perl? I installed for the standard combined Apache/mod_perl distribution.
 
 Thanks,
 Rod Morris
 
 


Re: $r-print doesn't work in Apache2/MP2/Libapreq2?

2005-12-21 Thread Issac Goldstand
That's because the $r you get from shift isn't interchangable with the
$r you get from Apache2::Request (which I think is deprecated anyway).

Try doing

sub handler {
 my $r = shift;
 my $q = Apache2::Request-new($r);
 my %ins = processInput($q);
 ...
 $r-print($html);
 return OK;
}

Harry Zhu wrote:
 
 sub handler {
  my $r = Apache2::Request-new(shift);
  my %ins = processInput($r);
  ...
  $r-print($html);
  return OK;
 }
 
 Can't locate auto/Apache2/Request/print.al in @INC (@INC contains:
 /www/modperl /usr/local/lib/perl5/5.8.7/i686-linux
 /usr/local/lib/perl5/5.8.7
 /usr/local/lib/perl5/site_perl/5.8.7/i686-linux
 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl .
 /usr/local/apache2) at /www/modperl/Sys/Handler.pm line 81
 
 if change $r-print to print, it works fine. A quick browsing
 through the MP2 documents for the example handler, some using print
 while others using $r-print (without Apache2::Request), does $r-print
 under Apache2::Request?
 
 Harry Zhu
 
 
 
 Apache/2.2.0 (Unix) mod_ssl/2.2.0 OpenSSL/0.9.7a DAV/2
 mod_apreq2-20050712/2.1.3-dev mod_perl/2.0.2 Perl/v5.8.7
 and
 perl_module (shared)
 apreq_module (shared)
 
 
 perl -V
 Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
osname=linux, osvers=2.6.9-5.el, archname=i686-linux
uname='linux deskweb1.glworkgroup 2.6.9-5.el #1 wed jan 5 19:22:18
 est 2005 i686 i686 i386 gnulinux '
config_args='-des -Uusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
 usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include
 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -I/usr/local/include
 -I/usr/include/gdbm'
ccversion='', gccversion='3.4.3 20041212 (Red Hat 3.4.3-9.EL4)',
 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, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
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 Oct 20 2005 14:29:14
  @INC:
/usr/local/lib/perl5/5.8.7/i686-linux
/usr/local/lib/perl5/5.8.7
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl


Re: Is $ENV{HTTP_X_FORWARDED_HOST} reliable

2005-12-18 Thread Issac Goldstand
Hold on a second.
That's still not going to be a good spoof because you also would check
REMOTE_CLIENT as usual, and expect to always see your front-end's IP
there, so Randal's example isn't completely accurate, since you'll see
the real client's IP there and thus know not to trust the
X-Forwarded-For header.  What you really want to check is what the
front-end does if there's already an X-Forwarded-For header.  If it
overwrites it, you should be fine.

  Issac

Randal L. Schwartz wrote:
 Boysenberry == Boysenberry Payne [EMAIL PROTECTED] writes:
 
 Boysenberry  I'm using a two server system.  Front end Apache 1.33/php4
 Boysenberry uses mod_proxy
 Boysenberry and mod_rewrite to proxy to the back end Apache2/MP2 system.
 
 Boysenberry  I was wondering if $ENV{HTTP_X_FORWARDED_HOST} is a reliable way
 Boysenberry to determine the domain of the request; or is it easily spoofed?
 
 telnet your.server.example.com 80
 GET /some/url HTTP/1.0
 X-forwarded-for: some-other-host
 CR
 CR
 
 Yeah, that's tough to spoof. :)
 


Re: HTML::Parser not mod_perl safe?

2005-09-26 Thread Issac Goldstand
Not sure if this is what people are running into, but if you use
variables, even lexicals scoped on the package level, in a subtype of
HTML::Parser, they won't get reset if you call new() on your class
unless you overload the default new() or otherwise reset them.

For example (untested, but this is approximately what I recall doing on
my own)

package Foo::Parser;
our @ISA=qw(HTML::Parser);
my $foo;
my $bar;

sub text {
  ...
  $foo=1;
  $bar=2;
}

package MyMain;

my $p=Foo::Parser-new;
# $foo and $bar are empty
...
$p-parse;
...
# $foo and bar are now set
...
my $q=Foo::Parser-new;
# $foo and $bar are still set

I run into this a lot even outside of mod_perl if using the same parser
twice...  It might also apply to the blessed hashref too, I don't
recall.  In any case, I usually just add a sub reset() to my
HTML::Parser subclasses which resets all instance data and call that
every time I construct a parser before calling parse().

Again, not sure if this is what people have been running into, but
thought it might be worth mentioning.  Best of luck, people.

  Issac

Mike Henderson wrote:

I think it's pretty safe to say there is definitely some issues with
HTML::Parser and mod_perl, at least when subclassing it.
 I managed to kludge around the problem by not doing that -- ie not doing:

---
package PackageName;

use HTML::Parser;

@PackageName::ISA = qw(HTML::Parser);
---

I ended up using a somewhat different approach, something like:
 ---

package PackageName;

use HTML::Parser;

sub new {
my $SELF_PackageName = bless {}, shift;
$SELF_PackageName-{parser} = HTML::Parser-new( api_version = 3,
start_h = [\start, self, tagname, attr, attrseq, text],
end_h = [\end, self, tagname, text ],
text_h = [\text, self, text, is_cdata]
);
return $SELF_PackageName;
}

sub parse_file { shift-{parser}-parse_file(@_); }

sub start { ... }
sub end { ... }
sub text { ... }
---
 It got a bit weird after that, as the HTML::Parser callbacks pass the
instance of the actual HTML::Parser object back to the PackageName routines,
and I actually end up storing all of
my data in the HTML::Parser namespace ... but it works! :) ... and this is
why we love perl.
 Thanks guys.
 On 9/22/05, Barry Hoggard [EMAIL PROTECTED] wrote:
  

On Sep 22, 2005, at 2:30 PM, Mike Henderson wrote:



Hello, just a quick question...

Has anyone out there successfully deployed HTML::Parser in an apache
1.3.x / mod_perl / HTML::Mason environment (dynamically parsing pages)
?

I realize that the module itself is kind of crunky, and additionally
an XS module, so, i'm left wondering.

Basically, what i'm seeing is everything working as you'd expect on
the first load of the page which creates and uses an HTML::Parser
object, but, on any subsequent loads from that same apache child,
things are partially broken -- specifically, during parsing, callbacks
to text() don't seem to be happening, but callbacks to start() and
end() seem to work fine.

I'm wondering if there's any way around this -- that is, any way to
completely destroy any previous data that HTML::Parser is letting
linger that's causing a problem, and reloading the module. Not sure
about the feasiblity of this due it being XS.
  

I have seen odd behavior using Netscape::Bookmarks (which uses
HTML::Parse to parse the file) under mod_perl 1.3.x and Mason. I
thought it was my code maybe, but what you are saying reminds me that
we got garbage back sometimes from a parse.


Barry Hoggard






  


-- 

  Yitzchak Goldstand
  Mirimar Networks
  www.mirimar.net



Re: [MP2] How to turn off caching?

2005-05-31 Thread Issac Goldstand
As more of a hack than a necessarily good practice, I've found that
sending a newline (in addition to $|=1) sometimes helps.  I think the
problem here is more that the browser doesn't necessarily render content
every single time some data comes in over the socket, but maybe waits
for logical looking breakpoints to render.   Someone who knows browsers
better will probably correct me, but that's what I've found.

Newlines are good because in general (unless you're in a NOBR block,
CODE block, etc ) the browser won't display it, but it seems to trigger
the browser to do something.

  Issac

Foo Ji-Haw wrote:

 Hello Rodger,

 Thanks for the advice. I'm concerned that this sounds like a lot of
 search-and-replace for my application. I wonder if there is a cleaner
 method that simply toggles off buffering?

 Anyone has any ideas on this?

 Rodger Castle wrote:

 If I am not mistaken, modperl tends to cache all output until the
 script is completed, then it sends out the page. If I want to (for
 example) print a period (.) back to the browser every second, what
 do I need to do? I tried $| but it does not work.
   


 I fought with this for a while, too. You can use the 'bucket brigade'
 technique. I'm a bit green, so someone with more experience could
 expound more.  Here's a snippet:

 sub send_response_body
 {
my ( $r, $data ) = @_;
   my $bb = APR::Brigade-new ( $r-pool,
  $r-connection-bucket_alloc );
my $b = APR::Bucket-new ( $data );
$bb-insert_tail ($b);
$r-output_filters-fflush ( $bb );
$bb-destroy;
 }

 Hope this helps.

 Rodger

  



Re: Refresh referring page

2005-05-04 Thread Issac Goldstand
Whoa there.  Using your example 30 files @ 50MB each, it's going to be
very expensive to upload them all multiple times (which is what happens
if you keep submitting the form)...  As for shared memory, use
Cache::Cache and look at it as a black box - it's quite simple, and a
lot smarter IMHO than uploading files each time...

  Issac

Dermot Paikkos wrote:
 Hi Ron,
 
 Yes I think I will do something like that. Instead of refreshing the 
 page I am going to resubmit the form until all the files have been 
 processed. A counter and some javascript to submit the form on each 
 page load should do it. 
 
 Perhaps not a graceful solution but for me a quicker and simpler 
 solution than having to get to grips with shared memory. 
 Thanx.
 Dp.
 
 
 On 4 May 2005 at 10:55, Ron Savage wrote:
 
Hi Dermot

Why can't you just use JavaScript::RPC and send a msg to the server
every 10 secs asking for a status update on the conversion activity?
-- Ron Savage [EMAIL PROTECTED] http://savage.net.au/index.html



 
 
 


Re: Refresh referring page

2005-05-03 Thread Issac Goldstand
Is there any particular reason why you must split it into 4 pages?  Why
can't you do something like:

local $|=1;
$r-headers_out;
print $tt_header;
foreach my $f (@files) {
... process file ...
print $tt_file_info($f);
}
print $tt_footer;

The idea being do everything in 1 single page.  Split the template into
a header, a footer and information for each processed image, and just
loop the per-picture content instead of looping an entire page.
The only other way I can think of to do this would be to open a second
window which calls a second handler which can share the information of
the first response handler, via shared memory, or a shared cache, or
whatever (or to move the work into a cleanup handler and use the
original window with a second handler who can share information with the
cleanup stuff - but I don't know if you can delay reading POST
information beyond the response handler)

  Issac

Dermot Paikkos wrote:

Hi,

MP2 RC5, Template,  Image::Magick

I hope this is not off topic, apologises if it is.

I have a perl script written as a handler. It scans a dir for image 
files and offers the user a chance to convert them from tiff to jpeg. 
As there can be lots of files of some size, it can take some time for 
the process to return.

What I wanted was to loop through the files and refresh the page as 
each file was processed. So I had something like;


$r = shift if $ENV{MOD_PERL};
my $tt = Template-new...

foreach my $f (@files) {
   my @files_processed;
   ...snip
   push(@files_processed,$f);

   my $vars = {
   files = [EMAIL PROTECTED],
   };
   $r-content_type('text/html');
   $r-headers_out;
   $tt-process($tt_file,$vars)
 || die $tt-error;

} # End of foreach

# $r-headers_out;

I thought this would re-send the $vars and headers_out until the list 
was exhausted but in practise what I get was the page repeated for 
each file. EG: if there are 4 files I get 4 html/html and a messy 
looking page.

I am not sure what I am doing wrong. If I move the headers_out 
outside the foreach loop I get to the array contents but I still get 
the (size of @files_processed) x html tags rather than one nice 
page and I still have to wait for the whole process to complete.

I imagine I am going to have to take another approach but can't thing 
of one. Does anyone now how to refresh a referring page or loop in 
the may I described?

Thanx in advance.
Dp.
 


   
  



Re: Refresh referring page

2005-05-03 Thread Issac Goldstand


Dermot Paikkos wrote:
 On 3 May 2005 at 17:11, Issac Goldstand wrote:
 
 
Is there any particular reason why you must split it into 4 pages?
 
 3 reasons; I want appearance to be as if the page is refreshing on 
 it's own,  I thought a large batch of say 30 x 50MB tiffs would cause 
 the browser to timeout or give the user the impression the process 
 was 'dead', it was a simple way to pass lists (the original list of 
 files and those processed and the results) to the page. 
 
 
Why can't you do something like:

local $|=1;
$r-headers_out;
print $tt_header;
foreach my $f (@files) {
... process file ...
print $tt_file_info($f);
}
print $tt_footer;

The idea being do everything in 1 single page.  Split the template
into a header, a footer and information for each processed image, and
just loop the per-picture content instead of looping an entire page.
 
 
 This looks like it might work if I throw away Template::Toolkit. I 
 don't think it can be configured to just output a header, loop and 
 output a footer but I could be wrong. It might be worth a try if I 
 could reproduce the template I have with some other templating system 
 - or forget templating altogether for this handler.
 
 
The only other way I can think of to do this would be to open a second
window which calls a second handler which can share the information of
the first response handler, via shared memory, or a shared cache, or
whatever (or to move the work into a cleanup handler and use the
original window with a second handler who can share information with
the cleanup stuff - but I don't know if you can delay reading POST
information beyond the response handler)
 
 
 This looks complicated. I was hoping for something in the HTTP 
 headers that I could use that might ask for a new page if the 
 existing one was a  older than 30secs.

There is.  Use a refresh header.
$r-header_out('Refresh'='30;url=http://my.site.com/loopscript');

The problem is that your handler is supposed to generate 1 page, and it
won't be done until you finish processing all that info.

  Issac

 
 I might have a look at the method above. 
 
 
  Issac
 
 Thanx.
 
 
 
Dermot Paikkos wrote:


Hi,

MP2 RC5, Template,  Image::Magick

I hope this is not off topic, apologises if it is.

I have a perl script written as a handler. It scans a dir for image
files and offers the user a chance to convert them from tiff to jpeg.
As there can be lots of files of some size, it can take some time
for the process to return.

What I wanted was to loop through the files and refresh the page as
each file was processed. So I had something like;


$r = shift if $ENV{MOD_PERL};
my $tt = Template-new...

foreach my $f (@files) {
 my @files_processed;
 ...snip
 push(@files_processed,$f);

 my $vars = {
 files = [EMAIL PROTECTED],
 };
 $r-content_type('text/html');
 $r-headers_out;
 $tt-process($tt_file,$vars)
   || die $tt-error;

} # End of foreach

# $r-headers_out;

I thought this would re-send the $vars and headers_out until the list
was exhausted but in practise what I get was the page repeated for
each file. EG: if there are 4 files I get 4 html/html and a messy
looking page.

I am not sure what I am doing wrong. If I move the headers_out 
outside the foreach loop I get to the array contents but I still get
the (size of @files_processed) x html tags rather than one nice
page and I still have to wait for the whole process to complete.

I imagine I am going to have to take another approach but can't thing
of one. Does anyone now how to refresh a referring page or loop in
the may I described?

Thanx in advance.
Dp.



 
 


 
 
 ~~
 Dermot Paikkos * [EMAIL PROTECTED]
 Network Administrator @ Science Photo Library
 Phone: 0207 432 1100 * Fax: 0207 286 8668


Re: [OT] viewing HTTP headers in IE/Firefox

2005-03-16 Thread Issac Goldstand
There's also a great tool by Microsoft[1] (now there's an oxymoron for
you :-)) called Fiddler[2] which is basically a proxy server that sits
on your local machine and lets you inspect all the HTTP traffic (as well
as build your own requests).  The only major drawback is that since it's
a separate proxy and not a browser plug-in, it can't spy on HTTPS.

  Issac

[1] Well, technically it's made by a Microsoft employee, but apparently
with their blessing
[2] http://www.fiddlertool.com/fiddler/

Tony Clayton wrote:
 This is off-topic for this list, but I thought I'd just mention for those that
 are troubleshooting HTTP issues, there are useful plugins for both IE and
 Firefox that show you both incoming and outgoing HTTP headers, including 
 through
 https connections.
 
 For IE, there is an IE Explorer Bar add-on called ieHTTPHeaders:
   http://www.blunck.info/iehttpheaders.html
 You'll probably need to reboot after installing it for it to show up.
 
 For Firefox, there is an extension called LiveHTTPHeaders:
   http://livehttpheaders.mozdev.org/
 I think it might work with Mozilla as well, but I haven't tried it.
 
 As always with software, use at your own risk.  They work great for me.
 
 I thought this was of some relevance to this list, as many people using 
 mod_perl
 tend to do its powerful header management capabilities.
 
 Tony


  1   2   >