Setup Zope2 on Debian Squeeze

Aus MvOWiki
Zur Navigation springen Zur Suche springen

Prerequisites

The following Packages from Debian are needed.

 sudo apt-get install gcc python2.6 python2.6-dev python-virtualenv

Create Environment

First create an user, the base directory and create the virtual Python Installation.

 sudo addgroup --system zope2
 sudo adduser --system --disabled-login --home=/var/local/zope2 --ingroup=zope2 zope2

The home directory /usr/local/zope2 should exist now with correct access rights. So we could login as the newly created user.

 sudo su - zope2
 virtualenv -p python2.6 --no-site-packages zope2.13
 cd zope2.13
 bin/easy_install-2.6 -i http://download.zope.org/Zope2/index/2.13.2 Zope2

Install Zope

Then create a new Zope instance. When prompted for a folder, don't specify the same as above. For instance use /var/local/zope2/instances.

 cd /var/local/zope2/zope2.13
 bin/mkzopeinstance

Now check the configuration in /var/local/zope2/instances/<instance_name>/etc/zope.conf. You can test now the basic installation by executing

 /var/local/zope2/instances/<instance_name>/bin/zopectl fg

Check if the server comes up correctly.

Install MySQL

First install some more prerequisites from Debian.

 sudo apt-get install mysql-client libmysqlclient-dev

Then install the packages, changing version numbers as necessary.

 sudo su - zope2
 cd zope2.13
 bin/easy_install-2.6 http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.3.tar.gz
 bin/easy_install-2.6 Products.ZSQLMethods
 bin/easy_install-2.6 Products.ZMySQLDA

Other packages

Now other packages could be installed too

 bin/easy_install-2.6 Products.ExternalEditor

Start the server

As normal user you could start Zope as follows:

 sudo su - zope2 /var/local/zope2/instances/<instance_name>/bin/zopectl start

Update Product packages

After last MySQL package upgrade the database adpater did not work anymore.

 ImportError: libmysqlclient_r.so.16: Kann die Shared-Object-Datei nicht Öffnen: Datei oder Verzeichnis nicht gefunden

Reexecuting of the Product installation command solved this issue.

 bin/easy_install-2.6 http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.3.tar.gz