~vds/+junk/plone_standalone

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -eux # -x for verbose logging to juju debug-log

juju-log "Setting up dependencies."
apt-get -y install build-essential wget tar gzip python2.7 python2.7-dev apache2

juju-log "Downloading tarball."
wget -q -O /tmp/Plone-4.2.1-UnifiedInstaller.tgz https://launchpad.net/plone/4.2/4.2.1/+download/Plone-4.2.1-UnifiedInstaller.tgz

juju-log "Expanding tarball."
tar xzvf /tmp/Plone-4.2.1-UnifiedInstaller.tgz -C /tmp

juju-log "Installing."
/tmp/Plone-4.2.1-UnifiedInstaller/install.sh --target=/opt/ --with-python=/usr/bin/python2.7 standalone

juju-log "Cleaning up Plone tarball."
rm -rf /tmp/Plone-4.2.1-UnifiedInstaller.tgz /tmp/Plone-4.2.1-UnifiedInstaller

juju-log "Configuring Virtual Host."
export SERVER_ALIAS=plone.org
export SERVER_ADMIN=webmaster@plone.org
sed -e "s;%SERVER_ALIAS%;$SERVER_ALIAS;" -e "s;%SERVER_ADMIN%;$SERVER_ADMIN;" ../files/plone.site > /etc/apache2/sites-available/plone
a2ensite plone
a2enmod proxy
service apache2 restart

juju-log "Opening port 80."
open-port 80/tcp