Howdy Zopistas! I'd like to implement a chat function using the multipart content type and I wonder if that is possible with Zope. My idea is to write a python script that pushes the content of a database until e.g. the stop button is pressed in the Browser. But how would the script know that it's supposed to stop? And would such a longtime connection completely occupy one Zope thread so that I'd have to increase the number of threads? Ragnar
Hi Zopers, I am looking for some help about how to configure Apache with Zope using ProxyPass and i haven´t found any text explaining how to set up apache to serve some content without passing to Zope Example: Let´s say i want to set up the site www.mysite.com that has Apache listening on 80 an ZServer on 1485 I also have some static content located in "/home/httpd/html/stat" This configuration with ProxyPass should be like this: <VirtualHost 200.224.238.200> ServerName www.mysite.com ServerAdmin admin@mysite.com # Here goes my doubt. In these two lines below, i say that all requests # will be passed to Zserver, but this is not exactly what i want. # The requests with "/sta"t i don´t wanna pass to Zserver, # i would like to use apache itself to serve this content. ProxyPass / http://www.mysite.com:1485/ ProxyPassReverse / http://www.mysite.com:1485/ </VirtualHost> Any help will be welcome. Regards Rodrigo
Example:
Let´s say i want to set up the site www.mysite.com that has Apache listening on 80 an ZServer on 1485
I also have some static content located in "/home/httpd/html/stat"
This configuration with ProxyPass should be like this:
<VirtualHost 200.224.238.200>
ServerName www.mysite.com ServerAdmin admin@mysite.com
# Here goes my doubt. In these two lines below, i say that all requests # will be passed to Zserver, but this is not exactly what i want. # The requests with "/sta"t i don´t wanna pass to Zserver, # i would like to use apache itself to serve this content.
ProxyPass / http://www.mysite.com:1485/ ProxyPassReverse / http://www.mysite.com:1485/
</VirtualHost>
Use rewriting rules, eg: ProxyPassReverse / http://www.mysite.com:1485/ RewriteEngine On RewriteLogLevel 0 RewriteLog "/var/log/httpd/rewrite_log" RewriteRule ^/stat/ - [L] RewriteRule ^/(.*) http://www.mysite.com:1485/$1 [P] There is a howto on zope about it.The above lines says treat /stat/ as local [L],using the normal doc_root, & everything else should be proxied [P] Ivan
Hi! I wrote a howto that you can find at http://www.zope.org/Members/rbeer/caching HTH Ragnar
Hi Zopers,
I am looking for some help about how to configure Apache with Zope using ProxyPass and i haven´t found any text explaining how to set up apache to serve some content without passing to Zope
Example:
Let´s say i want to set up the site www.mysite.com that has Apache listening on 80 an ZServer on 1485
I also have some static content located in "/home/httpd/html/stat"
This configuration with ProxyPass should be like this:
<VirtualHost 200.224.238.200>
ServerName www.mysite.com ServerAdmin admin@mysite.com
# Here goes my doubt. In these two lines below, i say that all requests # will be passed to Zserver, but this is not exactly what i want. # The requests with "/sta"t i don´t wanna pass to Zserver, # i would like to use apache itself to serve this content.
ProxyPass / http://www.mysite.com:1485/ ProxyPassReverse / http://www.mysite.com:1485/
</VirtualHost>
Any help will be welcome.
Regards
Rodrigo
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Ragmar, Ragnar Beer schrieb:
Howdy Zopistas!
I'd like to implement a chat function using the multipart content type and I wonder if that is possible with Zope. My idea is to write a python script that pushes the content of a database until e.g. the stop button is pressed in the Browser. But how would the script know that it's supposed to stop? And would such a longtime connection completely occupy one Zope thread so that I'd have to increase the number of threads?
Ragnar
First of all it would not occupy a zope thread but merely an asynchore-channel. You would have to go deep into the architecture of zope/zserver to archieve such a solution. May be the better way is a irc-server (ircu) anyway. There are numerous irc-clients on java basis. HTH Tino Wildenhain
I'd like to implement a chat function using the multipart content type and I wonder if that is possible with Zope. My idea is to write a python script that pushes the content of a database until e.g. the stop button is pressed in the Browser. But how would the script know that it's supposed to stop? And would such a longtime connection completely occupy one Zope thread so that I'd have to increase the number of threads?
Not sure about the threads, but a quite comonly used trick is to generate the html page as the chat evolves, without writting the ending </html> tag. The browser will think the connexion is slow, and will continue to display the page. You should not, however, use complex layout (tables), as the browser sometimes need a complete page to display those. Good luck
Philippe J wrote:
I'd like to implement a chat function using the multipart content type and I wonder if that is possible with Zope. My idea is to write a python script that pushes the content of a database until e.g. the stop button is pressed in the Browser. But how would the script know that it's supposed to stop? And would such a longtime connection completely occupy one Zope thread so that I'd have to increase the number of threads?
Not sure about the threads, but a quite comonly used trick is to generate the html page as the chat evolves, without writting the ending </html> tag. The browser will think the connexion is slow, and will continue to display the page. You should not, however, use complex layout (tables), as the browser sometimes need a complete page to display those.
I fairly sure this won't work, as I believe Zope renders a complete page before sending it the client browser. This is unlike something like PHP which sends the page as it interprets it. This confused me when I first switched as I was trained to always send headers before any output, however in zope you can manipulate the REQUEST object right up to the end of your page. Ivan
On Sun, 25 Feb 2001, Ivan Cornell wrote:
Philippe J wrote:
I'd like to implement a chat function using the multipart content type and I wonder if that is possible with Zope. My idea is to write a python script that pushes the content of a database until e.g. the stop button is pressed in the Browser. But how would the script know that it's supposed to stop? And would such a longtime connection completely occupy one Zope thread so that I'd have to increase the number of threads?
Not sure about the threads, but a quite comonly used trick is to generate the html page as the chat evolves, without writting the ending </html> tag. The browser will think the connexion is slow, and will continue to display the page. You should not, however, use complex layout (tables), as the browser sometimes need a complete page to display those.
I fairly sure this won't work, as I believe Zope renders a complete page before sending it the client browser. This is unlike something like PHP which sends the page as it interprets it. This confused me when I first switched as I was trained to always send headers before any output, however in zope you can manipulate the REQUEST object right up to the end of your page.
You can send streaming output with RESPONSE.write() which is documented in the online help system. -Michel
participants (6)
-
Ivan Cornell -
Michel Pelletier -
Philippe J -
Ragnar Beer -
rleme@idg.com.br -
Tino Wildenhain