Hi, I'm new to Python (have done lots of Perl and Java on Unix though) and to Zope. I really like what I have seen of Zope, and would like to try and use it for my next project. The project has an interesting requirement, and I'm not sure how to accomplish it using the Zope Platform. I need to be able to package up the project and distribute it to multiple web servers automatically. If I did this project using cgi/perl and html I would probably just tar everything up and put it on an ftp server, which the other servers could check daily and update their code/html when a new tarball was available. How can I do something like this with Zope? I'd like to keep all my dtml/html/python code in normal text files, not in the object database. All the application data will be kept in some sort of SQL server, so if I can't eliminate the need for the object database entirely it would make my life easier. From what I've read on zope.org it sounds like I want Bobo, without Principia. In other words, I'd like to be able to walk over to a machine with my SQL database and apache installed on it and type: rpm -i zope-ver.rpm rpm -i zope-pcgi-ver.rpm tar xzf my_project.tgz Then be able to use my project from a web browser, without having to go in and configure it as a product or extention in Zope. Thanks for any help. -james [] James A. Hillyerd <jamesh@altavista.net> Java Developer [] HyperGlyphics: http://www.hyperglyphics.com/ [] GPG Public Key Fingerprint for 1024D/9F956CDE (Expires 2000-02-01): [] C86F B073 92DF 1E24 EF0B 0118 6061 0FEC 9F95 6CDE
On Wed, Feb 17, 1999 at 01:28:16PM -0800, James A. Hillyerd wrote:
The project has an interesting requirement, and I'm not sure how to accomplish it using the Zope Platform. I need to be able to package up the project and distribute it to multiple web servers automatically. If I did this project using cgi/perl and html I would probably just tar everything up and put it on an ftp server, which the other servers could check daily and update their code/html when a new tarball was available.
Hmm... [ignores what he reads later] if everything is in the object datbase, then you can simply move the object database :-) AT least this works in theory <wink> I've done it a few dozen times without problems, but that doesn't mean it wouldn't break for someone less skilled in the art of hand-waving.
How can I do something like this with Zope? I'd like to keep all my dtml/html/python code in normal text files, not in the object database. All the application data will be kept in some sort of SQL server, so if I can't eliminate the need for the object database entirely it would make my life easier. From what I've read on zope.org it sounds like I want Bobo, without Principia.
Well, certainly if you plan to keep NOTHING in the object datbase this might be good, but don't know (BTW, Bobo is now called ZPublisher :-). You should look into the SQLMethods side fo the house (ZSQLAdapter or some such), which allows for some really elegant access to a relational model. This would let you keep more "static" stuff in the object database, and everything else in the SQL database as is appropriate for some projects.
In other words, I'd like to be able to walk over to a machine with my SQL database and apache installed on it and type:
rpm -i zope-ver.rpm rpm -i zope-pcgi-ver.rpm tar xzf my_project.tgz
Then be able to use my project from a web browser, without having to go in and configure it as a product or extention in Zope.
I don't think anything in the web world this "complex" will ever be that simple... hell, Apache doesn't work THAT easily most of the time. You need to define what your project is more accurately for it to be understandable... is it the pages and the SQL queries? Or does it include the database? Chris -- | Christopher Petrilli | petrilli@amber.org
On Wed, 17 Feb 1999, Christopher G. Petrilli wrote:
On Wed, Feb 17, 1999 at 01:28:16PM -0800, James A. Hillyerd wrote:
The project has an interesting requirement, and I'm not sure how to accomplish it using the Zope Platform. I need to be able to package up the project and distribute it to multiple web servers automatically. If I did this project using cgi/perl and html I would probably just tar everything up and put it on an ftp server, which the other servers could check daily and update their code/html when a new tarball was available.
Hmm... [ignores what he reads later] if everything is in the object datbase, then you can simply move the object database :-) AT least this works in theory <wink> I've done it a few dozen times without problems, but that doesn't mean it wouldn't break for someone less skilled in the art of hand-waving.
I'd rather avoid this, since it will be an automated process, and I don't want to lose any sleep over hundreds of servers silently crashing. I think this would also make it easier for me to debug and backup individual servers.
Well, certainly if you plan to keep NOTHING in the object datbase this might be good, but don't know (BTW, Bobo is now called ZPublisher :-). You should look into the SQLMethods side fo the house (ZSQLAdapter or some such), which allows for some really elegant access to a relational model. This would let you keep more "static" stuff in the object database, and everything else in the SQL database as is appropriate for some projects.
Not all of the servers will have full time internet connections, so I can't rely on accessing them via the web. I think that copying a specific server's database over the previous Zope database, restarting Zope, editing properties and then repeating the process for the next server would be a pain. I'd much rather pull up pico and edit a static configuration file.
In other words, I'd like to be able to walk over to a machine with my SQL database and apache installed on it and type:
rpm -i zope-ver.rpm rpm -i zope-pcgi-ver.rpm tar xzf my_project.tgz
Then be able to use my project from a web browser, without having to go in and configure it as a product or extention in Zope.
I don't think anything in the web world this "complex" will ever be that simple... hell, Apache doesn't work THAT easily most of the time.
I'm sure the setup won't be that simple, but the main point I was trying to make was that I don't want to have to open a web browser and configure things if I can help it. I wouldn't mind popping into Zope to configure a cgi-bin directory (or something similar, whatever I need to publish objects with ZPublisher).
You need to define what your project is more accurately for it to be understandable... is it the pages and the SQL queries? Or does it include the database?
Each server will maintain a seperate SQL database. I'd like to try and build all of the business logic into python objects, and call these objects from DTML and in some cases directly from the URL. I guess most of this I can figure out on my own, but I need a push in the right direction.
From the Tech Intro to Object Publishing, there is an example "module" Hello.py:
"""A simple Zope application""" def sayHello(name='World'): """Display a greeting""" return "Hello %s!" % name They show it being called as: http://www.mydomain.com/cgi-bin/Hello/sayHello My apache server is setup with the mod_rewrite so that the zope is accessed as http://localhost/Zope/ What do I need to do to install and experiment with this example? -james [] James A. Hillyerd <jamesh@altavista.net> Java Developer [] HyperGlyphics: http://www.hyperglyphics.com/ [] GPG Public Key Fingerprint for 1024D/9F956CDE (Expires 2000-02-01): [] C86F B073 92DF 1E24 EF0B 0118 6061 0FEC 9F95 6CDE
On Wed, Feb 17, 1999 at 02:26:05PM -0800, James A. Hillyerd wrote:
I'd rather avoid this, since it will be an automated process, and I don't want to lose any sleep over hundreds of servers silently crashing. I think this would also make it easier for me to debug and backup individual servers.
Dunno, this is osmething you can't avoid in most cases unless you build all kinds of redundency... eventually something isn't going to work correctly, and it's going to blow up. I'm not saying it WILL, just that it potentially could. Jim Fulton is better euqiped to answer the question of how to do that.
From the rest of your email, it looks like you really don't want the FULL Zope environment, you just want ZPublisher, the object-publisher formally known as bobo. :-)
Chris -- | Christopher Petrilli | petrilli@amber.org
On Wed, 17 Feb 1999, James A. Hillyerd wrote:
Not all of the servers will have full time internet connections, so I can't rely on accessing them via the web. I think that copying a specific server's database over the previous Zope database, restarting Zope, editing properties and then repeating the process for the next server would be a pain. I'd much rather pull up pico and edit a static configuration file.
I friend of mine is a senior Unix administrator in a large company and I have been pestering him all along to give Zope a try. He was impressed with Zope but he said that unless something can be configured by editing text files it won't be easily adopted. The Web GUI is fine but not for configuring en mass hundreds of servers (which echoes your concerns). I was hoping to change his mind so I wrote a Zope product (XMLConfig available on the Zope site) that maps python dictionaries to a simple text format. The dictionaries can be modified either from Zope using DTML calls or by directly editing the text file. The changes are automatically updated in either case. Maybe you can find it useful although personally I don't like it and I don't use it. Alternatively you can use ZClient to automatically access and change the relevant properties.
Each server will maintain a seperate SQL database. I'd like to try and build all of the business logic into python objects, and call these objects from DTML and in some cases directly from the URL.
http://www.mydomain.com/cgi-bin/Hello/sayHello
My apache server is setup with the mod_rewrite so that the zope is accessed as http://localhost/Zope/
What do I need to do to install and experiment with this example?
If you have a lot of python modules that you need to web enable Zope might not be the best approach. Direct use of ZPublisher might be more appropriate especially if there is no 'content' that needs to be regularly updated from the web. The simplest way to publish a python module is calling ZopeHTTPServer (in your Zope distribution) with your module as arguments. Read ZopeHTTPServer's doc string for more info. Remember though that ZPublisher will publish instances of your classes and that only methods with a doc string will be published. Pavlos
participants (3)
-
Christopher G. Petrilli -
James A. Hillyerd -
Pavlos Christoforou