Zope 3.1.0b1是Zope 3第一个正式发布的版本,它取消了X代号,表示Zope 3已逐渐成熟,可用于产品开发。Debian的Sarge版软件包还没有包含Zope 3,所以只能从源码安装。具体的安装步骤如下:
首先,让我们来看一下Zope 3.1.0b1的系统要求。它要求Python 2.3.5或以上版本支持,并要安装有python-dev,该软件包提供编译Python模块所需的静态库、头文件和distutils工具。Debian默认是没有安装该软件包的,用apt-get install python-dev安装即可。如果没有python-dev软件包,在编译Zope 3时会出错,出错信息如下:
error: invalid Python installation: unable to open /usr/lib/python2.3/config/Mak efile (No such file or directory) make: *** [build] 错误 1
我下载的打包源码文件名为Zope-3.1.0b1.tgz,用以下命令安装:
debian:~/inst# tar zxvf Zope-3.1.0b1.tgz debian:~/inst# cd Zope-3.1.0b1 debian:~/inst/Zope-3.1.0b1# ./configure Configuring Zope 3 installation Testing for an acceptable Python interpreter... Python version 2.3.5 found at /usr/bin/python The optimum Python version (2.3.5) was found at /usr/bin/python. debian:~/inst/Zope-3.1.0b1# make /usr/bin/python install.py -q build debian:~/inst/Zope-3.1.0b1# make test #测试会出错,但也可安装 /usr/bin/python install.py -q build /usr/bin/python test.py -v Running UNIT tests at level 1 Running UNIT tests from /root/inst/Zope-3.1.0b1/build/lib.linux-i686-2.3 ............................................................................... debian:~/inst/Zope-3.1.0b1# make install #默认安装到/usr/local/Zope-<version>目录 /usr/bin/python install.py -q build /usr/bin/python install.py -q install --skip-build --home "/usr/local/Zope-3.1.0b1"
安装完成后,就要创建Zope实例。
debian:/usr/local/Zope-3.1.0b1/bin# ./mkzopeinstance Please choose a directory in which you'd like to install Zope 'instance home' files such as database files, configuration files, etc. Directory: /var/lib/zope3.1.0b1 #输入实例的路径 Please choose a username for the initial administrator account. This is required to allow Zope's management interface to be used. Username: admin #创建管理员 Please provide a password for the initial administrator account. Password: #设置管理员密码 Verify password: debian:/usr/local/Zope-3.1.0b1/bin# ./runzope& ------ 2005-06-21T00:29:03 WARNING ZODB.FileStorage Ignoring index for /var/lib/zope3.1.0b1/var/Data.fs ------ 2005-06-21T00:29:03 INFO PublisherHTTPServer zope.server.http (HTTP) started. Hostname: debian Port: 8080 ------ 2005-06-21T00:29:03 INFO PublisherFTPServer zope.server.ftp started. Hostname: debian Port: 8021 ------ 2005-06-21T00:29:03 INFO root Startup time: 17.049 sec real, 16.400 sec CPU
用浏览器访问http://localhost:8080/即可进入Zope 3,用刚才创建实例时设置的用户和密码即可以管理员身份登录ZMI。
Zope 3的安装已完成,Zope 3与Zope 2在设计思路上有很大的不同,我们需花时间熟悉一下Zope 3的管理界面和开发方法。
Zope3.1已发布,从源码编译安装的方法和上面介绍的一样。在Debian的Sid系统中已可用apt-get命令安装Zope3包了,大大简化了安装过程。