Bruno Tavares faf9d932ba Fix proxy and redirect configuration file names.
While working on puppet-lodgeit acceptance tests we found that the
configuration file that `httpd::mod::proxy` creates was not being picked
up by Apache because it was missing the prefix `.conf`. This transition
is required to configure httpd modules correctly on Apache >= 2.4

To prevent Apache from loading two the same configuration twice, we
remove the file without extension, so this change does not affect
running systems.

This change has fixes for `httpd::mod::proxy` and `httpd::mod::redirect`
as they have the same issue. We added tests as well to increase the
confidence on the fix.

The acceptance will be fixed on the follow-up patch, as the redirect
grants are broken for 2.4 as well.

Change-Id: I82241038d687316f91f18209fe8323c12422e2f8
Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>
2015-10-19 15:43:51 -02:00

66 lines
1.3 KiB
Puppet

class { '::httpd': }
class { '::httpd::dev': }
class { '::httpd::php': }
class { '::httpd::mod::wsgi': }
class { '::httpd::ssl': }
httpd::vhost { 'localhost':
port => 80,
docroot => '/var/www',
priority => 50,
redirect_ssl => true,
}
# Enable a secondary port to test proxy and redirect modules
$override = '
Listen 8080
<Directory "/html">
Options All
AllowOverride All
Require all granted
Allow from all
</Directory>
'
file { "${::httpd::params::vdir}override.conf":
content => $override,
}
file { '/html':
ensure => directory,
mode => '0755',
}
file { '/html/acceptance.txt':
ensure => present,
mode => '0644',
content => 'Acceptance Test',
require => File['/html'],
}
httpd::vhost { 'acceptance-server':
servername => 'localhost',
port => 8080,
docroot => '/html',
priority => 50,
}
httpd::mod { 'proxy': ensure => present; }
httpd::mod { 'proxy_http': ensure => present; }
httpd::vhost::proxy { 'proxy':
port => 80,
dest => 'http://localhost:8080',
}
httpd::vhost::redirect { 'redirect':
port => 80,
dest => 'http://localhost:8080/acceptance.txt',
}
httpd::mod { 'rewrite':
ensure => present,
}
case $::operatingsystem {
'ubuntu', 'debian': {
class { '::httpd::python': }
}
default: {}
}