
Apache's configuration for access control has changed on 2.4. To allow access to served directories we need to include the new directive "Require grant all". We scoped the configuration to only be applied on Apache 2.4. More information can be viewed on the Apache's upgrade document[1]. The tests were changed to ensure that the configuration is working without any extra override, as the extra test vhost is on a custom directory that requires the template to grant access to it. [1] http://httpd.apache.org/docs/trunk/upgrading.html Change-Id: I898ca049c5b3592cb70ad8c22eba8d4c681f3b22 Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com>
32 lines
971 B
Plaintext
32 lines
971 B
Plaintext
NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
|
<VirtualHost <%= @vhost_name %>:<%= @port %>>
|
|
<% if @ssl == true %>
|
|
SSLEngine on
|
|
SSLCertificateFile <%= @ssl_path %>/certs/pl.cert
|
|
SSLCertificateKeyFile <%= @ssl_path %>/private/pl.key
|
|
<% end %>
|
|
ServerName <%= @srvname %>
|
|
<% if @serveraliases.is_a? Array %>
|
|
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
|
|
<% elsif @serveraliases != nil %>
|
|
<%= " ServerAlias #{@serveraliases}" %>
|
|
<% end %>
|
|
ProxyRequests Off
|
|
<Proxy *>
|
|
Order deny,allow
|
|
Allow from all
|
|
<IfVersion >= 2.4>
|
|
Require all granted
|
|
</IfVersion>
|
|
</Proxy>
|
|
ProxyPass / <%= @dest %>/
|
|
ProxyPassReverse / <%= @dest %>/
|
|
ProxyPreserveHost On
|
|
|
|
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
|
|
LogLevel warn
|
|
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
|
|
|
|
</VirtualHost>
|
|
|