Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Do not configure HTTPS virtual host, if ssl port == -1
Browse files Browse the repository at this point in the history
  • Loading branch information
sunruh committed Feb 2, 2015
1 parent 0d3eb79 commit 48fa086
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recipes/apache2.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['port'])
node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['ssl']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['ssl']['port'])
unless node['apache']['listen_ports'].include?(node['stash']['apache2']['ssl']['port']) || node['stash']['apache2']['ssl']['port'] == -1
node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['ssl']['port']]
end

include_recipe 'apache2'
include_recipe 'apache2::mod_proxy'
Expand Down
2 changes: 2 additions & 0 deletions templates/default/web_app.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
ProxyPassReverse / http://localhost:<%= node['stash']['tomcat']['port'] %>/
</VirtualHost>

<%- unless node['stash']['apache2']['ssl']['port'] == -1 %>
<VirtualHost *:<%= node['stash']['apache2']['ssl']['port'] %>>
<% unless node['stash']['apache2']['virtual_host_name'].empty? -%>
ServerName <%= node['stash']['apache2']['virtual_host_name'] %>
Expand Down Expand Up @@ -64,3 +65,4 @@
SSLCertificateChainFile <%= node['stash']['apache2']['ssl']['chain_file'] %>
<% end -%>
</VirtualHost>
<% end -%>

0 comments on commit 48fa086

Please sign in to comment.