Merge lp:~abentley/charms/precise/charmworld/apache2 into lp:~juju-jitsu/charms/precise/charmworld/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 37
Proposed branch: lp:~abentley/charms/precise/charmworld/apache2
Merge into: lp:~juju-jitsu/charms/precise/charmworld/trunk
Diff against target: 66 lines (+29/-2)
5 files modified
README.md (+9/-1)
hooks/reverseproxy-relation-joined (+3/-0)
metadata.yaml (+2/-0)
revision (+1/-1)
scripts/configure-apache2 (+14/-0)
To merge this branch: bzr merge lp:~abentley/charms/precise/charmworld/apache2
Reviewer Review Type Date Requested Status
Juju-Jitsu Hackers Pending
Review via email: mp+146490@code.launchpad.net

Description of the change

Support apache2 frontend

Allow apache2 to be used as a reverse proxy by supporting the reverseproxy
relation. Add config script and update docs for setting up apache2 properly.

https://codereview.appspot.com/7271047/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

lgtm with a couple of questions. I figure this will probably need some
testing/etc to get it working 100% right.

https://codereview.appspot.com/7271047/diff/1/README.md
File README.md (right):

https://codereview.appspot.com/7271047/diff/1/README.md#newcode29
README.md:29: juju deploy local:apache2
Doesn't this need to point to a path with the right stucture? Should
that be documented?

Or is it picked up without the --repository as long as it's in the cwd?

https://codereview.appspot.com/7271047/diff/1/scripts/configure-apache2
File scripts/configure-apache2 (right):

https://codereview.appspot.com/7271047/diff/1/scripts/configure-apache2#newcode6
scripts/configure-apache2:6: ServerName staging.jujucharms.com
This hard coding of a server name seems like trouble. I wonder if this
can be removed, made to pull from the environment somehow, or does it
need to be a config option as well? It seems like IS should have had to
do this themselves so curious if they've got an answer already.

https://codereview.appspot.com/7271047/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2013-01-24 15:46:55 +0000
3+++ README.md 2013-02-04 18:41:34 +0000
4@@ -22,9 +22,17 @@
5
6 juju add-relation charmworld mongodb
7
8+Add an Apache proxy
9+
10+ # You'll need a local repository with a copy of
11+ # lp:~canonical-losas/canonical-marshal/apache2
12+ juju deploy local:apache2
13+ scripts/configure-apache2
14+ juju add-relation apache2:reverseproxy charmworld
15+
16 Finally, expose charmworld to the Internet
17
18- juju expose charmworld
19+ juju expose apache2
20
21 You should now be able to get to charmworld via the IP address provided in the
22 output of `juju status`.
23
24=== added file 'hooks/reverseproxy-relation-joined'
25--- hooks/reverseproxy-relation-joined 1970-01-01 00:00:00 +0000
26+++ hooks/reverseproxy-relation-joined 2013-02-04 18:41:34 +0000
27@@ -0,0 +1,3 @@
28+#!/bin/sh
29+set -eux
30+relation-set port=80
31
32=== modified file 'metadata.yaml'
33--- metadata.yaml 2013-01-31 20:03:15 +0000
34+++ metadata.yaml 2013-02-04 18:41:34 +0000
35@@ -12,3 +12,5 @@
36 requires:
37 database:
38 interface: mongodb
39+ reverseproxy:
40+ interface: http
41
42=== modified file 'revision'
43--- revision 2013-01-30 20:34:57 +0000
44+++ revision 2013-02-04 18:41:34 +0000
45@@ -1,1 +1,1 @@
46-19
47+20
48
49=== added file 'scripts/configure-apache2'
50--- scripts/configure-apache2 1970-01-01 00:00:00 +0000
51+++ scripts/configure-apache2 2013-02-04 18:41:34 +0000
52@@ -0,0 +1,14 @@
53+#!/bin/sh
54+set +eux
55+juju set apache2 "enable_modules=proxy proxy_http"
56+juju set apache2 "vhost_http_template=$(base64 <<EOT
57+<VirtualHost *:80>
58+ ServerName staging.jujucharms.com
59+ CustomLog /var/log/apache2/charmworld-access.log combined
60+ ErrorLog /var/log/apache2/charmworld-error.log
61+ ProxyRequests off
62+ ProxyPass / http://{{ charmworld }}/
63+ ProxyPassReverse / http://{{ charmworld }}/
64+</VirtualHost>
65+EOT
66+)"

Subscribers

People subscribed via source and target branches

to all changes: