Attention

This document was written for an unsupported version of Plone, Plone 2.5.x, and was last updated 208 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Setting up Plone and Zope from source

by Martin Aspeli last modified Oct 29, 2012 06:45 AM
This howto shows you how to get up and running as quickly possible with Zope and Plone installed from source. It presumes a UNIX-like environment, but the techniques may be useful on Windows as well.

There are various installers for Plone, both from plone.org and in packages in various operating system distribution. However, these packages frequently poorly configure Zope or give you reduced control over the installation.

If you wish to set up Zope for a robust, production environment, this tutorial goes into a lot more depth, and covers features such as ZEO, configuring Zope behind Apache, and scalability. This how-to is intended as a quick reference for getting a Zope instance with Plone up and running for testing and development purposes.

Software you will need

You should check the required versions of Zope and Plone for your version. See this FAQ.

  • You need Python, from python.org if you don't have it installed already. Probably you do, though Zope works best with Python 2.3.5 (for Zope 2.8 and below) and Python 2.4.3 (for Zope 2.9 and later) at the time of writing. Always check the specific requirements of the version you are trying to install.
  • You need the Python Imaging Library (PIL). Download it from here and follow its installation instructions. Briefly, you want to extract it and then run python setup.py install, making sure to use the same python binary that you will use for installing and starting Zope.
  • You must download the latest stable Zope source tarball that is compatible with your version of Plone, from zope.org. Note that Plone uses the 2.x series of Zope. The 3.x series is rather a different beast! For Plone 2.1, Zope 2.8 is recommended. For Plone 2.5, Zope 2.9 is recommended.
  • You must also get the Plone tarball, from plone.org.
  • Finally, you will want to have the DocFinderTab, which gives you a "Doc" tab in the ZMI with which you can see what methods are available on any Zope object --- an invaluable tool.

Setting up the software

First off, you must set up Zope. I am going to assume you have Python installed already. If you don't, get the tarball from python.org, and configure and compile it (see the instructions which come with the download). For the purposes of this document, Zope will be installed in /usr/local/zope, though you can use any prefix you wish.

  • Extract the tarball, and run ./configure --prefix="/usr/local/zope". If you need to use a custom version of Python, for example because you have Python 2.4 installed on the system, but want to use 2.3 which is installed with its executable in /usr/local/bin/python2.3, say, then pass --with-python=/usr/local/bin/python2.3 to the configure script.
  • Run make to compile the software, and make install (probably as a superuser) to install it to your selected prefix. An alternative is to create a user especially for Zope, and make install as that user, to somewhere where they have rights.

We now have the the Zope server binary installed. We are going to create a Zope instance into which you can install Plone. Each instance has its own configuration file, products folder, and service you can use to start it. We will install this instance into ~/zope/instance1, so that you can develop on it in your home directory, but it can be installed anywhere.

  • Run /usr/local/zope/bin/mkzopeinstance.py and answer its questions. You must set a path for installation, such as /home/myusername/zope/instance1, and the username and password of the Zope root administrator user. Watch out: If you are running everything as root, you will get an instance that cannot be started, because a different effective user id is required for it to change to. Even if you create an account after the fact, that user cannot start zope because it doesn't have access to any of the instance files. The best way to run mkzopeinstance is to first change to another user (e.g. su zope) and then run mkzopeinstance.py. The zope user must have write access to create the directory. After the instance is created, edit "effective-user zope" into the etc/zope.conf file, so if you start it as root later it should su itself to the non-root user. Again: make install should be run as root, mkzopeinstance.py should not.
  • Edit ~/zope/instance1/etc/zope.conf if you wish. By default, Zope runs on port 8080, but you can change this to any port (above 1024 unless you plan to run Zope as root, which is a bad idea --- if you want it on port 80 as the default web server, you should see the robust installation tutorial instead). See the comments in zope.conf for explanations of the various options.

Now you have a fully working Zope instance, which you can start by running ~/zope/instance1/bin/runzope. Once loaded, this will make Zope accessible on http://localhost:8080 (unless you changed the port), with the Zope Management Interface available on http://localhost:8080/manage. Now all we need to do is install Plone, Archetypes and the DocFinderTab.

  • Shut down Zope if it is already running, by pressing Ctrl+C if you used runzope to start it (you can also use zopectl start and zopectl stop to start and stop your Zope instance, but this will not print out as much debug information to your terminal, which you probably want to start with).
  • Extract the Plone tarball. This will give you a folder called Plone-2.1 (presuming you have version 2.1), in which you will see a number of products folders, such as CMFPlone and CMFCore. Copy all these product folders (not the top-level Plone-[version] folder) into ~/zope/instance1/Products/.
  • Extract the DocFinderTab tarball and put its product folder in ~/zope/instance1/Products.

Adding a Plone Instance

Now, you can start Zope again with ~/zope/instance1/bin/runzope. All you need to do to get Plone up and running is to add a Plone site instance to your Zope instance.

  • Once Zope has loaded, go to http://localhost:8080/manage and log in with the root administrator password you created before.
  • In the drop-down at the top right next to the Add button, select Plone site and click Add. The id you give it will be the URL to the instance, so if you give it the name plone-site, you can access it on http://localhost:8080/plone-site.
  • After it has installed, find the instance in the ZMI, and go to the portal_quickinstaller tool. Here, install Archetypes, MimetypeRegistry and PortalTransforms by ticking the boxes next to them and clicking Install. (DocFinderTab does not need this extra installation step)

That's it! You now have a cleanly configured Zope instance, with a single Plone site set up inside it, a recent release of Archetypes and the DocFinderTab. You can install new add-on products in the same way --- put them in the Products folder, restart Zope, loansforpeoplewithbadcredithistoryfast.co.uk and install via portal_quickinstaller. For an overview of many products available for Plone, see the Products section

If you ever want to get rid of a Zope instance, just delete it! Zope is totally self-contained, so you can just delete the folder you installed it into when you did make install, as well as any instances you may have created with mkzopeinstance.py.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.