Setting up Plone and Zope from source
This How-to applies to:
Plone 2.5.x, Plone 2.1.x
This How-to is intended for:
Server Administrators
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-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.
Plone on Ubuntu / small upgrades
first of all a big thank you for your tutorial. I use Ubuntu 6.06 which might equal Debian Sarge in case of installing
zope and plone. Even though i encountered some problems which - how i found out later - were caused by wrong syntax in some
of your line. This is why i would like to post your setup-example with my slight corrections and additional comments.
Mainly – was substituted by -- and ” by ". I also skipped some " and /
*******
$ sudo apt-get install python2.4-dev python2.4-libxml2 build-essential
$ wget http://www.zope.org/Products/Zope/2.9.5/Zope-2.9.5-final.tgz
$ tar xfvz Zope-2.9.5-final.tgz
$ cd Zope-2.9.5-final
$ ./configure --with-python=/usr/bin/python2.4 --prefix=/usr/local/zope
$ make
$ sudo make install
$ sudo mkdir -p /var/lib/zope/instance
$ sudo /usr/local/zope/bin/mkzopeinstance.py --dir=/var/lib/zope/instance/instance1 --user="admin:password"
Please substitute password with a apropiate password like "Wtf34&"
Now we can now fire up Zope:
$ sudo /var/lib/zope/instance/instance1/bin/runzope
Open your browser and type in the address-bar: http://localhost:8080/manage
and login:
You will be asked for username: admin
and your password: Wtf34&
I hope it worked for you!
Now edit /var/lib/zope/instance/instance1/etc/zope.conf and change effective-user to www-data (maybe a bad idea, I dunno)
$ sudo chown -R www-data /var/lib/zope
Our next stepp is to install Plone:
wget http://superb-west.dl.sourceforge.net/sourceforge/plone/Plone-2.5.1-final.tar.gz
tar -xzvf Plone-2.5.1-final.tar.gz
cd Plone-2.5.1
sudo mv * /var/lib/zope/instance/instance1/Products/
sudo chown -R www-data /var/lib/zope/instance/instance1/Products
For additional Documents we want to get the following packages:
$ wget http://www.zope.org/Members/shh/DocFinderTab/1.0.2/DocFinderTab-1.0.2.tar.gz
$ tar xfvz DocFinderTab-1.0.2.tar.gz
$ sudo mv DocFinderTab /var/lib/zope/instance/instance1/Products/
$ sudo chown -R www-data /var/lib/zope/instance/instance1/Products/DocFinderTab
Congratulation! You now got a fully equiped Zope-Plone CMF-CMS.
Date of creation: 25.11.2006
/lprofil
Start / Stop Zope
How do i start and stop Plone from the command-line?
Well, this is quiet easy. You start it as root with:
$ /var/lib/zope/instance/instance1/bin/zopectl start
otherwise as user:
$ sudo /var/lib/zope/instance/instance1/bin/zopectl start
To shut zope down use:
$ /var/lib/zope/instance/instance1/bin/zopectl stop
If you use "zopectl fg" instead of "zopectl start" it will start the zope instance on foreground,
similar to:
$ /var/lib/zope/instance/instance1/bin/runzope
Date of creation: 25.11.2006
/lprofil
Plone 2.5.1 on Debian Sarge
sudo apt-get install python2.4-dev python2.4-libxml2 build-essential
$ wget http://www.zope.org/Products/Zope/2.9.5/Zope-2.9.5-final.tgz
$ cd Zope-2.9.5-final
$ ./configure –with-python=”/usr/bin/python2.4” –prefix=”/usr/local/zope”
$ make
$ sudo make install
$ sudo mkdir -p /var/lib/zope/instance
$ sudo /usr/local/zope/bin/mkzopeinstance.py –dir=/var/lib/zope/instance/instance1 –user=”admin:password”
Now edit /var/lib/zope/instance/instance1/etc/zope.conf and change effective-user to www-data (maybe a bad idea, I dunno)
$ sudo chown -R www-data /var/lib/zope
test it works with: sudo /var/lib/zope/instance/instance1/bin/runzope
Install Plone:
wget http://superb-west.dl.sourceforge.net/sourceforge/plone/Plone-2.5.1-final.tar.gz
tar -xzvf Plone-2.5.1-final.tar.gz
cd Plone-2.5.1-final
sudo mv * /var/lib/zope/instance/instance1/Products/
sudo chown -R www-data /var/lib/zope/instance/instance1/Products
Install DocFinder:
$ wget http://www.zope.org/Members/shh/DocFinderTab/1.0.1/DocFinderTab-1.0.1.tar.gz
$ sudo mv DocFinderTab /var/lib/zope/instance/instance1/Products/
$ sudo chown -R www-data /var/lib/zope/instance/instance1/Products/DocFinderTab