Problem:

You need to setup Zope behind Apache with SSL and you need to access some/all of the CGI environment variables set by the mod_ssl from within Plone. How to do it ?

To setup Zope behind Apache with SSL is not the hard part. I'll give anyway an example of setting an apache virtualhost with SSL.

Apache doesn't forward the mod_ssl CGI environement variables to Zope. Why ? Because Zope doesn't support SSL until now.

When you setup apache with SSL as proxy for your Plone site, it (apache) receives HTTPS-requests from the outside but it sends HTTP-requests to Zope. That's why you don't get the SSL headers through to the proxied Plone site.

» Read More

Inspired by this caching recipe and to continue with the previous post, I think it will be more readable, clean and reusable if we use a decorator to cache methods inside a tool:

class myTool(...):

@cachedmethod
def getMyDataFromDB(*args, **kw):

data = fetch_mydata_from_db()

return data
Decorators make magic easy.

The cachedmethod decorator would be as follow (The code is not tested):

» Read More

When I have some data to put in the cache, I do it the easiest way: I write a python script that returns the data and then from the Zope Instance Manager I make use of the caching Tab to select the type of caching.

Anton (the speaker) showed me a way of using zope caching form within my code:

from OFS.Cache import Cacheable

and then make my class (Content Type, Tool or ...) cacheable by inheriting from Cacheable.
To cache and to get cached data, we can use some thing like this:

» Read More

When you have many zope instances distributed on many servers and point all to the same storage and you have many other servers at the frontend with many software for caching, load balancing, mailing, ..etc, you probably know the hell of maintaining such system. I was asked to found out a solution to centralize the logging part of this system.

Let's take just the zope part:

Zope comes with 5 types of logging handlers: logfile, syslog, win32-eventlog, http-handler and email-notifier. For the problem I want to solve the syslog handler is the best choice.

Why syslog ?



The http-handler sends the log with a http request to an URL. It will be slow and will use more system resources and some coding.
The email-notifier is not for centralizing a logging system it is just for notification.
The win32-eventlog is for windows :-)

The syslogd come pre-installed with all *nix systems and can forward logging requests to other syslogd on other server using the UDP protocol.

» Read More

from the README file:
The ZEO RAID storage is a proxy storage that works like a RAID controller by creating a redundant array of ZEO servers. The redundancy is similar to RAID level 1 except that each ZEO server keeps a complete copy of the database.

Therefore, up to N-1 out of N ZEO servers can fail without interrupting.

It is intended that any storage can be used as a backend storage for a RAID storage, although typically a ClientStorage will be the direct backend.

[ ZEO 1 ] ... [ ZEO N ]
\ /
\ /
\ /
\ /
\ /
\ /
[ ZEO RAID ]
/ \
/ \
/ \
/ \
/ \
/ \
[ Zope 1 ] ... [ Zope M]


My use case is like this:

» Read More

I found out that zopectl has a command named adduser. So instead of using the python script zpasswd.py to add a zope manager one can call:
#./zopectl adduser user_name user_password

I always used the "zopctl debug" and "zopectl test" but didnt know that zopectl has the adduser command.

Here is a list of all available commands:

» Read More

I have learned something new. So I want to share it.

Suppose you have a ZEO client and 2 ZEO servers. Is it possible to configure the ZEO client that if the first ZEO server crashes it uses the second ?

The answer is yes with one condition: the 2 ZEO servers MUST share the same storage (Data.fs) OR the 2 storages MUST be identical (perfect replication).

SETUP (tried only with Zope 2.9.6):

» Read More