6. What's left in zope.conf?#

What's possible in zope.conf when using the WSGIPublisher is defined in wsgischema.xml in the Zope package. It is a subset of what is possible in zope.conf with ZServer. The schema file for the latter can be found in the ZServer package.

Let's look at a zope.conf generated by plone.recipe.zope2instance:

%define INSTANCEHOME /home/thomas/devel/plone/minimal52/parts/instance
instancehome $INSTANCEHOME
%define CLIENTHOME /home/thomas/devel/plone/minimal52/var/instance
clienthome $CLIENTHOME
debug-mode off
security-policy-implementation C
verbose-security off
default-zpublisher-encoding utf-8
<environment>
    CHAMELEON_CACHE /home/thomas/devel/plone/minimal52/var/cache
</environment>
<zodb_db main>
    # Main database
    cache-size 30000
    # Blob-enabled FileStorage database
    <blobstorage>
      blob-dir /home/thomas/devel/plone/minimal52/var/blobstorage
      # FileStorage database
      <filestorage>
        path /home/thomas/devel/plone/minimal52/var/filestorage/Data.fs
      </filestorage>
    </blobstorage>
    mount-point /
</zodb_db>
<zodb_db temporary>
    # Temporary storage database (for sessions)
    <temporarystorage>
      name temporary storage for sessioning
    </temporarystorage>
    mount-point /temp_folder
    container-class Products.TemporaryFolder.TemporaryContainer
</zodb_db>
python-check-interval 1000
  • database configuration

  • instancehome, clienthome, environment

  • debug-mode on|off

  • security-policy-implementation C

  • verbose-security off

  • default-zpublisher-encoding utf-8

  • python-check-interval

  • pid-filename

6.1. Exercises#

6.1.1. Exercise 1#

Let's say you temporarily want Plone to listen on port 9080 instead of the default 8080. How could you do this without changing the buildout configuration?

Solution

The http server address would be the address Waitress is listening on configured in parts/instance/etc/wsgi.ini. Change the line starting with listen in the first section of the file:

[server:main]
paste.server_factory = plone.recipe.zope2instance:main
use = egg:plone.recipe.zope2instance#main
listen = 0.0.0.0:8080
threads = 4

6.1.2. Exercise 2#

Same task as in exercise 1. If instead you add an http-server section to parts/instance/etc/zope.conf:

</environment>
<http-server>
  address 9080
</http-server>
<zodb_db main>

What do you expect to happen when executing bin/instance fg?

Solution

You will see an error because http-server is not known from Zope's wsgischema.xml:

Error: unknown type name: 'http-server'
(line 12 in file:///home/thomas/devel/plone/minimal52/parts/instance/etc/zope.conf)
For help, use bin/instance -h