Plone 4.0.3 Universal Installer

by topia
28 deployments · 4 still active · last rev. 8 years ago

Prepares the environment for a Universal-Installer-based zeocluster install of Plone 4.0.3, running as user plone, under /home/plone.

May be used for development, and or prototype/production. Adds Facebook integration, varnish, and nginx, including basic config.

TODO: Create a /home/plone/www/maintenance/500.html file for outages. Start the instance with bin/ Enjoy!


Compatible with: No distros currently supported

# Copyright 2010 Russ Ferriday, Topia Systems Ltd

#This script puts its output in the LOGFILE below, and makes a temp fifo.

mkfifo $PIPEFILE

# Start tee writing to a logfile, but pulling its input from our named pipe.

# capture tee's process ID for the wait command.

# henceforth, redirect the rest of the stderr and stdout to our named pipe.
exec > $PIPEFILE 2>&1

#DO THE WORK -----------------------------

echo Doing the Prep work before Plone setup...

# use Linode provided primitive script
# to update to latest public ubuntu version
# Must get aptitude, since used by this script, and missing in 10.10
apt-get -y install aptitude
source <ssinclude StackScriptID="1">

#Then invoke our Ubuntu Base Install, now that we are up to date.
source <ssinclude StackScriptID="811">

apt-get -y install subversion

#dependencies for building varnish as part of buildout
apt-get -y install pkg-config libpcre3 libpcre3-dev

#dependency for building Universal Installer Plone with ssl support
apt-get -y install libssl-dev

#get root oriented setup files 
cd /root
git clone git://

#specify the firewall
iptables-restore <  Plone4StackScript/protoiptables.rules
#copy the rules into the webmin save file, and init on boot
iptables-save > /etc/iptables.up.rules 
echo '    post-up iptables-restore < /etc/iptables.up.rules' >> /etc/network/interfaces 

#use system NGINX due to library hassles when compiling from buildout
echo 'nginx setup'
apt-get -y install nginx
#Get the hostname interactively
#<udf name="host_dn_or_ip" label="Fully Qualified Domain Name or IP address of the server" example=""/>
if [ ! -n "$HOST_DN_OR_IP" ]; then

sed -e "s/_FQDN_/${HOST_DN_OR_IP}/g" /root/Plone4StackScript/ > /root/Plone4StackScript/nginx.conf
cp  /root/Plone4StackScript/nginx.conf /etc/nginx/nginx.conf
mkdir -p /usr/local/nginx/logs

#First create the plone user, and init ssh for him
adduser --gecos '' --disabled-password  plone
su -c 'ssh-keygen -q -t rsa -N "" -f /home/plone/.ssh/id_rsa ' plone

echo 'going over to home directory of "plone" user'
cd /home/plone

#get the more volatile parts of the install
git clone git://

chown -R plone:plone .

cd robust-linode-plone

echo 'run the install script as plone user'
su -c './' plone

echo 'add the custom layers'
su -c './' plone

echo 'ensure everything runs after restart - as root'

#WORK IS COMPLETE ---------------------------

#Teardown logging pipe, etc.

# close the stderr and stdout file descriptors.
exec 1>&- 2>&-

# Wait for tee to finish since now the other end of the pipe has closed.
wait $TEEPID