how to manage apache ProxyPass

500 views
Skip to first unread message

yatesco

unread,
Jul 5, 2010, 7:41:20 AM7/5/10
to Puppet Users
Hi,

I cannot quite figure this out, but it seems possible.

I have a single apache server (apache.mydomain.com) and a number of
(tomcat) application servers (as1..com, as2..com etc.)

I have apache configured so https://apache...com/as1 gets
(proxy)passed to as1.com:8080/as1.

This is working fine, for example:

-- start conf

<VirtualHost _default_:443>
ServerAdmin test-www@XXX


<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyRequests Off
ProxyPreserveHost On

ProxyPass /as1 http://as1...com:8080/as1
ProxyPassReverse /as2 http://as1...com:8080/as1

ProxyPass /as2 http://as2...com:8080/as2
ProxyPassReverse /as2 http://as2...com:8080/as2

--end conf

Note: I cannot have multiple vhosts as they are all part of a single
host.

My question is what should I put in the puppet nodes for apache.pp and
as1.pp, as2.pp etc. to get this to work successfully?

I have looked at exported resources but that seems to only work for
individual files. I could create a bash script which generates the
apache config using one proxyPass for each file where the file name is
the name of context path but blurgh.

I am sure I have missed something obvious ;) Any pointers?

Daniel Pittman

unread,
Jul 5, 2010, 9:36:33 AM7/5/10
to puppet...@googlegroups.com
yatesco <colin...@gmail.com> writes:

> I cannot quite figure this out, but it seems possible.

[...]

> My question is what should I put in the puppet nodes for apache.pp and
> as1.pp, as2.pp etc. to get this to work successfully?

Use the 'concat' tool written by R.I.Pienaar[1] to build the vhost file from
individual parts. You can then ...

> I have looked at exported resources but that seems to only work for
> individual files.

... export the individual fragments that get assembled into the whole thing.

[...]

> I am sure I have missed something obvious ;) Any pointers?

No, you didn't miss anything: there isn't a solution shipped with puppet, but
only something like the module I mention.

Regards,
Daniel

Footnotes:
[1] http://www.devco.net/archives/2010/05/07/puppet_concat_20100507.php
http://www.devco.net/archives/2010/03/12/puppet_concat_20100312.php

--
✣ Daniel Pittman ✉ dan...@rimspace.net+61 401 155 707
♽ made with 100 percent post-consumer electrons

yatesco

unread,
Jul 5, 2010, 9:56:41 AM7/5/10
to Puppet Users
Cheers - I will take a look.

On Jul 5, 2:36 pm, Daniel Pittman <dan...@rimspace.net> wrote:
Reply all
Reply to author
Forward
0 new messages