Question on Zope and including generated HTML content
I'm new to Zope so be gentle plez :) I getting my feet wet in Zope and I have a question about getting pre-existing HTML content that is regenerated auto-magically at specific time periods into Zope. I basically have a directory called /usr/local/www/orca (and some other areas) whose HTML content is automagically regenerated every 5 minutes. Basically, I'm hoping Zope can feed up this content up but I don't know how to "include" this content in my Zope workspace. I'm hoping this content doesn't have to be "pulled" into Zope. Just hoping Zope will simply push the content out when requested. I looked through the Zope documentation somewhat but I don't know exactly what to call this so I'm not sure where specifically in the FAQs or docs to look for this. Any thoughts for a newbie appreciated. -- Sean O'Neill
On Thu, Jun 19, 2003 at 10:27:59PM -0500, Sean O'Neill wrote:
I'm new to Zope so be gentle plez :)
I getting my feet wet in Zope and I have a question about getting pre-existing HTML content that is regenerated auto-magically at specific time periods into Zope.
I basically have a directory called /usr/local/www/orca (and some other areas) whose HTML content is automagically regenerated every 5 minutes.
Basically, I'm hoping Zope can feed up this content up but I don't know how to "include" this content in my Zope workspace. I'm hoping this content doesn't have to be "pulled" into Zope. Just hoping Zope will simply push the content out when requested.
Search for LocalFS. It's probably the easiest solution to this kind of task. Not good for serving really large files, though. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's NOISOME ASPHALTICIAN! (random hero from isometric.spaceninja.com)
On Thu, 2003-06-19 at 20:27, Sean O'Neill wrote:
I basically have a directory called /usr/local/www/orca (and some other areas) whose HTML content is automagically regenerated every 5 minutes.
Basically, I'm hoping Zope can feed up this content up but I don't know how to "include" this content in my Zope workspace. I'm hoping this content doesn't have to be "pulled" into Zope. Just hoping Zope will simply push the content out when requested.
There are three basic ways you could go about this. One common option is to keep your other content exactly as it is and use Apache as a reverse proxy for both systems. This is generally the best option for fully dynamic external content, such as a squirrelmail installation. It's pretty easy to set up Apache to use more than one source and switch among various sources based on URL matching. Look at the Apache docs for RewriteRule for details. Another solution may be to port your dynamic content to Zope. Without knowing anything about this dynamic content, it's hard to know whether that would be difficult or violate some other requirement. But Zope is excellent at hosting dynamic content... it's quite possible that it may be applicable to your purpose. The last solution I'll suggest is that you can cook up an external method that renders/calls/reads the external source. If that content is a shell script or a file that some other process dumps out occasionally, this may be just the trick. External methods have the full range of Python's abilities and can pretty much do anything, provided you have sufficient privileges. You could build a poor man's reverse proxy this way if you really needed to. If you use an external method and your external content only changes at predictable intervals, you may see some significant benefit from caching your results. Zope has some built-in caching ability and there are any number of other caching solutions. Hope something in there helps. There's more than one way to do it, certainly... which method is best for you will depend on the specifics. Dylan
At 09:22 PM 6/19/2003 -0700, Dylan Reinhardt wrote:
One common option is to keep your other content exactly as it is and use Apache as a reverse proxy for both systems. This is generally the best option for fully dynamic external content, such as a squirrelmail installation. It's pretty easy to set up Apache to use more than one source and switch among various sources based on URL matching. Look at the Apache docs for RewriteRule for details.
This is how my current static HTML content is being delivered - Apache on Solaris firewall reverse proxying Apache content running on FreeBSD machine behind it. This is easiest without question and probably how I'll do it for now. I was just hoping to see how feasible it would be to get Zope to do it all. I also looked at LocalFS from another post reply I got. So far I'm not getting far with LocalFS. I keep getting the error when I attempt to hit the index.html file that exists in the directory I point my LocalFS object at: Error Type: NameError Error Value: global name 'tmp_path' is not defined I can't seem to find anything on LocalFS and this error anywhere.
Another solution may be to port your dynamic content to Zope. Without knowing anything about this dynamic content, it's hard to know whether that would be difficult or violate some other requirement. But Zope is excellent at hosting dynamic content... it's quite possible that it may be applicable to your purpose.
This won't work - or I should say its 10,000 feet over my head. The content is generated using a rather large and complex Perl script, associated Perl modules, and the RRD Perl module.
The last solution I'll suggest is that you can cook up an external method that renders/calls/reads the external source. If that content is a shell script or a file that some other process dumps out occasionally, this may be just the trick. External methods have the full range of Python's abilities and can pretty much do anything, provided you have sufficient privileges. You could build a poor man's reverse proxy this way if you really needed to.
50,000 feet over my head ... LOL Thanks for the reply. -- Sean O'Neill
Sean O'Neill wrote at 2003-6-20 21:48 -0500:
... I also looked at LocalFS from another post reply I got. So far I'm not getting far with LocalFS. I keep getting the error when I attempt to hit the index.html file that exists in the directory I point my LocalFS object at:
Error Type: NameError Error Value: global name 'tmp_path' is not defined
Remember to look at the traceback! When you do not understand it, post it. Maybe we can... Dieter
At 12:01 AM 6/23/2003 +0200, Dieter Maurer wrote:
Sean O'Neill wrote at 2003-6-20 21:48 -0500:
... I also looked at LocalFS from another post reply I got. So far I'm not getting far with LocalFS. I keep getting the error when I attempt to hit the index.html file that exists in the directory I point my LocalFS object at:
Error Type: NameError Error Value: global name 'tmp_path' is not defined
Remember to look at the traceback!
When you do not understand it, post it. Maybe we can...
Oppss, I should have thought of that - sorry :). See below. Exception traceback Time 2003/06/22 18:57:33.830 GMT-5 User Name (User Id) Anonymous User (None) Request URL http://compaq:8080/Orca/index.html Exception Type NameError Exception Value global name 'tmp_path' is not defined Traceback (innermost last): * Module ZPublisher.Publish, line 89, in publish * Module ZPublisher.BaseRequest, line 322, in traverse * Module Products.LocalFS.LocalFS, line 131, in __getattr__ * Module Products.LocalFS.FSObject, line 736, in _getOb * Module Products.LocalFS.FSObject, line 1196, in _fs_create * Module Products.LocalFS.FSObject, line 238, in _fs_store_props NameError: global name 'tmp_path' is not defined Another attribute of this is when I access the LocalFS object without the index.html at the end - I get my default home page. Then when I tack on the index.html at the end of the URL, I get this in my browser and the above traceback in my error_log: Zope Error Zope has encountered an error while publishing this resource. Error Type: NameError Error Value: global name 'tmp_path' is not defined When I set the object up, I used the following: ID = Orca Title = Orca Base Path = /usr/local/www/docroot/orca -- Sean O'Neill
Sean O'Neill wrote at 2003-6-22 19:06 -0500:
At 12:01 AM 6/23/2003 +0200, Dieter Maurer wrote:
Sean O'Neill wrote at 2003-6-20 21:48 -0500:
... I also looked at LocalFS from another post reply I got. So far I'm not getting far with LocalFS. I keep getting the error when I attempt to hit the index.html file that exists in the directory I point my LocalFS object at:
Error Type: NameError Error Value: global name 'tmp_path' is not defined .... * Module Products.LocalFS.FSObject, line 1196, in _fs_create * Module Products.LocalFS.FSObject, line 238, in _fs_store_props NameError: global name 'tmp_path' is not defined
Apparently a bug in line 238 of "Products/LocalFS/FSObject.py". Look at the source around line 238 and find out what "tmp_path" should probably be. When you succeed, define it. Another alternative: a newer version of "LocalFS" might fix the problem. Dieter
participants (4)
-
Dieter Maurer -
Dylan Reinhardt -
Paul Winkler -
Sean O'Neill