puppetlabs-apache n00b question - docroot value for fully proxied virtual host?

163 views
Skip to first unread message

Paul BH

unread,
Sep 15, 2014, 9:26:57 AM9/15/14
to puppet...@googlegroups.com
Hi there,
pretty new to puppet so I'm guessing this is something simple. I'm trying to set up an apache virtual host that simply acts as a proxy to push all traffic on port 80 to a servlet running on 8080. I have this working on a non puppet managed server with this virtual host:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  ServerName ci.company.com
  ServerAlias ci
  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyPreserveHost on
  ProxyPass / http://localhost:8080/
</VirtualHost> 

The best I've managed so far using puppet is with this:

apache::vhost { 'ci.spex.com':
  port    => '80',
  proxy_pass => { 'path' => '/', 'url' => 'http://localhost:8080/'},
  docroot => '/some/path',
  default_vhost => true,
}

This works, but I'm curious what value I should set for docroot? As all traffic is proxied, I (believe) the value is irrelevant. Is there a way to tell the puppet module to not write out a docroot?

Cheers!

Paul

Antoine Cotten

unread,
Sep 16, 2014, 7:49:11 AM9/16/14
to puppet...@googlegroups.com
Unfortunately you can't. This is a restriction of Apache, which requires a docroot value for every vhost, and not of Puppet.

Hunter Haugen

unread,
Sep 17, 2014, 12:53:45 PM9/17/14
to puppet-users
Yeah, basically `$docroot` is still a required parameter because historically it was required (apache::vhost didn't do proxy stuff) and was never updated. If you want to make a PR that makes it default to `undef` and then raises helpful errors in cases when it is needed, then that would be great :).



-Hunter

On Tue, Sep 16, 2014 at 4:49 AM, Antoine Cotten <tonio....@gmail.com> wrote:
Unfortunately you can't. This is a restriction of Apache, which requires a docroot value for every vhost, and not of Puppet.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/8c6a00ee-3cb6-4193-936a-6acc771142ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Neil - Puppet List

unread,
Sep 17, 2014, 1:08:30 PM9/17/14
to PuppetList

Paul BH

unread,
Sep 25, 2014, 11:46:52 PM9/25/14
to puppet...@googlegroups.com, maillis...@iamafreeman.com
Thanks for this guys; sorry I hadn't seen these responses till now...

I'd gladly do a PR, but what would be the situation when its not required? Is it if @proxy_dest or @proxy_pass are set?

Secondly; my setup (running a jenkins box behind apache) also needs these directives set:

AllowEncodedSlashes NoDecode

and ProxyPass with the option nocanon:

ProxyPass / http://localhost:8080/ nocanon

Should I just add these to the same PR?

Reply all
Reply to author
Forward
0 new messages