Zope 2.7 requires Python 2.3.2 or better to run. All the features of Python 2.3.X are supported within Zope, except Zope 2.7 lacks the ability to persist instances created from new-style classes to the ZODB. This will be a prominent feature of Zope 2.8.
Older versions of Zope were installed from source by invoking "python wo_pcgi.py". This would set up a SOFTWARE_HOME-driven installation inside the source tree itself.
Zope 2.7+ is installed from source in a more UNIX-y manner:
tar xvzf Zope-2.7.X.tgz
cd Zope-2.7.X
./configure
make
make install
The default installation location for the ZOPE_HOME is /opt/Zope27.
This can be overridden by passing configure a --prefix option
(e.g. "--prefix=/home/chrism/opt/Zope27").
The "configure" command can also be run from within a separate build directory to preserve a "pristine" source tree, ala:
tar xvzf Zope-2.7.X.tgz
mkdir zopebuild
cd zopebuild
../..Zope-2.7.X/configure
make; make install
The configure script accepts a number of
options:
configure [--help] [--quiet] [--with-python=path] [--prefix=path]
[--build-base=path] [--ignore-largefile] [--ignore-zlib]
[--optimize]
Creates a Makefile suitable for building and installing Zope
Options:
--help shows usage and quits
--quiet suppress nonessential output
--with-python specify a path to a Python interpreter to use
--prefix specify an installation path for binary data
--build-base specify a temporary path for build files
--ignore-largefile ignore large file support warnings
--ignore-expat ignore warnings about expat/pyexpat
--ignore-zlib ignore warnings about zlib
--optimize optimize compiled Python bytecode
--no-compile Dont compile Python bytecode
Given no options, configure will search your PATH for a suitable
Python interpreter and will use '/opt/Zope-2.7' as a prefix.
As usual, a binary executable installer is supplied for Windows 2K/XP/NT/9X by Zope Corporation. The Windows binary setup now uses Innosetup (as opposed to the WISE installer), and now supports Windows services on a per-INSTANCE_HOME-basis on Windows NT/XP/2K. Zope binaries will no longer be shipped by Zope Corporation for Linux or Solaris: although 3rd parties may provide binary packages (RPM, deb, pkg, et. al.). The source installation is the ZC-recommended installation method for all UNIX versions.
A script named "mkzopeinstance.py" can now be run after "make install" to create an INSTANCE_HOME for your Zope, allowing you to run more than one Zope instance against one Zope SOFTWARE_HOME. This is now the recommended way to configure Zope. An example of an invocation of this script is as follows:
athlon:~/software/27Branch$ bin/mkzopeinstance.py
Please choose a directory in which you'd like to install
Zope "instance home" files such as database files, configuration
files, etc.
Directory: ~/tmp/inst
Please choose a username and password for the initial user.
These will be the credentials you use to initially manage
your new Zope instance.
Username: admin
Password:
Verify password:
athlon:~/software/27Branch$ cd ~/tmp/inst/
athlon:~/tmp/inst$ ls
bin etc Extensions import inituser log Products README.txt var
Zope 2.6 and prior were configured with a combination of environment variables and command-line options to the Zope "start" or "z2.py" scripts. Zope 2.7's configuration options are managed via a configuration file instead (environment variables are not respected). Once you've created an instance home, you can edit the configuration file in $INSTANCE_HOME/etc/zope.conf. It contains explanatory text for each configurable option.
Most config file directives are straight mappings from their command-line-option or environment-variable counterparts from Zope 2.6. However, there are new features in Zope 2.7 which were not in prior versions that you can control via the configuration file.
ZEO is now included with Zope 2.7. To make use of it, use the "mkzeoinstance.py" script in Zope's "bin" directory:
athlon:~/software/27Branch$ bin/mkzeoinstance.py
Usage: mkzeoinstance.py home [port]
athlon:~/software/27Branch$ bin/mkzeoinstance.py /tmp/zeo 9999
Created directory /tmp/zeo
Created directory /tmp/zeo/etc
Created directory /tmp/zeo/var
Created directory /tmp/zeo/log
Created directory /tmp/zeo/bin
Wrote file /tmp/zeo/etc/zeo.conf
Wrote file /tmp/zeo/bin/zeoctl
Changed mode for /tmp/zeo/bin/zeoctl to 755
Wrote file /tmp/zeo/bin/runzeo
Changed mode for /tmp/zeo/bin/runzeo to 755
athlon:~/software/27Branch$
By doing so, you've created a ZEO server home. You can run your ZEO server by invoking "$ZEO_HOME/bin/zeoctl start" and changing your Zope config file to point the main database at the ZEO server. This only works under UNIX at the moment.
DBTab was an add-on product by Shane Hathaway for Zope 2.6 that allowed you to configure "mounted" databases in Zope. "Mounted" databases are separate ZODB databases that appear in the ZMI as normal folders, though they store their data in a completely different ZODB database.
Zope 2.7 incorporates DBTab, but replaces DBTab's Windows-ini-style configuration file with directives in the main zope configuration file.
An example of using a filestorage as the "main" database via the configuration file:
<zodb_db main>
# Main FileStorage database
mount-point /
<filestorage>
path $INSTANCE/var/Data.fs
</filestorage>
</zodb_db>
An example of using a MappingStorage as a "mounted" database via the configuration file. Note the "mount-point" argument, which specifies the path at which the mounted database should appear inside the "main" database:
<zodb_db amappingstorage>
# Main FileStorage database
mount-point /afolder
<mappingstorage>
name mystorage
</mappingstorage>
</zodb_db>
An example of using a ZEO ClientStorage as a "mounted" database via the configuration file:
<zodb_db main>
mount-point /zeomount
<zeoclient>
server localhost:8100
storage 1
name zeostorage
var $INSTANCE/var
</zeoclient>
</zodb_db>
Any number of mounted databases may be configured within the Zope
configuration file. At least one zodb_db directive must exist in
the configuration file which specifies the "main" Zope database at
mount-point "/". All other zodb_db definitions are optional.
Logging configuration is enhanced in Zope 2.7+. Owing to Python 2.3's "logging" package, you can specify multiple simultaneous "log handlers" for each of Zope's three main logs (the eventlog, the access log and the trace log). This means, for instance, that you can send the event log to both STDOUT and a file, the access log to a file, and the trace log to syslog by changing the configuration file like so:
<eventlog>
level all
<logfile>
path $INSTANCE/log/event.log
level info
</logfile>
<logfile>
path STDOUT
</logfile>
</eventlog>
<logger access>
level WARN
<logfile>
path $INSTANCE/log/Z2.log
</logfile>
</logger>
<logger trace>
level WARN
<syslog-handler>
host localhost
port 514
</syslog-handler>
</logger>
Additional log handlers besides file-based and syslog-based include win32-eventlog, http-handler (POST), and email-notifier. See the zope.conf file for more info and other twiddleable logging options.
Zope 2.6 and prior were typically started via a "start" script that was written in the course of the execution of "wo_pcgi.py". Zope 2.7+ doesn't write a "start" script, but can be run in two ways on UNIX:
The "zopectl" script is also interactive and provides other useful features. Invoking the zopectl script without options provides an interactive command-line shell:
athlon:~/software/27Branch$ bin/zopectl
program: /home/chrism/software/27Branch/bin/runzope
daemon manager not running
zopectl> ?
Documented commands (type help <topic>):
========================================
EOF fg kill quit run start wait
adduser foreground logreopen reload shell status
debug help logtail restart show stop
zopectl> start
daemon process started, pid=24338
zopectl> logtail
------
2003-12-21T17:50:49 INFO(0) Zope Ready to handle requests
------
2003-12-21T17:50:51 INFO(0) Z2 Caught signal SIGINT
------
2003-12-21T17:50:51 INFO(0) Z2 Shutting down
------
2003-12-21T21:49:04 INFO(0) Zope Ready to handle requests
"zopectl" can also be used to add a user with the "Manager" role to Zope's ZODB database:
zopectl adduser ausername apassword
"zopectl debug" allows you to interactvely inspect the ZODB:
athlon:~/software/27Branch$ bin/zopectl debug
Starting debugger (the name "app" is bound to the top-level Zope object)
>>> app.objectIds()
['acl_users', 'Control_Panel', 'temp_folder', 'session_data_manager',
'browser_id_manager', 'error_log', 'standard_html_header',
'standard_template.pt', 'standard_error_message', 'index_html',
'standard_html_footer']
>>>
"zopectl run" allows you to run a Python script against your Zope instance with the name "app" bound to the top-level Zope object. For instance, the script named "obids.py" with the following content:
print app.objectIds()
..can be run like so:
athlon:~/software/27Branch$ bin/zopectl run obids.py
['acl_users', 'Control_Panel', 'temp_folder', 'session_data_manager',
'browser_id_manager', 'error_log', 'standard_html_header',
'standard_template.pt', 'standard_error_message', 'index_html',
'standard_html_footer']
On Windows, a runzope.bat script is provided that performs the same duties as the "runzope" script under UNIX. Daemonizing is provided by the Windows service manager under Windows NT/2K/XP. The other features of zopectl are not supported under Windows at this time.
Zope 2.6's "effective user" support (support for dropping privileges to another user when Zope was started as the root user) was essentially broken. Zope 2.7 does only as much is as necessary as the root user (binding to "low" ports, essentially) and then writes its logfiles and database files and so on as the less privileged user. The effective user (and group) may be changed via the Zope configuration file.
The Zope interactive tutorial has been updated to use ZPT instead of DTML in its examples.
The Examples folder must be imported explicitly now. The QuickStart page (the main page that shows up when you visit Zope in a browser for the first time, sans "manage") contains instructions on how to import the examples.
Andreas Jung has provided a Zope interface to the reStructuredText package.
The name "context" can now be used as a synonym for "here" in page templates. This brings ZPT and PythonScripts into parity as to how they refer to their current context.
A new built-in meta_type, "OrderedFolder" is in the core. This type provides a folder class which presents a UI which allows people to reorder its contents.
If you're a developer who has written a script to inspect or change Zope's ZODB using the "import Zope; app = Zope.app()", you will need to amend these scripts to perform an additional step. Namely, before you can call "app = Zope.app()", you need to let Zope know which configuration it should use by calling the "Zope.configure" function with a config file name:
import Zope
Zope.configure('/path/to/zope.conf')
app = Zope.app()
Replies to this comment