Zope on FreeBSD
Installing Zope
Zope is available in the ports tree. Installing it as any other FreeBSD port. By default it will be installed in /usr/local/www/Zope
Python Options
Before build of python 2.3, select the option for HUGE_STACK_SIZE.
Creating a Zope instance
Zope instances are an instance of the Zope application server. You can in fact run multiple Zope instances (essentially multiple Zope servers with different environment settings and databases), anywhere on the server.
You will need to create at least one. iF ZOPEINSTANCE is defined when building the zope part it will create one automatically during installation.
In this example, we will go through the steps of creating one, let's call it "instance-first".
/usr/local/www/Zope/bin/mkzopeinstance.py
When asked for which directory it will installed on, set it to /usr/local/www/Zope
Answer the questions to create your admin account.
Set correct permissions
On FreeBSD Zope is installed as user www, chown -R www for instance-first/log and instance-first/var as these directories will need to be written to by the Zope instance
Configuring instance
Instance settings are configured in zope.conf in your instance directory.
Effective User
Effective user should be set as www
Products Directory
Products are the applications and utilities used by Zope. Plone CMS examples several Zope products one of which is the core product CMFPlone. On FreeBSD products are installed by default into the /usr/local/www/Zope/Products directory.
For this example we will define the products directory to the default.
HTTP port
For use in a simple intranet we can define this as 80, if no other http servers such as Apache are not configured. In this article we will use 8080.
FTP
Zope has an FTP server built-in. To enable this you can set it as 8021.
WebDav
Zope also has WebDav server built-in. To enable this uncomment and set it to a port.
rc.conf startup script
You then want to start up your server with familiar FreeBSD startup scripts. You need to put this in /etc/rc.conf.local
zope_enable="YES"
zope_instances="/usr/local/www/Zope/instance-first"
You can now start up Zope by issuing the command :
/usr/local/etc/rc.d/zope start
Zope should now be listening on ports 8080, 8021 and 9800
You can trouble shoot by checking the log files in your instance directory.
You should now be able to access your new Zope instance at http://localhost:8080 and the ZMI at http://localhost:8080/manage
Installing Zope Products for Zope
Installing additional Products is as simple as doing extracting archives of downloaded products into the Products directory and reading the README to check of additional dependencies.
Installing from ports
If you have configured our instance to use the default Products directory, you can now use FreeBSD ports to install a variety of products for Zope. Plone a powerful CMS is probably the reason most people are installing Zope. It's available in ports under www/plone.
It's best to stick to the default Plone product, unless you want to run it with a version from ports instead.
After installation, simply restart your Zope instance either from the ZMI or from the rc startup script.
From the ZMI you can now add your Plone site.
Production Servers
Increasing per process limits
FreeBSD has a default per process limit of 512MB. Zope is quite memory intensive and can sometimes use more than this limit, at which time it will crash. To increase this limit, you need to recompile the kernel.
Add the following options and modify values as required to your kernel configuration file, build a new kernel and reboot.
# Certain applications can grow to be larger than the 512M limit
# that FreeBSD initially imposes. Below are some options to
# allow that limit to grow to 1GB, and can be increased further
# with changing the parameters. MAXDSIZ is the maximum that the
# limit can be set to, and the DFLDSIZ is the default value for
# the limit. MAXSSIZ is the maximum that the stack limit can be
# set to. You might want to set the default lower than the max,
# and explicitly set the maximum with a shell command for processes
# that regularly exceed the limit like INND.
#
options MAXDSIZ=(1024UL*1024*1024)
options MAXSSIZ=(128UL*1024*1024)
options DFLDSIZ=(1024UL*1024*1024)
FIXME -> cite original post to freebsd-python
Apache and Virtual Hosting
On production servers you would probably want to have Apache on the front end.
FIXME -> link to apache/virtual hosting article
SMP and ZEO
Due to Python's locking, Zope does not make efficient use of multiple processors. It's best to run a ZEO instance for each additional CPU.
FIXME -> link to ZEO article
Contributing
There is a large amount of Zope products available, and ports of Products would be good to have to make it easier for FreeBSD users to maintain their Zope sites as well as find useful Zope products a port install away.
- freebsd-python
Is a mailing list to discuss and ask questions related to python and Zope related issues on FreeBSD.



