Question about puppet-apache

112 views
Skip to first unread message

Fabio Surrage

unread,
Jan 23, 2015, 8:58:50 AM1/23/15
to puppet...@googlegroups.com

Hello,

Im using the module puppet-apache to configure a machine with django (python/wsgi).

In the Puppet server, I tried:

  class { 'apache':  }

  include apache::mod::wsgi

  apache::vhost { '*':
    servername            => '...',
    port                  => '80',
    docroot               => '/var/www/djangoDeploy',
    directories           =>  [ { 'path'     => 'wsgi.py',
                                  'provider' => 'files',
                                  'allow'    => 'from all'
                              }, ],
    wsgi_script_aliases   => {'/djangoDeploy' => '/var/www/djangoDeploy/wsgi.py'},
  }

Then I got:

<VirtualHost *:80>
  ServerName ...

  ## Vhost docroot
  DocumentRoot "/var/www/djangoDeploy"

  <Files "wsgi.py">
    Require all granted
  </Files>
  ...

  WSGIScriptAlias /djangoDeploy "/var/www/djangoDeploy/wsgi.py"
</VirtualHost>

But what I need is:

<VirtualHost *:80>
  ServerName ...
  WSGIScriptAlias /djangoDeploy /var/www/djangoDeploy/wsgi.py

  <Directory /var/www/djangoDeploy>
    <Files wsgi.py>
      Order deny,allow
      Allow from all
    </Files>
  </Directory>

Any tips for me ? Thanks in advance !

Tony Thayer

unread,
Jan 23, 2015, 12:46:48 PM1/23/15
to puppet...@googlegroups.com
You'll probably want to use a custom code fragment for that chunk.
  class { 'apache':  }

  include apache::mod::wsgi

  apache::vhost { '*':
    servername            => '...',
    port                  => '80',
    docroot               => '/var/www/djangoDeploy',
    directories           =>  [ { 'path'     => '/var/www/djangoDeploy',}, ],
        custom_fragment                    => '
        <Files wsgi.py>
      Order deny,allow
      Allow from all
    </Files>
        ',
Reply all
Reply to author
Forward
0 new messages