Setting up Plone and Zope from source
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 samepythonbinary 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.3to the configure script. - Run
maketo compile the software, andmake install(probably as a superuser) to install it to your selected prefix. An alternative is to create a user especially for Zope, andmake installas 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.pyand 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 runmkzopeinstanceis to first change to another user (e.g.su zope) and then runmkzopeinstance.py. The zope user must have write access to create the directory. After the instance is created, edit "effective-user zope" into theetc/zope.conffile, so if you start it as root later it should su itself to the non-root user. Again:make installshould be run as root,mkzopeinstance.pyshould not. - Edit
~/zope/instance1/etc/zope.confif 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 inzope.conffor 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
runzopeto start it (you can also usezopectl startandzopectl stopto 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 asCMFPloneandCMFCore. 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/manageand log in with the root administrator password you created before. - In the drop-down at the top right next to the
Addbutton, selectPlone siteand clickAdd. The id you give it will be the URL to the instance, so if you give it the nameplone-site, you can access it onhttp://localhost:8080/plone-site. - After it has installed, find the instance in the ZMI, and go to the
portal_quickinstallertool. 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, 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.
