Tuesday, July 28, 2009

Installing Zope and Plone from source on Ubuntu in 10 easy steps

from : http://www.paolocorti.net/2008/01/02/installing-zope-and-plone-from-source-on-ubuntu-in-10-easy-steps/


Installing Zope and Plone from source on Ubuntu in 10 easy steps
Posted by Paolo Corti on January 2, 2008


Here are my notes for installing Zope and Plone from source in Ubuntu. I took this notes installing on 7.10 (Gutsy) but should work without problems for earlier Ubuntu versions, and for other Linux platforms

-1- install libraries needed for build (build-essential) and Zope

sudo apt-get install build-essential python2.4-dev python-lxml python-elementtree python-imaging

-2- download zope 2.10.5 and plone 3.0.4

wget https://launchpad.net/plone/3.0/3.0.4/+download/Plone-3.0.4.tar.gz wget http://www.zope.org/Products/Zope/2.10.5/Zope-2.10.5-final.tgz

-3- unzip the downloaded files

tar -xvzf Zope-2.10.5-final.tgz tar -xvzf Plone-3.0.4.tar.gz

-4- create the makefile and set the prefix

cd Zope-2.10.5-final

way1:

./configure gedit makefile  and set  prefix=/opt/Zope-2.10.5

or way2 (simpler):

 ./configure --prefix=/opt/Zope-2.10.5

-5- Install Zope (at the location set in prefix)

sudo make install

-6- create an user for zope

not run as suggested: “Now run ‘/opt/Zope-2.10.5/bin/mkzopeinstance.py’” but create an user for zope

sudo adduser zope

-7- create one ore more Zope instances (here we will create just one single instance)

create a directory where to place each Zope instance

sudo mkdir /srv/zope/inst_2_10_5

give to this directory ownership to zope user:

sudo chown zope.zope /srv/zope/inst_2_10_5

run mkzopeinstance.py as the zope user:

sudo su zope /opt/Zope-2.10.5/bin/mkzopeinstance.py Directory: /srv/zope/inst_2_10_5 Username: admin Password: ****

-8- Run Zope and test Zope installation

If you want to run Zope on a port different from 8080:

sudo gedit /srv/zope/inst_2_10_5/etc/zope.conf

go to server directive:

>   # valid keys are "address" and "force-connection-close"   address 8080   # force-connection-close on >

and change 8080 to whatever port you want to run the Zope process

Now let’s start Zope: you need to run the Zope instance as the zope user

sudo su zope /srv/zope/inst_2_10_5/bin/zopectl fg

fg is the foreground option for the Zope process. Without using it you will enter an interactive mode, where you can directly send commands (like start, stop, fg, debug).

Now if you go to the address: http://localhost:8080 (change 8080 to the port you are running the Zope process) you will be promptet for the user and password of the administrative user of ZMI.

Now to stop the zope fg process (in order to install Plone) just type ctrl+Z and kill the python process:

sudo killall -9 python2.4

-9- Install Plone

9.a) For Plone 3.x

Copy Plone products and Python libs to the zope instance (products directory, base Zope is without products)

sudo cp -r Plone-3.0.4/Products/* /srv/zope/inst_2_10_5/Products/ sudo cp -r Plone-3.0.4/lib/python/* /srv/zope/inst_2_10_5/lib/python/

give permission to zope user:

sudo chown -R zope.zope /srv/zope/inst_2_10_5

9.b) For Plone 2.x

you just need to copy the Plone products

sudo cp -r Plone-3.0.4/* /srv/zope/inst_plone2/Products/

note: for any Plone (2.x, 3.x) if you copy the Products under the /opt/Zope-2.10.5/skell/Products directory, each instance that will be created will already have all the products. Same thing for the lib/python directory.
Or, if you copy the products in /opt/Zope-2.10.5/lib/python/Products directory, all the zope instances will use that directory without copying them in each instance.

-10- Run Zope and test Plone

Now if you run the Zope process and you go to the address: http://localhost:8080 (change 8080 to the port you are running the Zope process) you will access the ZMI.
There you will create your first Plone site (by selecting “Plone Site” and then clicking the “add” button)

If you named the Plone Site “test” then you can go there by typing on the browser: http://localhost:8080/test. You are now on a new ajaxifed Plone 3.0 web site: congrats!

-extra step- debugging Zope

Run zope without the fg option and enter in the debug command prompt:

/srv/zope/inst_2_10_5/bin/zopectl zopectl> start --will start zope zopectl> debug --will debug zope zopectl> stop --will stop zope

Now under the Python shell you can debug Zope (and Plone). To exit from debug type ctrl+d.

>>> dir() ....many resources >>> dir(app) ...many resources >>> dir(app.test) --if you named your Plone site as "test" >>> print app.test 

No comments: