Merge lp:~marcoceppi/charms/oneiric/wordpress/haproxy-patch into lp:charms/oneiric/wordpress

Proposed by Marco Ceppi
Status: Work in progress
Proposed branch: lp:~marcoceppi/charms/oneiric/wordpress/haproxy-patch
Merge into: lp:charms/oneiric/wordpress
Diff against target: 40 lines (+8/-0)
1 file modified
hooks/db-relation-changed (+8/-0)
To merge this branch: bzr merge lp:~marcoceppi/charms/oneiric/wordpress/haproxy-patch
Reviewer Review Type Date Requested Status
Clint Byrum (community) Needs Resubmitting
Review via email: mp+98073@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Lets hold off of this until we have a new Wordpress charm.

review: Needs Resubmitting

Unmerged revisions

52. By Marco Ceppi

Added internal hostname

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/db-relation-changed'
2--- hooks/db-relation-changed 2011-10-14 10:22:29 +0000
3+++ hooks/db-relation-changed 2012-03-17 22:58:19 +0000
4@@ -5,10 +5,12 @@
5 UPLOAD_PATH="/var/www/wp-uploads"
6
7 hostname=`unit-get public-address`
8+private_hostname=`hostname -f`
9 juju-log "Retrieved hostname: $hostname"
10
11 # Check we haven't already been setup.
12 config_file_path="/etc/wordpress/config-$hostname.php"
13+private_config_file_path="/etc/wordpress/config-$private_hostname"
14 if [ -f "$config_file_path" ] ; then
15 juju-log "Wordpress for site $config_file_path already Configured, exiting"
16 echo "Already Configured, Exiting"
17@@ -70,10 +72,12 @@
18 # Write the apache config
19 # XXX a future branch will change this to use augtool
20 apache_config_file_path="/etc/apache2/sites-available/$hostname"
21+apache_config_file_path="/etc/apache2/sites-available/$hostname"
22 juju-log "Writing apache config file $apache_config_file_path"
23 cat > $apache_config_file_path <<EOF
24 <VirtualHost *:80>
25 ServerName $hostname
26+ ServerAlias $private_hostname
27 DocumentRoot /var/www/$hostname
28 Options All
29 ErrorLog /var/log/apache2/wp-error.log
30@@ -85,6 +89,10 @@
31 EOF
32 chmod 0644 $apache_config_file_path
33
34+if [ ! -e "$private_config_file_path" ]; then
35+ ln -s $config_file_path $private_config_file_path
36+fi
37+
38 # Configure apache
39 juju-log "Enabling apache modules: rewrite, vhost_alias"
40 a2enmod rewrite

Subscribers

People subscribed via source and target branches

to all changes: