[Zope] Proposed installation changes for review
Chris McDonough
chrism@zope.com
10 Mar 2003 16:41:48 -0500
Hi folks,
An effort to improve Zope 2 installation, startup, and configuration for
Zope 2.7 has been ongoing for some time now (see
http://dev.zope.org/Wikis/DevSite/Proposals/InstallationAndConfiguration).
The effort has reached a point where we believe it is reasonable to
merge its fruits to the Zope trunk. Before doing so, however, we want
to gather input from people who care deeply about Zope configuration and
installation; particularly those who have significant investments in the
existing behaviors of Zope 2 configuration and installation. A bunch of
stuff is changed (most notably Zope no longer uses environment variables
as configuration, and instead defers to command-line arguments and
config file values).
What follows is a summary of changes, a walk-through of a Zope 2
installation under this regime, and a list of the configuration-file
changeable parameters exposed by the current Zope configuration schema.
Please provide your feedback before this Friday, March 14. If possible,
check out and try the new software. If there are showstopper issues for
a lot of people, we will consider not performing the merge directly
after that date. Otherwise, the merge will be performed at any time
after the 14th.
Thanks!
- C
-----
Major changes in Zope 2.7
=========================
Zope 2.7 will contain a number of changes related to the build process
and configuration. The scripts used to start Zope will also be
substantially changed. The implementation of these changes is not yet
complete, but a substantial portion has been done and is expected to
be merged into the Zope 2 trunk in the near future.
The exact schedule for merging these changes has not been determined;
additional notice will be provided. These changes are substantially
based on efforts by Chris McDonough on the "chrism-install-branch".
Major changes
-------------
The following are the most important and user-visible changes compared
to Zope 2.6 and the current CVS HEAD:
- Configuration is normally done by editing a config file instead of
passing command line options. The configuration file is handled by
the ZConfig package.
- Environment variables are no longer used for configuration.
- Building and installing the software have become more clearly
distinct; the installation can be separate from the build.
- Zope 2.7 uses the "instance home" model in the normal case: a script
in the installed software is used to create new "instances" of Zope.
Each instance is defined by a directory tree containing
configuration, scripts, and data. (For convenience, the instance
and the installation can be located in the same directory, and the
build area may be used in lieu of an installation if desired.)
- The z2.py, start, and stop scripts have been replaced by the runzope
and zopectl scripts.
- The runzope/zopectl scripts do not accept the same command-line
arguments as z2.py used to accept.
- The wo_pcgi.py script used to build Zope without PCGI support has
been replaced by the common Unix build sequence of configure, make.
- The pcgi/ directory and the w_pcgi.py script have been removed from
the top of the source tree. The pcgi/ directory may be made
available as a separate distribution. (The application server still
has support to allow connections from a PCGI-capable Web server.)
- The ZServer package has been moved from the top of the source tree
into the lib/python/ directory.
Getting the code today
----------------------
The implementation lives in the "new-install-branch", which is a
"partial" branch rather than a complete branch: only the files and
directories which need to be changed have been placed on the branch;
all other files are used from the CVS HEAD. The current state of this
code can be checked out from CVS using the command:
cvs -d :pserver:anonymous@cvs.zope.org:/cvs-repository co \
-r new-install-branch -f Zope
The installation instructions in doc/INSTALL.txt has been updated on
the branch; that file provides detailed information on creating an
installation and instance. (A copy has been attached for convenience.)
A sample installation/startup runthrough
---------------------------------------
The below is the output from a sample install session. During this
session, we install the Zope software to /tmp/zopehome and install an
instance home to /tmp/insthome.
[chrism@james software]$ cd NewInstallBranch/
[chrism@james NewInstallBranch]$ ./configure --prefix=/tmp/zopehome
Configuring Zope installation
Testing for an acceptable Python interpreter...
Python version 2.1.3 found at /home/chrism/bin/python
Python version 2.1.3 found at /home/chrism/bin/python2.1
Python version 2.2.2 found at /home/chrism/bin/python2.2
The optimimum Python version (2.2.2) was found at
/home/chrism/bin/python2.2.
- Zope top-level binary directory will be /tmp/zopehome.
- Makefile written.
Next, run make.
[chrism@james NewInstallBranch]$ make
"/home/chrism/bin/python2.2" inst/setup.py -q build_ext -i
<... compilation output elided ...>
Zope built. Next, do 'make install' (or 'make instance'
to run a Zope instance directly from the build directory).
[chrism@james NewInstallBranch]$ make install
<... installation output elided ...>
Zope binaries installed successfully.
Now run '/tmp/zopehome/bin/mkzopeinstance'
[chrism@james NewInstallBranch]$ /tmp/zopehome/bin/mkzopeinstance
mkzopeinstance requires exactly one argument
mkzopeinstance: Create a Zope instance home.
usage: mkzopeinstance [options] directory
Options:
-h/--help -- print this help text
-u/--user NAME:PASSWORD -- set the user name and password of the
initial user
[chrism@james NewInstallBranch]$ /tmp/zopehome/bin/mkzopeinstance \
--user=admin:123 /tmp/inst
[chrism@james NewInstallBranch]$ cd /tmp/inst/
[chrism@james inst]$ ls
bin etc Extensions import inituser log Products README.txt var
[chrism@james inst]$ bin/zopectl start
. daemon process started, pid=2947
[chrism@james inst]$ bin/zopectl stop
. daemon process stopped
Changing the configuration via the config file
----------------------------------------------
The Zope configuration file uses the ZConfig API and file format. See
the ZConfig documentation PDF at
http://cvs.zope.org/Packages/ZConfig/doc/zconfig.pdf for more
information.
The default Zope configuration file will live in the instance_home's
/etc directory and will be named 'zope.conf'. The Zope configuration
file allows you to change the following configuration variables:
instance home
client home
debug mode
effective user
production installation (on/off)
locale
number of zserver threads
the python "check interval" (thread switch timing)
zserver read only mode
pid file name
lock file name
structured text header level
publisher profile file (debugging)
cgi environment
dns server (hostname resolving in logfiles)
ip address (for zserver bindings)
http realm
automatic quotation of dtml request data
security manager stack size
security policy implementation (C, Python)
skip authentication checking
skip ownership checking
max number of session objects
session "add notify" script path
session "delete notify" script path
session timeout minutes
access rule suppress
site root suppression
database quota size
read only database
zeo client name
logging (access, event, debug, filenames, to syslog, etc).
network servers (http, dav, ftp, monitor, etc)
databases (storages, database classes, etc.)