Skip to content

Commit

Permalink
added a new recipe for a wordpress cluster using RDS, bug fix in varn…
Browse files Browse the repository at this point in the history
…ish_reload for ubuntu natty
  • Loading branch information
Ryan Mark committed May 16, 2011
1 parent c41ecd9 commit cb4b646
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 35 deletions.
8 changes: 4 additions & 4 deletions assets/bin/varnish_reload
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

HOSTPORT=":6082"
HOST="localhost:6082"
NOW=`date +%s`
FILENAME=~/varnish/`hostname`.vcl

Expand All @@ -11,10 +11,10 @@ exit 1
}

if [ -f "$FILENAME" ]; then
varnishadm -T $HOSTPORT vcl.load reload$NOW $FILENAME || error
varnishadm -T $HOSTPORT vcl.use reload$NOW || error
varnishadm -T $HOST vcl.load reload$NOW $FILENAME || error
varnishadm -T $HOST vcl.use reload$NOW || error
echo "Current configs:"
varnishadm -T $HOSTPORT vcl.list
varnishadm -T $HOST vcl.list
else
error
fi
Expand Down
29 changes: 29 additions & 0 deletions boot-scripts/wordpress/admin-nfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{%extends 'wordpress/base.sh' %}

{% block install %}
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
apache2 \
php5 php5-mysql php5-gd php-pear libapache2-mod-php5 php-apc php5-curl \
mysql-client \
postfix

# enable mod_rewrite
a2enmod rewrite

# Install apache config
cp /home/$USERNAME/cloud-commander/wordpress/etc/apache2/apache2.conf /etc/apache2/apache2.conf
chown root:root /etc/apache2/apache2.conf
chmod 644 /etc/apache2/apache2.conf

# Needs a reboot -
{% include "_nfs-server.sh" %}

{% endblock %}

{% block finish %}
reboot
{% endblock %}
34 changes: 13 additions & 21 deletions config-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,19 @@

# Tree for picking images. Feel free to change, but be careful.
images:
us-east-1:
ubuntu:
'10.10':
64bit: ami-548c783d
32bit: ami-508c7839
'10.04':
64bit: ami-4a0df923
32bit: ami-480df921
us-west-1:
ubuntu:
'10.10':
64bit: ami-ca1f4f8f
32bit: ami-c81f4f8d
'10.04':
64bit: ami-880c5ccd
32bit: ami-8c0c5cc9
eu-west-1:
ubuntu:
'10.10':
32bit: ami-465c6932
64bit: ami-405c6934
us-east-1:
ubuntu:
'10.04': {32bit: ami-480df921, 64bit: ami-4a0df923}
'10.10': {32bit: ami-ccf405a5, 64bit: ami-cef405a7}
'11.04': {32bit: ami-06ad526f, 64bit: ami-1aad5273}
us-west-1:
ubuntu:
'10.04': {32bit: ami-8c0c5cc9, 64bit: ami-880c5ccd}
'10.10': {32bit: ami-c81f4f8d, 64bit: ami-ca1f4f8f}
'11.04': {32bit: ami-116f3c54, 64bit: ami-136f3c56}
eu-west-1:
ubuntu:
'10.10': {32bit: ami-465c6932, 64bit: ami-405c6934}


# Shortcut names for instance sizes. Because I can never remember
Expand Down
45 changes: 45 additions & 0 deletions recipes/wordpress-rds-staging-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
server:
- type: 'app'
name: 'app1.beta.wp'
hosts: 'cache, app1'
script: 'wordpress/app.sh'
size: 'small'
os: 'ubuntu'
version: '11.04'
arch: '32bit'
security_group: 'app-staging'
cluster: 'wordpress-staging'

- type: 'app'
name: 'app2.beta.wp'
hosts: 'app2'
script: 'wordpress/app.sh'
size: 'small'
os: 'ubuntu'
version: '11.04'
arch: '32bit'
security_group: 'app-staging'
cluster: 'wordpress-staging'

- type: 'admin'
name: 'admin.beta.wp'
hosts: 'admin, log, mail, cron, nfs'
script: 'wordpress/admin-nfs.sh'
size: 'small'
os: 'ubuntu'
version: '11.04'
arch: '32bit'
security_group: 'admin-staging'
cluster: 'wordpress-staging'

- type: 'lb'
name: 'lb.beta.wp'
hosts: 'lb'
script: 'wordpress/lb.sh'
size: 'small'
os: 'ubuntu'
version: '11.04'
arch: '32bit'
security_group: 'lb-staging'
cluster: 'wordpress-staging'

20 changes: 10 additions & 10 deletions recipes/wordpress-staging-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ server:
name: 'app1.beta.wp'
hosts: 'cache, app1'
script: 'wordpress/app.sh'
size: 'micro'
size: 'small'
os: 'ubuntu'
version: '10.10'
version: '11.04'
arch: '64bit'
security_group: 'app-staging'
cluster: 'wordpress-staging'
Expand All @@ -14,9 +14,9 @@ server:
name: 'app2.beta.wp'
hosts: 'app2'
script: 'wordpress/app.sh'
size: 'micro'
size: 'small'
os: 'ubuntu'
version: '10.10'
version: '11.04'
arch: '64bit'
security_group: 'app-staging'
cluster: 'wordpress-staging'
Expand All @@ -25,9 +25,9 @@ server:
name: 'db.beta.wp'
hosts: 'db, nfs'
script: 'wordpress/db.sh'
size: 'micro'
size: 'small'
os: 'ubuntu'
version: '10.10'
version: '11.04'
arch: '64bit'
security_group: 'db-staging'
cluster: 'wordpress-staging'
Expand All @@ -36,9 +36,9 @@ server:
name: 'admin.beta.wp'
hosts: 'admin, log, mail, cron'
script: 'wordpress/admin.sh'
size: 'micro'
size: 'small'
os: 'ubuntu'
version: '10.10'
version: '11.04'
arch: '64bit'
security_group: 'admin-staging'
cluster: 'wordpress-staging'
Expand All @@ -47,9 +47,9 @@ server:
name: 'lb.beta.wp'
hosts: 'lb'
script: 'wordpress/lb.sh'
size: 'micro'
size: 'small'
os: 'ubuntu'
version: '10.10'
version: '11.04'
arch: '64bit'
security_group: 'lb-staging'
cluster: 'wordpress-staging'
Expand Down

0 comments on commit cb4b646

Please sign in to comment.