TurnKey Linux Virtual Appliance Library

TKLPatch for Plone 4

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-UnifiedInstalle...
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!
Attached: 
Liraz Siri's picture

I'm glad you both worked on this

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

I haven't tryed "on the fly" patching

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. 

Yes it does!

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. 

Mine says

 

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's picture

Double check you are using the correct version of Core

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.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)