Re: [Zope] unbuffered response.write through Apache 2.0 reverse proxy?

2006-02-20 Thread Christoph Berendes

Chris McDonough wrote:

Apache does its own buffering IIRC.  Look for ProxyReceiveBufferSize/ 
ProxyIOBufferSize.



Thanks. AFAICT 
(http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxyiobuffersize), 
though, the buffer size settings have to be fairly large (512 or more, 
or 0 for the "system's default buffer size"). I'm actually writing very 
short progress messages, e.g.


Parsing page 1...
Parsing page 2...

etc.

so I've padded this with blanks to hit the buffer size. Klugey,but works.




On Feb 18, 2006, at 3:59 AM, Christoph Berendes wrote:

To prevent browser timeout during a long running process, I've got  
the following code to work nicely,when the browser accesses Zope  
directly (e.g. http://myzope.net:8080/folder/client001/)


context.REQUEST.response.write("progressing...")
#do some stuff
context.REQUEST.response.write("further...")
#do some more stuff
context.REQUEST.response.write("done!")


However, when browser goes through the Apache reverse proxy, e.g.


ServerAlias   site1.foobar.com

  RewriteRule ^/(.*) \
 http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/% 
1/site001/VirtualHostRoot/$1 [L,P]


I get all three writes (progressing..further...done!) at once, at  
the end of the processing.


I'm running Apache 2.0, Zope. 2.7.6, Plone 2.0.5 on Linux
From going through Apache docs and discussions (notably http:// 
www.gossamer-threads.com/lists/apache/dev/305433), it appears that  
this is an Apache 2.0 problem.


Is there any way to get the same behavior (unbuffered writes) even  
when I go through the Apache reverse proxy?


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] unbuffered response.write through Apache 2.0 reverse proxy?

2006-02-18 Thread Christoph Berendes
To prevent browser timeout during a long running process, I've got the 
following code to work nicely,when the browser accesses Zope directly 
(e.g. http://myzope.net:8080/folder/client001/)


context.REQUEST.response.write("progressing...")
#do some stuff
context.REQUEST.response.write("further...")
#do some more stuff
context.REQUEST.response.write("done!")


However, when browser goes through the Apache reverse proxy, e.g.


ServerAlias   site1.foobar.com

  RewriteRule ^/(.*) \
 
http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/%1/site001/VirtualHostRoot/$1 
[L,P]


I get all three writes (progressing..further...done!) at once, at the 
end of the processing.


I'm running Apache 2.0, Zope. 2.7.6, Plone 2.0.5 on Linux
From going through Apache docs and discussions (notably 
http://www.gossamer-threads.com/lists/apache/dev/305433), it appears 
that this is an Apache 2.0 problem.


Is there any way to get the same behavior (unbuffered writes) even when 
I go through the Apache reverse proxy?


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTML to PDF.

2005-11-16 Thread Christoph Berendes




Some discussion on this general area last week (not so much experience
- at least on my part - but options)

http://mail.zope.org/pipermail/zope/2005-November/162812.html


  
Does Anyone has this product in a production environment?

It's easy to configure and stuff? We currently are working with the 
reportlab, but it's painful to change the document... :(  I need a 
product which generates a PDF file on the fly. Any other application or 
suggestion will be welcome. 

Thanks,

Fernando Lujan


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


  
  
  




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] experience w/ filestorage mount points? maximum?

2005-11-15 Thread Christoph Berendes

Why so many, in separate files, you ask...

1. why not? (what's the cost/risk of multiple Data.fs files and mount 
points), hmmm?


2. makes it easy to move a single client site between instances and 
servers (we don't yet know how load is going to mount up, and whether 
we'll need to set up a new server at, say, 30 sites, or 100, or ...)


3. site import/export doesn't work as well, and it seems that 
import/export of "large" Zope objects is deprecated...


4. I'm told that, occasionally, Data.fs become corrupted. We have some 
protection if that happens, since it should (I'd think) affect only one 
client, not many.


I'm very interested in answers to #1 (things that will make me regret 
our current strategy)





Chris Withers wrote:


Christoph Berendes wrote:

I am writing to tap the list's experience with running a single zope 
instance with a large number (30, 500, 2000?) of mount points.



Why do you want so many ;-)

We're hosting a number of client sites, and for each client, e.g. 
clientX, we have a mount point:




mount-point /clientX

path $INSTANCE/var/clientX/Data.fs






Why not just keep them all in the same .fs file?

cheers,

Chris



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] htmltopdf

2005-11-14 Thread Christoph Berendes

Asad Habib wrote:

Has anyone successfully used htmltopdf, a PHP script written by Jason 
Rust (www.rustyparts.com) to convert an HTML file to PDF, with Zope? 
In particular, I wanted to find out if anyone had used the python 
equivalent of this PHP script.



We've been looking into this recently. Raw notes on various tools and 
links below, first on HTML to pdf/ps, and then on HTML to image 
(jpeg/png) directly, which is ultimately what we need to do.



The main thing is that many of the html to ps/pdf tools don't handle CSS 
well, if at all. The big exception there is shown (with a live demo) at 
http://www.tufat.com/script19.htm. It's fabulous - handles pages from 
csszengarden quite well.


At the moment, we're going with a simpler approach to our problem 
(watermarks), but if we went the HTML to PDF/image route, I'd look at 
the tufat.com script, or the approach noted at the hackdiary.com link.



HTML TO PDF/PS CONVERSION
"html2ps":http://user.it.uu.se/~jan/html2ps.html

"html to pdf in php":http://www.rustyparts.com/pdf.php

"python script for html to pdf 
conversion":http://www.rustyparts.com/scripts/HTML_ToPDF/contrib/html2pdf.py


"html2doc":http://www.easysw.com/htmldoc , a proprietary tool

"denature":http://denature.sourceforge.net/, html to pdf via xsl/fo in Perl

other "html to pdf":http://tinyurl.com/a8u7q tools at Freshmeat


Zope cookbook has a "recipe":http://zopelabs.com/cookbook/1069611008
using (yum-able) "recode":http://www.gnu.org/software/recode/recode.html 
and "html2doc":http://www.htmldoc.org/ aka a "product from 
ESP":http://www.easysw.com/htmldoc/ (under GNU license)


* there's also the apparently very simple
"ZpdfDocument":http://www.zope.org/Members/gaaros/ZpdfDocument





There is a "php version of html2ps":http://www.tufat.com/script19.htm 
which handles background images, e.g. from here 
"http://www.netmechanic.com/news/vol5/HTMLTest_background.htm":http://www.netmechanic.com/news/vol5/HTMLTest_background.htm



HTML TO IMAGE CONVERSION

* "html2jpg":http://freshmeat.net/projects/html2jpg/ "project 
page":http://marginalhacks.com/Hacks/html2jpg/ (requires mozilla)


* "khtml2png":http://directory.fsf.org/webauth/misc/khtml2png.html (not 
maintained) also used 
"here":http://www.michaelhoover.org/work/2004/07/khtml2png.html


* "another python-based 
app":http://www.hackdiary.com/archives/55.html(may be the most 
promising)"http://www.pygtk.org/":http://www.pygtk.org/


* "webkit2png":http://www.paulhammond.org/webkit2png/


* "Easy capture":http://www.perturb.org/display/entry/728/ for the PHP 
environment (not HTML, just images)


* "HTML/CSS/javascript 
approach":http://www.electropubs.com/watermark_install.htm



* using "PHP and GD":http://www.sitepoint.com/print/watermark-images-php
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] experience w/ filestorage mount points? maximum?

2005-11-11 Thread Christoph Berendes
I am writing to tap the list's experience with running a single zope 
instance with a large number (30, 500, 2000?) of mount points.


We're hosting a number of client sites, and for each client, e.g. 
clientX, we have a mount point:




mount-point /clientX

path $INSTANCE/var/clientX/Data.fs





Currently, we have about a dozen of these. This works well. Of course, 
more clients will increase server load, but so long as that is more or 
less linear and gradual, that's fine.


Questions for the list:
   - What's the greatest number of mount points that folks have set up 
this way(50? 1000? more?) and what's been the experience,  particularly 
with non-linear responses (e.g. "it all goes to pot after n=100")?


- Are there any theoretical limits on the number of mount points?

Thanks.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: use Data.fs from mountpoint B to "populate" mountpoint A - how?

2005-10-27 Thread Christoph Berendes

Chris Withers wrote:


Dieter Maurer wrote:


Actually, the mount-point syntax is much more complex than the form
you use above. Among others, it supports

   mount-pointmount-path:storage-path

"mount-path" describes how you reach the mount point
in the mounting application and "storage-path" how you
find the mounted object from the storage root.



Wow, I never knew this :-S Where's it documented?


In Dieter's reply, and here:
http://mail.zope.org/pipermail/zope/2004-September/152882.html
kinda sorta. ;-)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: use Data.fs from mountpoint B to "populate" mountpoint A - how?

2005-10-24 Thread Christoph Berendes

Sorry and thanks.

I've found that the when I initially create a separate mount point and 
Data.fs file with


mountpoint /original

and then copy Data.fs to
../newlocation

this almost works:
mountpoint /newlocation:/original

It works, in that I can navigate through the ZMI, but it fails in that 
the plone site embedded in this Data.fs file generates urls that point 
back to ../original.


Your comments explain why. Thanks.

Question: this wouldn't be the case for a Zope or Plone folder. If I 
rename a folder from 'old_folder_name' to 'new_folder_name', it appears 
that the folder has no "memory"  of old_folder_name. However, it appears 
that a mount point "remembers" where it was created.  Isn't that in some 
sense a bug?



Dieter Maurer wrote:


Please send all Zope related questions to a Zope related mailing
list and not to me privately.

Usually, I do not answer questions sent to me privately!

I added "zope@zope.org".

Christoph Berendes wrote at 2005-10-21 14:12 -0400:
 

I created a mount point, /default_site and a corresponding directory 
var/default_site.  I build my plone site from scratch into 
default_site/site001, and all is good.


I then create a second mount point /kitchensbyartisan and a 
corresponding directory var/kitchensbyartisan.  I copy 
var/default_site/Data.fs into var/kitchensbyartisan. Make the new_site 
mount point in the ZMI, restart a lot etc.


However, when I then navigate in the ZMI to kitchensbyartisan, it's 
empty and doesn't show site001 (or anything)


Do I  need something fancier than the following in zope.conf, some 
reference to default_site?



mount-point /kitchensbyartisan

path $INSTANCE/var/kitchensbyartisan/Data.fs


   



When you use this simple mount-point syntax, then the mount
path is coded into the generated storage and you cannot
mount the storage under a different path.


Actually, the mount-point syntax is much more complex than the form
you use above. Among others, it supports

  mount-point   mount-path:storage-path

"mount-path" describes how you reach the mount point
in the mounting application and "storage-path" how you
find the mounted object from the storage root.

An example would be:

  mount-point/F1/F2/XXX:/S1/XXX

Note that the last component in both paths *MUST* be identical
(otherwise, Zope's url construction no longer works with
URL traversal).

Usually, the "storage-path" will look like "/XXX" (where "XXX" is
some id (without '/')).


If "storage-path" is not given, it defaults to "mount-path" (this
explains why you do not see anything in your storage).


To summarize:

 *  always explicitely give a storage path

 *  use a storage path of the form "/"

 *  then you can mount the storage at different places
*BUT* you must never mount with a different id
(the mount point must have the same id as that of the
mounted object).

 



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )