This buildout comes with all the pieces necessary to deploy Plone to a production environment:
Apache (8000) (HTTP proxy)
|
v
Varnish (6081) (Caching proxy)
|
v
HAProxy (9090) (Load balancer)
/ \
v v
Zope 1 & 2 (8081/8082)
\ /
v
Zeo (8001)
This zopeskel package will create a buildout file with which you can then customize or go straight to running. After running the zopeskel script, you need to bootstrap the buildout with the correct version of python (2.4 for plone 3, 2.6 for plone 4) and then run the buildout until you can start controlling processes. The script will give you the exact commands to run for your instance.
All services are controlled using the supervisord process manager. Supervisord takes care of starting all daemons, restarting them when needed and can optionally provide a web interface allowing for easy remote management.
To start supervisord starts its daemon bin/supervisord. This will automatically start the ZEO server, Zope and, if enabled, Varnish. You start, stop and restart those via the bin/supervisorctl utility. Because of permissions on port 80 and apache, you will probably have to start supervisor as root or with the sudo command. If Apache does not start correctly, this is probably the case.
To start all processes automatically on system boot it is necessary to start supervisord as part of the system boot process. This can easily be done by adding a crontab entry to the account used for your site:
# Automatically start the plone.org website
@reboot /srv/plone.org/bin/supervisord -c /srv/plone.org/etc/supervisord.conf
A backup script is automatically generated for you in your bin directory. To run it:
> ./bin/backup
You probably want to add an entry in your crontab to have this run anywhere from once a day to every hour, depending on the size of your site.
Similar to running a backup, you can pack the database with a bin script that has automatically been generated for you. While your zeo instance id up and running:
> ./bin/zeopack
You should also add this to your crontab, and run it at least once a week during a window of less user activity.
This buildout includes a configuration for logrotate, which is included in all common Linux distributions. To setup log rotation you will need to add an entry to the crontab entry for the account user for your site:
# Rotate plone.org logfiles at 06:00
0 6 * * * /usr/sbin/logrotate --state /srv/plone.org/var/logrotate.status /srv/plone.org/etc/logrotate.conf
For production environment it is generally a good idea to enforce use of specific, tested, versions of all packages and products. This can prevent unexpected surprises when updating a buildout environment or deploying it on another machine.
For Zope2 products it is recommended to use a release tar or zip-archive. This can be installed using the productdistros section in buildout.cfg. See plone.recipe.distros for more information.
Packages can be pinned down in the versions section, also located in buildout.cfg.