A deployment configuration
Finally, let's take a look at a more advanced configuration, better suited for deployment. Save this file as deployment.cfg, at the root of the buildout next to the main buildout.cfg file:
[buildout]
extends =
buildout.cfg
parts =
plone
zope2
productdistros
deploymentproducts
zeoserver
primary
secondary
varnish-build
varnish-instance
[deploymentproducts]
recipe = plone.recipe.distros
urls =
http://plone.org/products/cachefu/releases/1.1/CacheFu-1.1.tgz
nested-packages =
CacheFu-1.1.tgz
version-suffix-packages =
[zeoserver]
recipe = plone.recipe.zope2zeoserver
zope2-location = ${zope2:location}
zeo-address = 8100
[primary]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
zeo-client = true
zeo-address = 8100
zodb-cache-size = 5000
zeo-client-cache-size = 300MB
user = admin:admin
http-address = 8080
debug-mode = off
verbose-security = off
eggs =
${plone:eggs}
${buildout:eggs}
zcml =
products =
${buildout:directory}/products
${productdistros:location}
${deploymentproducts:location}
${plone:products}
[secondary]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
zeo-client = true
zeo-address = 8100
zodb-cache-size = 5000
zeo-client-cache-size = 300MB
user = ${primary:user}
http-address = 8081
debug-mode = on
verbose-security = on
eggs = ${primary:eggs}
zcml = ${primary:zcml}
products = ${primary:products}
zope-conf-additional =
zserver-threads 1
[varnish-build]
recipe = plone.recipe.varnish:build
url = http://puzzle.dl.sourceforge.net/sourceforge/varnish/varnish-1.0.4.tar.gz
[varnish-instance]
recipe = plone.recipe.varnish:instance
bind = 127.0.0.1:8082
backends = 127.0.0.1:8080
cache-size = 1G
Here, we are:
- Referencing the main buildout.cfg file, extending and overriding it with configuration more appropriate for deployment.
- Setting up a ZEO server with two client instances, primary and secondary (see plone.recipe.zope2zeoserver and plone.recipe.zope2instance for more details)
- Compiling the Varnish cache server (see plone.recipe.varnish for more details).
By combining buildout configuration files like this, you can create tailor-made configurations for different deployment scenarios. To learn more about the advanced features of buildout, see its documentation.
To build this environment, you must explicitly specify a configuration file:
$ ./bin/buildout -c deployment.cfg
To start Zope and Plone, you will need to start the ZEO server, the two clients (or at least, the primary one), and the Varnish server:
$ ./bin/zeoserver start $ ./bin/primary start $ ./bin/secondary start $ ./bin/varnish-instance
The recipes will also create scripts to back up the ZODB (in ./bin/repozo) and to pack the database (in ./bin/zeopack).
Further options
zc.buildout is a very flexible system. It is relatively easy to create new recipes, and you can combine existing recipes in powerful ways. Search the Cheese Shop for "buildout" to find more recipes, or take a look at the source code for some of Plone's own recipes to understand how recipes are created.
On purpose :)
No Varnish for Windows
Presumably commenting out the part names (#) from [buildout] should do the trick.
Debug Mode is enabled