How To Build Plone From Source
This arcticle describes how to build and launch a Plone site from
source code on a Linux platform. The instructions assume that you are
somewhat familiar with the Linux configure and make utilities. It also
assumes the new Plone installation will be put in the /opt/plone directory.
A. build and install Python
- Download the latest stable Python source distribution from Python.org
- unzip and untar the files from the distribution something like this :
gunzip -c Python-2.3.4.tgz | tar xv - cd into the new Python directory
- configure Python to install itself in /opt/plone suing the command :
./configure --prefix=/opt/plone -
make -
make install
Python executables are now installed in /opt/plone/bin and the Python code modules are installed in /opt/plone/lib/python2.3
B. build and install Zope
- Download the latest stable Zope source distribution from Zope.org
- unzip and untar the files from the distribution something like this :
gunzip -c Zope-2.7.3.tgz | tar xv - cd into the new Zope directory
- configure Zope to be installed in the same directory as Python using the command :
./configure --prefix=/opt/plone --with-python=/opt/plone/bin/python2.3 -
make -
make install
Zope executables are installed in /opt/plone/bin and the Zope code modules are in /opt/plone/lib/python
C. make a Zope instance
Use the mkzopeinstance script to create Zope site where Plone can be
installed. The actual command line should look something like this /opt/plone/bin/mkzopeinstance.py --user="ADMINISTRATOR:PASSWORD" --dir="/opt/plone/INSTANCE",
where ADMINISTRATOR is the name of the Zope administrator's account,
PASSWORD is the PASSWORD for that account and INSTANCE is the name of
the Plone web site directory. This populates a directory named
/opt/plone/INSTANCE with a basic Zope foundation which can be used by
Plone.
D. install the Plone software
- Download the latest stable Plone Core source distribution from Plone.org
- unzip and untar the files from the distribution something like this :
gunzip -c Plone-2.0.5.tgz | tar xv - cd into new plone directory
- copy all sub-directories and files to the newly created Zope instance using a command similar to this :
cp -R * /opt/plone/INSTANCE/Products
E. activate Plone via the Zope Management Interface (ZMI)
- start Zope (must be root user) using a command similar to :
/opt/plone/INSTANCE/bin/runzope - Use a web browser to access the new site using the URL of the host machine. For example, if your installation is on foobar.cornell.edu, the website's url is http://foobar.cornell.edu. Before you activate Plone, the Zope Quick Start page comes up as the web site home page. This page contains a bunch of prose describing links that it contains. About two-thirds of the way down the page, there is a link to the Zope Management Interface. Select it. You should be presented with a login pop-up asking for the site administrator's userid and password. These are the values you entered for ADMINISTRATOR and PASSWORD when you ran the mkzopeinstance command. After you have logged in, you will see the ZMI screen.
- Create a Plone new site using the menu box in the upper right of
the ZMI. A whole bunch of Zope and Plone components are listed in the
menu (either Select type to add ... or Accelerated HTTP Cache Manager will probably be visible). Scroll down until you find Plone Site. Select it and press the Add button. This will present a form with four fields.
- in the edit field named Id, enter Plone as the value.
- in the edit field named Title, enter the name of your web site
- DO NOT change the default value in the edit field named Membership Source
- you may optionally enter a short description of the site in the edit field named Description
- press the Add Plone Site button.
You now have a fully functional Plone site. There is just one thing left to do ...
F. make the new Plone site the default home page for Zope.
"Officially", you should invoke the Python script accessRule.py in the /opt/plone/INSTANCE/Products/CMFPlone/Extensions directory. However, that script sometimes has strange side-effects (like multiple /Plone in the path), so we put a copy in /opt/plone/INSTANCE/Extensions and edit it according to the instructions in How To Fix Strange Behavior in accessRule.py.
In order to activate the script, we need to run two tasks in the ZMI.
- select External Method in the ZMI add menu and press the Add
button. This will display a form with four edit fields. The must be
filled in EXACTLY as described (correct use of upper/lower case is
critical):
- in the edit field named Id, enter the value accessRule.py
- in the edit field named Title, enter the value Plone Access Rule
- in the edit field named Module Name, enter the value CMFPlone.accessRule ... NOTE : use just accessRule if you made a copy in your INSTANCe/Extensions directory as we do.
- in the edit field named Function Name, enter the value accessRule
- press the Save Changes button
- select Set Access Rule in the ZMI add menu and press the Add button. This will display a form with one edit field named Rule Id. This field should be empty by default. Enter accessRule.py and press the Set Rule button.
- Close all browser windows to the site. This is important. It is the only way to make sure that all administrative updates are completed.
Next time you visit your site, you will see a Plone-based home page that is ready for your changes.