Fix httpd apply in Ubuntu Precise

Alteration of the Apache configuration for apply in the Ubuntu Precise.

It was changed for mod_disk_cache because mod_cache_disk not exist for the
Precise and check Apache Version due the parameter "Require all Granted".

Change-Id: Icc1d13fc39058f147bdbb1e6b9a810143051ece4
Co-Authored-By: Maitê Balhester <mbalhest@thoughtworks.com>
This commit is contained in:
Danilo Ramalho 2015-11-16 22:22:38 -02:00 committed by Maitê Balhester
parent c4600ed6e1
commit 10bb4095f0
3 changed files with 20 additions and 6 deletions

View File

@ -71,8 +71,14 @@ class openstack_health::api(
ensure => present, ensure => present,
} }
} }
if ! defined(Httpd::Mod['cache_disk']) {
httpd::mod { 'cache_disk': if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '12.04' {
$cache_disk_module = 'disk_cache'
} else {
$cache_disk_module = 'cache_disk'
}
if ! defined(Httpd::Mod[$cache_disk_module]) {
httpd::mod { $cache_disk_module:
ensure => present, ensure => present,
} }
} }

View File

@ -20,17 +20,23 @@ WSGIPythonHome <%= scope.lookupvar("openstack_health::api::virtualenv_dir") %>
Order allow,deny Order allow,deny
Allow from all Allow from all
Require all granted <IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory> </Directory>
<IfModule mod_cache.c> <IfModule mod_cache.c>
<IfModule mod_cache_disk.c> <% if @operatingsystem == "Ubuntu" and @operatingsystemrelease == "12.04" %>
<IfModule mod_disk_cache.c>
<% else %>
<IfModule mod_cache_disk.c>
<% end %>
CacheRoot "/var/cache/apache2/mod_disk_cache" CacheRoot "/var/cache/apache2/mod_disk_cache"
CacheEnable disk "/" CacheEnable disk "/"
CacheDirLevels 5 CacheDirLevels 5
CacheDirLength 3 CacheDirLength 3
CacheLock on CacheLock on
</IfModule> </IfModule>
</IfModule> </IfModule>
DocumentRoot <%= scope.lookupvar("openstack_health::api::api_dir") %> DocumentRoot <%= scope.lookupvar("openstack_health::api::api_dir") %>

View File

@ -12,7 +12,9 @@ Listen <%= @vhost_port %>
<Directory <%= @frontend_dir %>> <Directory <%= @frontend_dir %>>
Order allow,deny Order allow,deny
Allow from all Allow from all
Require all granted <IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory> </Directory>
DocumentRoot <%= @frontend_dir %> DocumentRoot <%= @frontend_dir %>