Skip to content
Snippets Groups Projects
Commit 57727842 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Don't generate NameVirtualHost directives for v2.4.

The NameVirtualHost directive has been deprecated since version 2.3.11
of httpd; now name-based virtual hosting is automatically enabled for
any IP/port combination used in more than one <VirtualHost> directive.
NameVirtualHost is now a no-op, but gives a warning on startup, so
don't generate those directives when running newer versions of httpd.
parent 8b997112
Branches
Tags
No related merge requests found
<% <%
httpd_version = scope.lookupvar('apache::standard_version')
server_names = [] server_names = []
server_addrs = [] server_addrs = []
[@urls].flatten.sort.each do |u| [@urls].flatten.sort.each do |u|
...@@ -57,8 +59,12 @@ ...@@ -57,8 +59,12 @@
## cfg << 'DocumentRoot ' + @documentroot ## cfg << 'DocumentRoot ' + @documentroot
## end ## end
-%> -%>
<% server_addrs.each do |addr| -%> <% if (httpd_version and httpd_version != '' and
scope.function_versioncmp([httpd_version, '2.3.11']) < 0)
server_addrs.each do |addr|
-%>
NameVirtualHost <%= addr %> NameVirtualHost <%= addr %>
<% end -%>
<% end -%> <% end -%>
<VirtualHost <%= server_addrs.join(' ') %>> <VirtualHost <%= server_addrs.join(' ') %>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment