Zope FAQ: noze's 2008 technical guide

30 questions and answers on Zope, Python, ZODB, deployment and performance: Italian translation and adaptation of the original Zope FAQ by Luke Tymowski.

Open SourceWeb ZopeZope FAQPythonZODBPloneZEOWeb PublishingApacheOpenBSDHistorical Archive

Original: Fri, Nov 3, 2000; by Luke Tymowski.

This is the archive of the Italian-language Zope FAQ as published on noze.it in October 2008. It is a historical document: it describes the state of the art of Zope between 2000 and 2008 and uses technical references (versions, hardware, mailing lists, URLs) that are largely obsolete today. We keep it published as testimony of the Zope/Python ecosystem in Italy in that period, and of noze’s translation and editorial work in its early years.

1. General information

1.1 What is Zope?

Zope is a web publishing system. It consists of an optional Web Server, an object database and a middle layer that coordinates inserting and removing information from/to databases.

It is also possible to leave out the Web Server component and use Zope behind Apache or IIS. Zope is designed — and excels at this — to be a dynamic publishing system. If you have a three-page site, Zope is useless. If you have hundreds or thousands of pages, many users, and lots of impatient readers, Zope is great. Zope is also open-source, a feature crucial to its success. (Zope is an acronym: it stands for Z-Object Publishing Environment; if a young and pretty person comes to ask you at a party, just answer “Zope is Zope”.)

The programming language used for Zope is Python and C. Most of Zope is written in Python, and some small parts — where performance is paramount — have been rewritten in C. Zope is described as the killer application of Python, that is the application that best demonstrates the power of that programming language. Therefore, it is really worth learning Python.

Digital Creations describes Zope as an application server. I suppose they mean that you can use Zope to build applications. But in my opinion it is easier for a person to understand by saying “web publishing system”.

1.2 Why should I use Zope?

Zope is one of the most powerful and flexible Web Publishing tools on the market. There are few things that other products do better than Zope. It is currently famous for being hard to learn, and that is true. Certainly it is hard to know Zope deeply. But after very little time, a non-programmer can already use Zope to create a powerful and flexible site that could be very difficult or even impossible to make for those (non-programmers) who use other tools.

Furthermore, if you are already a programmer who knows Python, Zope will let you greatly enhance your skills.

1.3 Who develops Zope?

Zope is developed mostly by Digital Creations, a web consulting company. Their main investor learned about Zope one day and convinced Digital Creations to make it open-source. They did so in 1998, and nobody — neither them nor Zope — has gone back since.

So Zope is open-source: the Zope developer community has spread all over the world. I myself have later submitted a patch for Zope. But Digital Creations currently does most of the programming and maintenance of the official structure, even though they are not the only developers.

1.4 Where can I get Zope?

You can download Zope from zope.org/Products.

1.5 Do ISPs support Zope?

Yes. For the list see zope.org/Resources/ZSP. Other companies not listed here are on Zopesite.com.

1.6 Can I get support if I use Zope?

Yes. There is free support for Zope on the mailing lists. If you want non-free support, you need to enter into a support contract with Digital Creations. If you want to set up or maintain a Zope Server — or both — you can ask for advice on Tummy.com and iMeme.net.

The Zope community is currently large enough that you can probably get the help you need from someone. (Translator’s note: there is also an Italian-language mailing list, Zope-it, found on Zope.org.)

1.7 What products does Zope compete against?

If you are looking for an open-source competitor to Zope, take a look at AOLserver. In my opinion Zope and AOLserver are superior to the rest of the products on the market.

There are many other tools to build sophisticated Web sites, some free and some commercial. All have their pros and cons.

1.8 Do I need a fast computer for Zope? Can I use my old 486?

Like all software, the faster your computer, the happier you will be. Since Zope is written in Python, you will get a substantial performance improvement using a P3-850 instead of a P3-500 for example. You can probably use Zope on a 486, but it would be very slow. An old Pentium 133 will be enough for development. To serve a public Web site you will need at least a P3-450 or higher. An iMac, with Linux installed, is great for a Zope machine. The Zope.org site runs on a $1,000 server and the performance is very good. The G3 and G4 CPUs used in today’s Apple computers are great for running Zope.

1.9 What is the best platform for Zope? Linux? BSD? NT? MacOS X? Solaris? HP-UX?

BSD platforms (e.g. OpenBSD, FreeBSD) and Linux are excellent for Zope. Unix servers are much more flexible and easier to manage. On NT it can be easy to do various things, but when they go wrong, it is easy to get stuck. I have never had disastrous experiences under NT (by day I am an NT Network administrator), but I have never had any trouble with Linux and OpenBSD. I use OpenBSD for all my Zope servers simply because it is more secure than Linux.

Unix support is easier to find and of better quality. You also do not have the unpleasant cost of NT server and client licences.

But if you plan to build a large site, the cost of NT and its licences will be minimal compared to the cost of bandwidth and system administration.

1.10 How fast is Zope? Can I use it to build Slashdot part deux?

Zope is fast enough. What does that mean? Zope is not now — and probably will never be — as fast as Apache, AOLserver and IIS when serving static pages. But when serving dynamic pages, where every single page is generated from scratch by the server, Zope can easily compete with each of them. Zope is also much faster than Java Server Pages. It can support millions of page views per day, depending on the complexity of your site and your hardware.

For enterprise sites with very high traffic intensity, you can use ZEO, also open-source.

1.11 Who uses Zope? Has anyone reviewed Zope?

Thousands of sites worldwide are built with Zope. For a list of some Zope case studies see zope.org/Resources/CaseStudies. Jon Udell reviewed Zope on Byte.com. Translator’s note: you can find Italian-language reviews on noze.it and Punto Informatico.

1.12 What do I need to learn Zope?

A computer, a web browser, Zope itself and the will to learn. You do not need to buy anything else.

1.13 Are there books on Zope?

Not yet. Two DigiCooleans (translator’s note: collaborators of Digital Creations) are working on a book, which will be published in 2001 by O’Reilly. You can look for a BETA version of this book on www.zope.org/Members/michel/ZB/.

1.14 I am not a genius, can I still safely use Zope?

Yes. You can create rather sophisticated sites without dealing with complex programming. You can build a site like zopeNewbies in about an hour. I did it, and if I can do it, anyone can.

1.15 Is there a Zope tutorial?

Yes. There is one in Zope itself. From the Zope main screen, select from the menu at the bottom: Zope Tutorial.

1.16 What is a Zope Product?

A Product of Zope is a programme that you put on Zope and that does something really powerful without you having programmed anything. Zope Products must be written in Python.

1.17 Give me an example of a Zope Product.

Squishdot is a weblog software, designed on the Slashdot model. You can install it in Zope and you will be ready to publish a complex WEBLOG in a few minutes.

2. Installation and configuration

2.1 How do I install Zope?

If you are installing Zope under NT, Zope includes a graphical installer (GUI) that will do all the dirty work for you. Including configuring Zope as a service if you run NT.

If you use Unix you can download the source file. If you use an RPM-compatible version of Linux (e.g. RedHat) you can download an RPM.

I prefer to download the sources and compile them myself. Note that you must have Python 1.5.2 installed to compile the Zope source. In this case you have to unpack Zope:

tar -xzvf Zope-src-2.2.2.tgz
cd Zope-2.2.2
python w_pcgi.py

2.2 When I launch Zope (on Unix) text appears on my terminal, requiring me to open another window.

By default Zope starts with debug information enabled. You can get rid of it by editing the startup file (located in Zope’s root directory) and removing the -D option. The -D option puts Zope in debug mode.

2.3 I cannot log in to Zope — it wants a username and a password.

At the end of the compilation process, the superuser account and password appear on the screen. If you lose them, you can recompile the source — this time paying close attention to what appears on the screen. Or you can edit the access file (in Zope’s root directory) and overwrite the password — note however that doing so the password is saved in plain text and is visible to anyone with read permission on your Zope directory.

If you are forced to do this, after making sure you can log in to Zope, run the zpasswd.py programme to create your own new encrypted password.

2.4 I want to see my site as www.foo.com, not www.foo.com:8080. How can I change it?

You need to edit the z2.py file, located in Zope’s root directory. The default port specified is 8080. You have to change it to 80. (Under Unix you have to be root and access port 1001.) Then restart Zope, as superuser, and properly set all the permissions on the various directories (log files, database files etc.). If you do not set permissions correctly, Zope will not start.

In my experience with Zope, performance will improve a lot using Apache as a proxy-server, channelling requests to Zope and replies to the user. In this case let Zope use port 8080.

If you use NT, you can simply edit the z2.py file, stop the Zope service and restart it.

2.5 I logged in to Zope, but it would not let me create anything. Why?

The superuser account exists only to create users. You cannot manage and edit a Zope site with the superuser account. Log in as superuser, create a manager account, exit your web browser, then log in using the manager account.

2.6 Where is the log file?

The log file is in ZopeRootFolder/var. For example /home/marco/zope/var/Z2.log.

2.7 How do I get the statistics of my site, a list of referrers, and so on?

You need to get a statistics programme like Analog, which through your log file will produce a nice web page showing all the most curious details about your visitors.

2.8 I used Analog to get statistics from my log file and I do not see any useful information. What did I do wrong?

The Zope log file Z2.log is not very useful. If you use Zope behind Apache, the latter can directly take care of storing log file data — and they are much more useful.

2.9 I know Perl. Do I need to learn Python to use Zope?

Not necessarily. Starting with Zope 2.3.0 you will be able to create Perl methods. In the typical Zope order of things you will create DTML methods, then Python methods if what you want to do cannot be done in DTML, and finally Products if you are doing something very complex. Products must be written in Python. It is unlikely that this will change in the short term.

In Zope 2.2.x you can create DTML methods or Zope Products using Python. Python methods, like Perl methods, are not valid before Zope version 2.3.0.

2.10 I do not know either Perl or Python. Which one should I learn?

Python. It is easier than Perl, Zope is written in Python, and it would also make no sense to learn Perl if you are convinced you want to know Zope thoroughly.

2.11 Which databases can I use with Zope?

On Unix you can use Oracle, PostgreSQL, MySQL, and others such as Sybase and DB2. On Windows you can use databases that support ODBC, including SQL Server.

2.12 Why should I use other databases with Zope? Doesn’t Zope already include a database internally?

Yes, Zope includes an Object Database as a fundamental component (ZODB). But the Zope object database is designed to perform many reads and few writes. This means that if you expect 99% of visitors to read data and 1% to create them, you can perfectly use Zope’s internal database. But if your users are going to do many writes, it will be better to use some other database such as PostgreSQL, MySQL etc.

In that case you can store your scripts, templates etc. inside the Zope database, but you will store the data created by your users in the SQL database.

It is preferable to run such a database on the same machine as Zope. If you access a database on another machine, performance will very often disappoint you. Accessing something in memory is much faster than travelling through a network cable to another machine and back.

2.13 Can I have more than one site on Zope? Can I create virtual hosting as you do with Apache or IIS?

Yes. Using a Zope Product called SiteAccess you can configure Zope to treat foo.com and bar.com as two different web sites. The best way to do this is to do as Zope.org does, using ProxyPass and SiteAccess.

3. Performance

3.1 I want to build a super-fast Zope server. What do I need?

You need a very fast CPU and an Ultra SCSI 160 hard disk. The faster the CPU, the faster Zope will run. A PIII-850 is about twice as fast as a PIII-500 running Zope.

You will probably run out of bandwidth before your PIII-500 “explodes”. A Pentium 100 can easily fill a T1 with traffic. If you expect to work your PIII-850 hard, you will need to colocate your server with companies that provide services like Exodus, Above.net etc. And bandwidth costs can easily make your server’s cost irrelevant after two or three months of your site’s operation.

3.2 I built my super-fast Zope machine. How do I test it to make sure it does not melt when I get linked from Slashdot?

Apache includes a benchmark tool called ab. Run it configured with high load and make sure your server stays up when it is linked on Slashdot.

Need support? Under attack? Service Status
Need support? Under attack? Service Status