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
=== modified file 'hooks/db-relation-changed'
--- hooks/db-relation-changed 2011-10-14 10:22:29 +0000
+++ hooks/db-relation-changed 2012-03-17 22:58:19 +0000
@@ -5,10 +5,12 @@
5UPLOAD_PATH="/var/www/wp-uploads"5UPLOAD_PATH="/var/www/wp-uploads"
66
7hostname=`unit-get public-address`7hostname=`unit-get public-address`
8private_hostname=`hostname -f`
8juju-log "Retrieved hostname: $hostname"9juju-log "Retrieved hostname: $hostname"
910
10# Check we haven't already been setup.11# Check we haven't already been setup.
11config_file_path="/etc/wordpress/config-$hostname.php"12config_file_path="/etc/wordpress/config-$hostname.php"
13private_config_file_path="/etc/wordpress/config-$private_hostname"
12if [ -f "$config_file_path" ] ; then14if [ -f "$config_file_path" ] ; then
13 juju-log "Wordpress for site $config_file_path already Configured, exiting"15 juju-log "Wordpress for site $config_file_path already Configured, exiting"
14 echo "Already Configured, Exiting"16 echo "Already Configured, Exiting"
@@ -70,10 +72,12 @@
70# Write the apache config72# Write the apache config
71# XXX a future branch will change this to use augtool73# XXX a future branch will change this to use augtool
72apache_config_file_path="/etc/apache2/sites-available/$hostname"74apache_config_file_path="/etc/apache2/sites-available/$hostname"
75apache_config_file_path="/etc/apache2/sites-available/$hostname"
73juju-log "Writing apache config file $apache_config_file_path"76juju-log "Writing apache config file $apache_config_file_path"
74cat > $apache_config_file_path <<EOF77cat > $apache_config_file_path <<EOF
75<VirtualHost *:80>78<VirtualHost *:80>
76 ServerName $hostname79 ServerName $hostname
80 ServerAlias $private_hostname
77 DocumentRoot /var/www/$hostname81 DocumentRoot /var/www/$hostname
78 Options All82 Options All
79 ErrorLog /var/log/apache2/wp-error.log83 ErrorLog /var/log/apache2/wp-error.log
@@ -85,6 +89,10 @@
85EOF89EOF
86chmod 0644 $apache_config_file_path90chmod 0644 $apache_config_file_path
8791
92if [ ! -e "$private_config_file_path" ]; then
93 ln -s $config_file_path $private_config_file_path
94fi
95
88# Configure apache96# Configure apache
89juju-log "Enabling apache modules: rewrite, vhost_alias"97juju-log "Enabling apache modules: rewrite, vhost_alias"
90a2enmod rewrite98a2enmod rewrite

Subscribers

People subscribed via source and target branches

to all changes: