Return to FunctionalMedia home page | cocoon tips

This will be a quick overview of installing zope2.7 and plone 2.0 in a linux environment.


The docs for this process are scattered all over the zope.org and plone.org site. They are frequently out of date or difficult to find. As usual the real expertise lies on the mailing lists. If you have time subscribe to the lists and grab what nuggets of information pass by. Also search the list archives for answers to your questions. I understand the best book is "The Zope Biible". I do not have a copy but I have found the other books to be only somewhat useful. The "Book of Zope" and "The Zope Book" for example seem to be a little out of date. Neither book covers Zope Page Templates (ZPT) or Plone in any worthwhile depth. Try "The Zope Bible" or wait for the Plone book. Or you could always dive in and try and sort things out for yourself.


For those of you have chosen to try and figure things out for yourself I hope that this overview of what I have learned as I worked with Zope/Plone will be of use to you. 


Zope is complicated, add Plone and the "Content Management Framework(CMF) on top of that and you can really find yourself overwhelmed. I have close to a decade of advanced web development experience and still found myself scratching my head at the "ways of Zope".  I even wondered at times if there was any logic to the "ways of Zope" A nice slick front end is your reward if you can sort out the backside logic and methods.  After a month of playing with Zope and Plone rather intensely the mysteries are starting to fade and the strengths are beginning to show. Still you may want to look into Drupal, PHPNUke Midgard, Bricolage, and some of the other tools available before you make the plunge. Learning Zope/Plone is not an easy undertaking and if your strengths lean toward PHP/MySQL then you may want a tool based around that tool set. I do not mean to belittle the architects of the Zope/Plone projects. They have certainly built a complex system. Just make sure that you need the complexity before you go ahead and jump into Zope/Plone



If you would like to hire me for some zope/plone consulting I am available. If you want to drop me an email with a quick question feel free to tom@functionalmedia.com . Also note that I only made any serious breakthroughs by subscribing to the Plone users mailing list. The experts lurk there, you will recognize the names of authors and developers. Other good sources of information come from forums and documentation at Zope hosting companies. Obviously these folks who make a living off of Zope have learned the intricacies of the system.


Before you begin you should note that with Zope 2.7 the zope team has changed the distribution scheme somewhat. As far as I can tell the linux binary release will no longer be packaged and distributed. You will have to install from source.


What the old linux binary release was:

The old linux binary release came prepackaged with a version of Python. Zope is a Python application and depends on the latest version of Python.  Your system, debian , RedHat, Fedora, Suse may use an older version of Python. Prepackaging Python was a nice feature.  I assume that the package maintainers of the various Linux distributions might prefer to build there own binaries. I also assume that it was a pain to build the binary packages. So they are no longer available. If you  see documentation that refers to the "linux binary install" it is out of date. Ignore it. Things have changed substantially.


Other sources of binary installs:

Debian testing as of "April, 2004" includes a version of Zope and Plone. This is a rock solid way to install Zope. Simply "apt-get install CMFPlone"(or whatever they call it) and apt will handle the dependencies and you will be ready to go. SUSE and Mandrake may have RPM's available. Get comfortable with your systems package management tools and use them. My problem was that my Debian server runs stable not testing. Backporting failed, apt-pinning for these packages turned out to be rather messy so I opted to install it from source on a RH 9. server. 


OLD LINUX BINARY INSTALL:


If you are installing an old version of Zope that has a linux binary package a decent tutorial resides at http://www.zope.org/members/mcdonc/Howtos/zopeinstall/ZOPE-INSTALL-HOWTO. If you need to add any modules to your python in this environment make sure you alter the correct Python. "/usr/local/zope/python packagedirectory/setup.py build" for example. Export any zope folders that you care about by selecting them in the Zope Management Interface and selecting "export" at the bottom of the page.



Refer to the mcdonc tutorial for the details on permissions regarding a zope installation. The details of setting permissions for a zope directory are poorly documented. The mcdonc instructions are good. Permissions can be a huge problem start off on the right track.



INSTALLING 2.7 FROM SOURCE:

With zope 2.7 the installation method has changed.  The Linux binary releases are not available. The source release does not have python included. Interesting, the docs from the Zope download page do not bother to reflect this change. Read what documentation is available and sort it out. Do not be surprised to continue to find absent or outdated documentation for Zope Plone.  The Zope and Plone developers could take a few pointers from the Apache group in this regard. They do seem to be adopting some apache-like configuration options so they are at least following the "Rule of Least Surprise" or starting to anyhow.


Here is a quote from the mailing list regarding this change.

"So the long and short of it becomes that a Zope 2.7+ package download

page will list only the source release and the Windows binary release

(no upgrade packages, no Solaris binary, and no Linux binaries)."


With this in mind you  may need to install Python by hand and compile Zope from source.   Fun... perhaps. Really it is not too difficult. Plus this installation method puts you in complete control. You build a custom Python. The rest of your tools and packages that came with your system can use your old Python. Your system remains stable and Zope gets what it needs and you have the knowledge to install the latest and greatest Zope on any machine that can run Python. 


This page has some useful information about what is new in Zope 2.7.

http://www.plope.org/Members/chrism/whatsnew_27


Another installation tutorial for 2.7 is found here.

http://zettai.net/Howto/Zope27Python23Install/view

These instructions are for installing on that companies BSD system in your home directory. Useful as an overview but we want to install Zope 2.7 as a service on our machine that runs out of /opt or /usr/local so the instructions are not completely applicable.



HERE GOES:

Okay so it looks like I will need my own version of Python. I do not want to mess with the other version of python on my system , nor do I want to get into any dependencies involving installing a python rpm. So I grabbed the python source from python.org I am basically following the instructions from


I am going to install python 2.3.3 to my /opt directory. Seems like zope 2.7 will install there also so both pieces will be close together. 


Download Python. 

Unzip and untar

cd Python (change to the directory you just created when you untarred Python)

  cd Python-2.3.3

Run the python configure script. the --prefix option tells Python which directory to install to. Without the --prefix option you may blow away your present Python. Do so at your own peril. 

   ./configure --prefix=/opt/python2.3.3

Run the make utility to build python   

make

Install Python. Must be root. I use the "su -c" command to run one command as root. 

             su -c "make install"



Now I should have python 2.3.3 in /opt/python2.3.3 

Check it out..

         $ /opt/python2.3.3/bin/python -V

           Python 2.3.3


Good there it is. The next step is to configure and build Zope with that new  python path /opt/python2.3.3 . Before doing that you may need to add some modules to your new Python.


Configure python,

Your Zope  may need the Python Image Library or the PDF tools or other modules. I know that I will need the Mysql database connector so I will add that module to python. This depends on what you will be doing with your Zope. A Zope package will complain about missing modules when you restart Zope after adding a package. Remember to add the modules to the new python that you just installed. You do this by specifying the path. For Example I had to add the Mysql tools so that I could use the MySQLDA in Zope. I followed the following steps.

Download MySQL-python

cd MySQL-python-0.9.1

  /opt/python2.3.3/bin/python setup.py build

  /opt/python2.3.3/bin/python setup.py install


This adds the MySQL-python module to python2.33, this is the python that zope will be using.


Download Zope2.7 and unzip and untar. Cd to the newly created directory and run the configure script.  Read any of the install docs and README files and see if they have any useful information.  I found the information I needed by running ./configure --help


Change to the directory and gather what information is available.

  cd Zope-2.7.0

   less README.txt 

   less doc/INSTALL.txt 

   /configure --help

Run the configure script with the path to the Python we just installed. The default is to install Zope into /opt/zope-2.7 That worked for me, read the output of ./configure --help if you need any other options or if you need ti install yo another location.   

   /configure --with-python=/opt/python2.3.3/bin/python

Build and install...

  make

  make install


The output of the build steps informed me to run  mkzopeinstance.py . This builds a subdirectory from which we will run our zope. This subdirectory will inherit all of the packages from the primary Zope installation. I was unable to find any documentation on the instance concept. It seems to me that this allows multiple Zope's listening on different ports with different configuration options. This would be handy for complicated installations. 


    /opt/Zope-2.7/bin/mkzopeinstance.py

 

By default this builds a directory instance1 within our Zope directory. I did have this script fail once and left an empty directory called instance1. You may have to be root for some of these steps. I do not recall if that was why i had mkzopeinstance.py fail.   


 

Change to your zope/instance1 directory and edit the configuration file. 

   emacs etc/zope.conf


I left everything at the defaults but set the user to a user I created named "zope"

The relevant line is.

effective-user zope


Zope will start as root and bind to any priveleged ports, (ports below 1024) Then it will run as the user zope. Zope needs to be able to write to the var directory . /opt/zope2.7/instance1/var . Set the needed permissions. And start zope up.  I used the zopectl script that was in the instance1/bin directory. "zopectl start" seemed to work similar to apache and apachectl. There is also an executable called runzope, there is no documentation so I am unsure what it does


Start Zope up. Zope uses an apacheclt style script called zopectl. It takes the arguments stop start and I presume restart. I also would presume that zopectl is the proper way to start and run Zope. The runzope script might also be useful.  When I find some documentation or track down some other useful information I will  I will post it here


All that is left to do then is import your previously exported Zope stuff. Add any products like Plone and CMF to /etc/zope2.7/lib/python/Products and that is it.


Have fun..  


if you find that this page is out of date or has incorrect information please feel free to email corrections to me at tom@functionalmedia.com

Additional Notes

Jonathan Brewer adds the following information

Thanks for putting the Plone installation reference up! I had a terrible time trying to make it go with Debian packages.

Starting with a clean install of Debian Sarge, if one uses Python 2.3.4, it seems to me that one needs to install "zlib" and "expat" before compiling Python.

If not, Zope complains in detail about not having them available.

FYI I have used Python-2.3.4 from source, zlib-1.2.1, expat-1.95.8, and Zope-2.7.3-0