个人工具

UbuntuHelp:Forum/server/Plone

来自Ubuntu中文

跳转至: 导航, 搜索
  1. title Plone CMS

Plone is a content management system (CMS). Please refer to http://plone.org for more information.

Plone 3 on Ubuntu 8.04 server, the fancy way

The Ubuntu packages do not come with a recent version of Plone. Also the packaging and tools are "weird", and using the Plone universal installer simply isn't geeky enough for me, so this howto will show you how to install the latest Plone using buildout. I will also hopefully cover LDAP integration. This howto should work for the Desktop edition as well, however it hasn't been tested.

Getting started

You will need a fresh install of Ubuntu 8.04, or make sure your box "ain't broke" just yet. You will need root access to your box, and some tools, such as sshd might be needed if applicable. We will use a (system-wide) python2.4, because Plone recommends this version. On Ubuntu 8.10 and possibly other versions, the easy_setup command will not work because Ubuntu is using Python 2.5. Please see instructions for changing this if you are willing to change the python version for the entire system.

Dependencies

You need to install the following dependencies:

sudo apt-get install python2.4 python2.4-dev python-setuptools python-imaging python-libxml2 libssl-dev gcc

Installing a buildout

First of all, you will need a zope skeleton, zope being the software serving Plone (not apache, lighttpd or else)

sudo easy_install -U ZopeSkel

Then you need to create a plone buildout. First I recommend creating it in your /opt directory. You must replace "NameOfYourProject" with "Plone" or whatever name you want:

cd /opt
sudo paster create -t plone3_buildout NameOfYourProject

It will ask you a few questions, leave everything to default except your admin password (type the password you want, not your system password). cd into your newly created directory (the directory is "NameOfYourProject" or the name you replaced it with) and finalize the buildout creation:

cd NameOfYourProject
sudo python2.4 bootstrap.py

You will need to add one attribute in buildout.cfg (located in /opt/NameOfYourProject), under the [instance] section:

sudo vim buildout.cfg
effective-user = www-data

Then change the group ownership and permissions of the var directory:

sudo chown -R :www-data var
sudo chmod -R g+rw var

Now, run buildout itself. Remember that you should be in your "NameOfYourProject" directory. the following command will run buildout in extra verbose mode, so if something goes wrong, you know what it is right away :)

sudo python2.4 bin/buildout -v

This will actually download and install your products eggs from the cheese shop. buildout is the dream tool, really :D. It may take some time to download and install all these products, and may not output as much as you would wish, so don't panic. Now that all is fine, you can run zope for the first time. Because it's the first time, we will launch it in foreground mode, this way all the error messages and other possibly useful info will be printed directly on the command line.

sudo python2.4 bin/instance fg

You should be able to see the zope interface on yourdomain.com:8080 You can kill it using Ctrl + C

Going further

You need to restart Zope in backgroud mode. To do this, simply type bin/instance start Now that Zope is running, go to domain.com:8080/manage . This is the zope managment interface. Look for 'Plone site' in the drop-down box on the top right, this will add a new Plone site. Fill-in the forms, save, and you should be able to access your brand new plone site at domain.com/idoftheplonesite The site now running can be used for production. However, it is far from being perfect for production. Something to do with performance, or maybe the fact it's not running on port 80 perhaps ?

LDAP integration

WORK IN PROGRESS, CURRENT VERSION IS BROKEN. It seems there are many problems regarding libldap and python-ldap in ubuntu/debian. Having everything in a chroot would probably sort many problems out (also the python2.5 and 2.4 that get mixed up) LDAP is not needed to use the advanced features of plone. However it is very useful when you wish to use other software and share the authentication mechanisms with Plone. A possible example would be to run Plone and PHPBB3 but have your users register only once. Phpbb is in php, plone is in python, phpbb runs on apache/mysql and plone runs on Zope/ZODB. LDAP is the aspirin to your integration headaches... Just... trust me :D To use LDAP, you will need an LDAP server, if you do not already have one you can follow this doc https://help.ubuntu.com/community/OpenLDAPServer You will also need to install a new product for Plone/Zope, called PloneLDAP

To install PloneLDAP, you need to modify your buildout.cfg, and add 'Products.PloenLDAP' in the [buildout] section, after
eggs=
elementtree

so it looks like

eggs=
elementtree
Products.PloneLDAP

There are some problems with the ubuntu python-ldap and openldap packages, so we are going to build them for our own, personal Plone use with buildout (yes, buildout IS amazing). python-ldap comes as an egg and is in the cheese shop, however, openldap is not, and openldap comes as a standard ./configure, make, make install source package. GREAT! We actually have a python egg that creates python eggs out of standard source packages. Darwin was right after all, evolution is the only way. Integrate the following code in your buildout.cfg:

[buildout]
versions = versions
parts =
        openldap
        python-ldap

[versions]
python-ldap = 2.3.5

[openldap]
recipe = zc.recipe.cmmi
url = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20071118.tgz

[python-ldap]
recipe = zc.recipe.egg:custom
egg = python-ldap
include-dirs  =
    ${openldap:location}/include
library-dirs  =
    ${openldap:location}/lib

You will need to install some extra system dependencies to compile openldap from source:

apt-get install libdb4.4-dev libsasl2-dev libssl-dev

Now, run python2.4 bin/buildout, stop and start zope again. python2.4 bin/instance stop and python2.4 bin/instance start (I dont know why, I've had problems with a simple restart before, so i prefer to stop and start again).


Perhaps to mention that since Plone 3.1 the installer states this on buildout:

**************************************************************************
**   *** NOTE: You probably don't want to use this template!

**  Since Plone 3.1, the preferred way to get a buildout-based setup
**  for Plone is to use the standard installer for your operating
**  system (the Windows installer, the Mac installer, or the Unified
**  Installer for Linux/Unix/BSD). These give you a best-practice,
**  widely-used setup with an isolated Python and a well-documented
**  buildout. This template is here for older versions of Plone and
**  for experts who explicitly want a raw, non-installer-based
**  installation.

**  (This message is particularly aimed at people following out-of-
**  date books/documentation that suggest this is the right way to get
**  a Plone-based buildout. This is no longer the case.)
**************************************************************************