Learn how to install and configure Zope 2.10 and Plone 3 on Windows. Instruction describes installation of all required modules: PIL, OpenID, Libxml2. But also some additional but useful products: ZMySQLDA (MySQL adapter), ZPsycopgDA (PostgreSQL adapter) and TextIndexNG3.
Don’t install Plone binaries!. On Plone. org downloads page we have an option to download Plone-x. y.z. exe. It will install “everything you need” but then it is completely unmanageable. Although I have a big respect for people from Enfold who did this installer I never use it.
Zope server installation
First we have to install Zope application server.
- Download Zope from zope. org. For most recent Plone 3.0.4 we need at least Zope 2.10.5
- Save the installer
- Run it and select path where Zope will be installed. For our example lets assume that our ZOPE_PATH will be: C:\Program Files\Zope-2.10.5 .
- We may create instance now or do it later. Lets postpone it for a while to learn how to do it in usual way outside installation.
Creating Zope instance
We’ve just installed binary files but we cannot run our server yet. To run Zope or Plone we need an instance.
- From menu Start->All programs select our Zope-2.10.5 folder and then Make Zope instance
- Follow on screen instructions. Select instance folder (it will be created if does not exists) and then manager’s login and password. For our example lets use INSTANCE_PATH D:\zope-instances\plone3-instance
- To start instance go to D:\zope-instances\plone3-instance\bin and click or type in command line runzope. bat. This is ideal for debugging and quick restarts.
- If you don’t want to manually start instance in the console you can install it as a Windows service. Then it can be managed/started/stopped as any service. This is a snippet from cmd terminal:
- To test it open your browser and type url http://localhost:8080/manage . Then provide your manager’s login and password and enjoy the ZMI
Now we have to download Plone and “install” it. Plone is basically a Zope product so we have to place it in Products directory. To be exact it is not a 1 product but 41 of them (Plone 3.0.1).
- Download recent Plone version from http://plone. org/products/plone. Select Plone for all platforms
- Save file on the disk. This is an archive packed by gzip with extension tar. gz.
- Unpack it. I’m using free software called Iceows to do this. As a result you will get two folders: Products , lib and some files.
- Copy all folders from Products to D:\zope-instances\plone3-instance\Products
- Copy all folders from lib\python to C:\Program Files\Zope-2.10.5\Zope\lib\python\
- Install PIL, which is required for this Plone version. See below for details
- You can install also optional modules: libxml2 and openid. Detailed instructions are below. After that we have a really nice Zope start without any warning messages.
Other modules installation
To run Plone we need additional modules that have to be compiled for Windows. Of course we can download source and compile it ourselves, but I’ve never had success with that. Unfortunately Python interpreter used by Zope is inside its program directory and information about it is not stored in Windows registry. That is why we can’t to install modules for it in standard way. What we have to do is a trick.
- Download Python 2.4 installer for Windows
- Save the file, run it and proceed instructions on screen. Lets assume that our Python has been installed in C:\Program Files\Python-2.4.4
- Whenever we will have to install modules using installer we will use this Python and then copy libraries to our Zope directory
Click to view full-size image…
Python Imaging Library (PIL)
Module used for image processing. PIL itself is really powerful and can be used for really advanced operations. Plone uses it just for images resizing in CMFPlone. utils. scale_image function.
- Download PIL 1.1.5 installer for Python 2.4
- Run installer. Notice that previously installed “normal” Python 2.4 is found in registry but Python used in Zope isn’t. That is why we are unable to install PIL directly to Zope
- Copy folder C:\Program Files\Python2.4.4\Lib\site-packages\PIL and file C:\Program Files\Python2.4.4\Lib\site-packages\PIL. pth to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
To be honest I don’t know what it is used for. But I don’t like warning messages especially when it’s easy to find a remedy.
- Download libxml2 Windows installer for Python 2.4
- Install inside Python 2.4
- Copy files mentioned below to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
- We need also elementtree. After downloading unzip and copy folder elementtree to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
Package that adds OpenID support to our Plone site.
- Download openid source archive
- Save and unpack
- Copy folder openid that is inside unpacked package to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
ZMySQLDA – MySQL adapter
This adapter nicely give us access to MySQL. We can use ZSQL methods to retrieve and update data. They are independent of database, we can for example use MySQL at the beginning and after some time switch to PostgreSQL or other database. The only condition is to use standard SQL syntax in those queries that are supported by every database server.
- I assume that MySQL 4 is already installed on the machine. Installer and tutorials can be found on MySQL official website.
- Download Zope product ZMySQLDA-2.0.8.tar. gz from Sourceforge. net.
- Unpack archive and from lib/python/Products copy folder ZMySQLDA to D:\zope-instances\plone3-instance\Products
- Download Python MySQLdb installer MySQL-python-1.2.2.win32-py2.4.exe from mysql-python on Sourceforge. net.
- Run installer and add module for Python2.4
- From folder C:\Program Files\Python2.4.4\Lib\site-packages\ copy folder MySQLdb and files _mysql. pyd , _mysql_exceptions. py to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
After installation I got few warnings: “The ImageFile module will be removed in Zope 2.11. Use App. ImageFile instead.”, “__init__.py of Products. ZMySQLDA has a long deprecated ‘methods’ attribute. ‘methods’ support might be removed in Zope 2.11 or a later feature release.”. This means that this product may not work in next Zope release. Lets hope that author will update the code (maybe in ZMySQLDA 3.0).
ZPsycopgDA – PostgreSQL adapter
Adapter for PostgreSQL relational database. Server should already be running on your computer. You can download it from www. postgresql. org.
- Thanks to stickpeople for providing Windows binaries. On that website we can find installer for Python 2.4 (and PostgreSQL 8.2) module psycopg2-2.0.6.win32-py2.4-pg8.2.4-release. exe and appropriate Zope product ZPsycopgDA-2.0.6.tar. gz
- Add Zope product in standard way
- Run psycopg2 installer for Python 2.4 and again copy folder C:\Program Files\Python2.4.4\Lib\site-packages\psycopg2 to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
The main purpose of TextIndexNG is to index almost any document format as long as their is an external converter available (supports most Microsoft office formats). But it has lots of other features that are nicely listed on that project website.
- From textindexng project page download TextIndexNG3-3.2.1.tar. gz and txng3-python-2.4-win32-libs. zip. First is a Zope product and the second file is an archive with compiled DLL libraries.
- Unpack product and copy TextIndexNG to Zope products folder. Then unzip libraries archive and copy zopyx folder to C:\Program Files\Zope-2.10.5\Python\Lib\site-packages
- After instance restart we have to install it in Plone using portal_quickinstaller. Then in Plone you must go to Site Setup -> TextIndexNG3 and click the link Convert SearchableText index to TextIndexNG Version 3 instance. This will replace old ZCTextIndex indices: Description, SearchableText, Title with new TextIndexNG3 ones.
- To enjoy searching through Microsoft Office and PDF files you need to proceed few more steps that are described in articles: Enable Indexing of pdf and word docs with Windows in Five steps:three minutes of your times without problems and Enable full-text indexing of Word documents and PDFs in Plone 3.0
I really do all my work on Windows. Not Linux or Mac OS like most of the developers. And this have simple explanation. By doing this I have the skills and knowledge to support also Microsoft-friendly customers. I was even forbidden to install Ubuntu when I was fed up after my Windows crashed totally.