You are here: Home / Documentation / How To's / Local buildout for our Intranet

Local buildout for our Intranet

by nguyen — published Nov 10, 2011 03:35 PM, last modified Aug 16, 2016 10:50 AM
to recreate a ZEO installation of the UW Oshkosh Intranet Plone/Zope

Supported Platform

The instructions on this page have been tested on Mac OS X Lion.  We use the same buildout configuration files as on the server, which runs Red Hat Enterprise Linux.

Get and Run the Unified Installer

Download the Plone 4.1.2 unified installer from:

http://plone.org/products/plone/releases/4.1.2

Unpack it with the commands

tar xfz Plone-4.1.2-UnifiedInstaller.tgz
cd Plone-4.1.2-UnifiedInstaller

Run the installer using a command line like:

./install.sh --target=/Users/kim/Plone-4.1.2 zeo

(substituting kim above with the username you're using)

Get and unpack the Intranet buildout configuration files

Copy the following tar file containing buildout configuration files to your zeocluster directory:

then unpack it with the command

tar xfz uwosh_intranet_buildout_config.tgz

Then edit the file buildout.cfg and replace the username changethisusername in this line

effective-user = changethisusername

to the username you are running as (in my case, kim):

effective-user = kim

and save the file.

Buildout using a local egg cache

If you want to use a local buildout egg cache in your home directory to speed up your buildouts (e.g. ~/.buildout/eggs, ~/.buildout/downloads, ~/.buildout/extends, ~/.buildout/default.cfg) you can make simple modifications to the above *.cfg files.

Comment out these variables:

  • eggs-directory
  • download-cache
  • PYTHON_EGG_CACHE 

in the files:

  • base.cfg
  • lxml_static.cfg
  • uwosh.cfg
By commenting out these variables, you allow buildout to look in your ~/.buildout directory and reuse eggs you've already downloaded there and to place newly downloaded eggs in there for subsequent reuse.  

How to set up a ~/.buildout directory

Create a ~/.buildout/default.cfg file containing:
 
[buildout]
eggs-directory = <homedir>/.buildout/eggs
download-cache = <homedir>/.buildout/downloads
extends-cache  = <homedir>/.buildout/extends
 
where "<homedir>" is your home directory, e.g. "/home/kim" or "/Users/kim".  To determine your home directory, run:
 
$ python -c "import os.path; print os.path.expanduser('~')"
 
or do this:
 
echo $HOME
Then create the ~/.buildout directory and its subdirectories: 
mkdir -p ~/.buildout/eggs
mkdir ~/.buildout/downloads
mkdir ~/.buildout/extends
 

Run the Intranet buildout

Now you are ready to run buildout:

bin/buildout -c uwosh.cfg

Cloning the actual Intranet site

Everyone except UW Oshkosh developers will skip this step!

If you need to have a local clone of the Intranet site to work with, you'll need to copy the Data.fs, Data.fs.index, and the blobstorage folders from the plone3.webcluster.uwosh.edu server into the matching location of your local Zope.  

Use FileZilla.  

To preserve what you had, rename the var/filestorage directory to var/filestorage.orig and the var/blobstorage directory to var/blobstorage.orig before doing the FileZilla copy.

Start your ZEO servers and ZEO client

You're going to have to start all the ZEO servers and then probably just one ZEO client.

 bin/zeoserver start
 bin/zeoserver-sites1 start
 bin/zeoserver-sites2 start
 bin/zeoserver-sites3 start
 bin/zeoserver-sites4 start
 bin/zeoserver-sites5 start
 bin/client1 fg

Then open a browser and go to http://localhost:15080

To see which Python processes are running on your system, use

ps auxwww|grep python

 

GET AND BUILD THE PATCHED PYTHON LDAP MODULE

There is a bug in the Python LDAP module, or possibly an incompatibility between python-ldap 2.4.4 and the ldap libraries installed on a machine.

I have run into it on Mac OS X Lion and possibly on Leopard, as well as on Red Hat Enterprise Linux.  

If you are affected by this bug you'll see an error on client startup related to ldap dynamic library loading.  Here is what the error stack looks like if you've started a client in foreground mode with bin/client1 fg

Traceback (most recent call last):
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/Startup/run.py", line 72, in <module>
    run()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/Startup/run.py", line 21, in run
    starter.prepare()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/Startup/__init__.py", line 259, in startZope
    Zope2.startup()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/Zope2/App/startup.py", line 67, in startup
    OFS.Application.import_products()
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/OFS/Application.py", line 583, in import_products
    import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Zope2-2.13.10-py2.6.egg/OFS/Application.py", line 606, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Products.LDAPMultiPlugins-1.12-py2.6.egg/Products/LDAPMultiPlugins/__init__.py", line 22, in <module>
    from Products.LDAPMultiPlugins.LDAPMultiPlugin import addLDAPMultiPluginForm
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Products.LDAPMultiPlugins-1.12-py2.6.egg/Products/LDAPMultiPlugins/LDAPMultiPlugin.py", line 29, in <module>
    from Products.LDAPUserFolder import manage_addLDAPUserFolder
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Products.LDAPUserFolder-2.18-py2.6.egg/Products/LDAPUserFolder/__init__.py", line 20, in <module>
    from Products.LDAPUserFolder.LDAPUserFolder import LDAPUserFolder
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Products.LDAPUserFolder-2.18-py2.6.egg/Products/LDAPUserFolder/LDAPUserFolder.py", line 47, in <module>
    from Products.LDAPUserFolder.LDAPDelegate import filter_format
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/Products.LDAPUserFolder-2.18-py2.6.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 19, in <module>
    import ldap
  File "/Users/kim/Plone-4.1.2/buildout-cache/eggs/python_ldap-2.4.4-py2.6-macosx-10.4-x86_64.egg/ldap/__init__.py", line 22, in <module>
    from _ldap import *
ImportError: dlopen(/Users/kim/Plone-4.1.2/buildout-cache/eggs/python_ldap-2.4.4-py2.6-macosx-10.4-x86_64.egg/_ldap.so, 2): Symbol not found: _ldap_create_assertion_control_value
  Referenced from: /Users/kim/Plone-4.1.2/buildout-cache/eggs/python_ldap-2.4.4-py2.6-macosx-10.4-x86_64.egg/_ldap.so
  Expected in: dynamic lookup
To get around this bug, you can build the following patched version of the module.  Copy the following to your zeocluster/src directory:

then untar it, rename the new directory so buildout finds it, then build and install the python-ldap module with these commands:

tar xfz python-ldap-2.3.12-patched.tgz
mv python-ldap-2.3.12-patched python-ldap-2.3.12
cd python-ldap-2.3.12
../../../Python-2.6/bin/python setup.py build
../../../Python-2.6/bin/python setup.py install

You will also have to edit the file versions_uwosh.cfg so it specifies version 2.3.12 of the python-ldap module, instead of the 2.4.4 version as normally used by Plone 4.1.2:

python-ldap = 2.3.12

Then you must re-run buildout:

cd ../..
bin/buildout -c uwosh.cfg

Installing PIL Imaging Library

If you see messages in the console or in the Site Setup page about the PIL Imaging library not being installed correctly, you can use this command:

bin/pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz

 

 

 

Navigation