Adrian Moya's picture
Hi everyone. First, I must say that Basil already posted a Plone appliance here. We both worked on this appliance as we wasn't aware that the other was working on it. Well, as my version was already on QA testing, I decided to publish it too. It differs from his in the mode that Plone was installed (standalone versus zeocluster). Both may be useful depending on your needs. 
 
I didn't know anything about Plone until a recent discussion in other thread of the forum, and it looks like a powerful enterprise ready CMS. I really liked, I hope to work with it in the future. Right now, I hope some community members steps in and give some feedback on this appliance. 
 

Features:

- Plone 4 installation in zeocluster mode.
- Jpeg support enabled.
- Apache configured in front of Plone.
- SSL access configured (via Apache mod_ssl). 
- Custom setupsite script to easily setup apache virtualdomains to point to plone sites. (convenience)
- Startup script to manage installation as a service.
- User: admin Password: turnkey
 

What it does:

 
1. Sets Hostname to plone
HOSTNAME=plone
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts
hostname plone
2. Install required packages. 
install python-dev python-imaging postfix ssl-cert build-essential libjpeg-dev libreadline-dev apache2
 
3. Get Plone 4 Unified Installer and untar
wget http://launchpad.net/plone/4.0/4.0.0/+download/Plone-4.0-UnifiedInstaller.tgz
tar xvzf Plone-4.0-UnifiedInstaller.tgz
cd Plone-4.0-UnifiedInstaller/
 
4. Install plone in zeocluster mode using system python.
./install.sh --with-python=/usr/bin/python --password=turnkey zeo
5. Sets plone startup script (overlayed) to start on system boot.
update-rc.d plone defaults
 
6. Enable apache modules
a2enmod proxy_http rewrite ssl
7. Enable defaults plone sites
a2dissite default
a2dissite default-ssl
a2ensite plone
a2ensite plone-ssl
8. Remove unused files and clean apt cache
cd ..
rm -Rf Plone-4.0-UnifiedInstaller
cleanup_apt
 

setupsite script:

This is the content of the script to setup virtualservers in apache. Its overlayed to /usr/local/bin so you can run it as a command. Note that some configuration files for apache where overlayed (ports.conf and proxy.conf) to make this magic work!
 
#!/bin/bash
# Script to setup virtual domains for plone sites
# By Adrian Moya

if [ $# != 2 ]; then
  echo "Usage: setupsite sitedomain plonesite"
  echo "Example: setupsite www.example.org myplonesite"
else
  sed "s/DOMAIN/$1/" /usr/local/Plone/site-template > /etc/apache2/sites-available/$1
  sed -i "s/PLONESITE/$2/" /etc/apache2/sites-available/$1
  echo "Created file /etc/apache2/sites-available/$1"
  sed "s/DOMAIN/$1/" /usr/local/Plone/site-ssl-template > /etc/apache2/sites-available/$1-ssl
  sed -i "s/PLONESITE/$2/" /etc/apache2/sites-available/$1-ssl
  echo "Created file /etc/apache2/sites-available/$1-ssl"
  a2ensite $1
  a2ensite $1-ssl
  service apache2 reload
fi
As you can see, the script simply uses two templates overlayed to /usr/local/Plone and creates new site files for apache and enable those sites. You can modify those templates if you need a more complex configuration. If there are best practices for this kind of configuration, feel free to contribute to this patch. 
 
Enjoy!
Forum: 
Tags: 
Liraz Siri's picture

I just finished comparing your patch to Basil's and I posted my impression here.

Christian's picture

Hi, 

this is probably not related to your appliance, but I have trouble installing it. What I did:

 - Installing a TKL core appliance into VirtualBox

- starting it, ssh'ing into /root

- downloading your patch

- as described here, applying the patch as a "hotfix" (option 2):

	root@core:~# tklpatch / plone4.tar.gz 
fatal: no such file '/;
What am I doing wrong?
Thanks!
Adrian Moya's picture

But if you already downloaded the turnkey-core iso, just scp'it inside your VM and patch that one. You'll get the patched iso which you can scp outside again and reinstall. Sorry that this procedure is a bit time consuming, but one it have been tested enought, this patch will become an official appliance and it'll be easier. 

Please comment your experience after patching with the resulting iso. If you have any problem, feel free to ask. 

Christian's picture

Ok, there seems to be a bug in the documentation. It must be 

tklpatch-apply / plone4.tar.gz

Then it installed ... but I am getting this:

	[...]

Testing /usr/bin/python for Zope/Plone requirements....
Failed: Python version must be 2.6+.
***Aborting***
/usr/bin/python does not meet the requirements for Zope/Plone.
Specify a more suitable Python, or upgrade your Python and try again.
You may also omit --with-python and let the Unified Installer
build its own Python. 
 Adding system startup for /etc/init.d/plone ...
   /etc/rc0.d/K20plone -> ../init.d/plone
   /etc/rc1.d/K20plone -> ../init.d/plone
   /etc/rc6.d/K20plone -> ../init.d/plone
   /etc/rc2.d/S20plone -> ../init.d/plone
   /etc/rc3.d/S20plone -> ../init.d/plone
   /etc/rc4.d/S20plone -> ../init.d/plone
   /etc/rc5.d/S20plone -> ../init.d/plone
Enabling proxy as a dependency
Module proxy installed; run /etc/init.d/apache2 force-reload to enable.
Module proxy_http installed; run /etc/init.d/apache2 force-reload to enable.
Site default is already disabled
Site default-ssl does not exist!
Site plone installed; run /etc/init.d/apache2 reload to enable.
Site plone-ssl installed; run /etc/init.d/apache2 reload to enable.
Christian's picture

I am currently rerunning the patch without the "--with-python" flag as indicated in the error message. The TKL Ubuntu distribution doesn't contain Python2.6 - I wonder how you got it running?

Adrian Moya's picture

TKLCore, by default, has python installed. And a valid version for plone installation. But you may be incurring in other issues by doing "on the fly" patching, as said in documentation, it may break stuff. 

Running without --with-python will download it's own python, so you shouldn't have any problem. 

Christian's picture

Hi Adrian,

not that it really matters since you seem to have been able to run it, but the python shipped with TKL core says "python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2", and the error message says "Failed: Python version must be 2.6+." So maybe I am not getting something here, but there seems to be a version difference ... ?

Anyways, it went through without any problems and the plone zeo server and clients are running. I will post on my experiences with the appliance later!

Thanks so much for your work.

C. 

Adrian Moya's picture

 

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
 
Maybe an apt-get upgrade? patching the iso doesn't fail, it's weird... sure you're using turnkey-core-lucid? 
Jeremy Davis's picture

I think you will need to use TKL-Core-Lucid beta (contains python 2.6.5) not the current stable release TKL Core (contains python 2.5.2). I reckon thats the cause of your problems.

Add new comment