- Info
Zope/ZEO installation
Installing and configuring Zope with ZEO.
Choosing a base directory for the installation and directory layout
Now that we have decided to install Zope and Plone from source, we need
to decide where to do so. You should choose an area on the filesystem
that is not used by the OS or its packaging system. Your choice may
also be influenced by the number of disks in your system(s) and their
partitioning and filesystem settings. Common choices might include
/opt/zope, /usr/local/zope, or /home/zope/zope (where /home/zope is
the home directory of the *zope* user). The "Filesystem Hierarchy
Standard (FHS)":http://www.pathname.com/fhs/pub/fhs-2.3.html may be
worth consulting.
For simplicity's sake, this tutorial will install Zope and create Zope
and ZEO instances and Product directories under one base directory,
hereafter referred to as '$BASE'. For ease of management, I
encourage you to replicate the following directory structure via
symlinks if you decide to separate components onto different
filesystems/disks::
$BASE/
client0/
client1/
# etc...
products/
z2.7.3-p2.3.4/
zeo/
zope # symlink to currently used version of zope (here z2.7.3-p2.3.4)
I'll explain more about the reasoning for this layout as the tutorial
progresses.
Step-by-step Installation
The following steps should be performed with your regular user
account, not the account that will eventually run Zope. For security
reasons we want to limit what files and directories the zope user can
access, so that if there is ever any security problem with Zope or
Plone the damage will be as limited as possible.
Get Zope
Download and unpack the Zope sources from http://www.zope.org/Products/
(The recommended version for Plone at the time of this writing is 2.7.3)
Configure, compile and install Zope
Go to the directory that contains the sources and execute the following
commands (assuming your zope version is 2.7.3 and your python version is
2.3.4)::
./configure --prefix=$BASE/z2.7.3-p2.3.4 \
--with-python=/path/to/python
make
make install
cd $BASE
ln -s z2.7.3-p2.3.4 zope
Create a ZEO server and two client instances
Once zope is installed, make sure you are in the $BASE directory and run
the following commands::
/path/to/python zope/bin/mkzeoinstance.py zeo 8100
/path/to/python zope/bin/mkzopeinstance.py --dir=client0
# Follow the prompts to enter the name and password for
# the admin user
/path/to/python zope/bin/mkzopeinstance.py --dir=client1
# Follow the prompts to enter the name and password for
# the admin user
Configure the clients and server
At the bottom of the zope.conf files found in client[0|1]/etc,
comment out the section for zodb_main and uncomment the example
for zeo client storage. After you have made your changes, the
section should look like this[1]::
#
# # Main FileStorage database
#
# path $INSTANCE/var/Data.fs
#
# mount-point /
#
# Temporary storage database (for sessions)
name temporary storage for sessioning
mount-point /temp_folder
container-class Products.TemporaryFolder.TemporaryContainer
# Other storage examples
#
# ZEO client storage:
#
mount-point /
server localhost:8100
storage 1
name zeostorage
var $INSTANCE/var
Change the 'address' directive in the 'http-server' and 'ftp-server'
sections of one of the client zope.conf files so that the clients can
run on separate ports. Set the 'effective-user' for both clients to
'zope'. In zeo/etc/zeo.conf uncomment the 'user zope' line.
Set permissions
Modify filesystem permissions so that the zope user can write
to log/ and var/ directories. From the '$BASE' directory, execute
the following commands::
chgrp zope zeo/var zeo/log client0/var client0/log \
client1/var client1/log
chmod g+w zeo/var zeo/log client0/var client0/log \
client1/var client1/log
Test your installation
Start things up and test with the following commands. You should do
this as either the root user (or via sudo) or the zope user::
zeo/bin/runzeo &
client0/bin/zopectl fg
When you see 'Zope ready to handle requests', visit
http://example.org:8080/ to make sure everything is running
and that client0 can talk to the zeo server. If you see the Zope Quick
Start page, you're ready to move on to the next section.
.. [1] Note that if you are running multiple clients for logged-in users you
will also need to share the 'temporary' storage via ZEO so that sessions can
be visible to all clients. The configuration above is sufficient to follow
along with the rest of this tutorial.