Skip to content
Browse files

`chef-server/templates/default/chef_server.conf.erb`

- use symbols for `@params[...]` rather than strings because `@params` is a `Hash` not a `Mash`
- `port` should be `:api_port` (line 15) because the local variable `port` is not defined
- use `'chef-server-proxy'` rather than `@params[:server_name]` (which is `'localhost'`) (lines 25-26, 6-61) because that's the certificate name as defined in `chef-server/recipes/apache-proxy.rb` (`bash[Create SSL Certificates]`)
  • Loading branch information...
1 parent 51ef5b1 commit f6e426f8d00feeb6d55d9abf60bbc178382d04e0 @yfeldblum yfeldblum committed with Jun 17, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 templates/default/chef_server.conf.erb
View
26 templates/default/chef_server.conf.erb
@@ -1,7 +1,7 @@
# Server Proxy for API
<VirtualHost *:443>
- ServerName <%= @params['server_name'] %>
- ServerAlias <% @params['server_aliases'].each do |a| %><%= "#{a}" %> <% end %>
+ ServerName <%= @params[:server_name] %>
+ ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
DocumentRoot <%= node['chef_server']['doc_root'] %>
@@ -12,19 +12,19 @@
ExpiresByType application/javascript "access plus <%= node['chef_server']['proxy']['js_expire_hours'] %> hours"
<Proxy balancer://chef_server>
- BalancerMember http://127.0.0.1:<%= node['chef_server'][port] %>
+ BalancerMember http://127.0.0.1:<%= node['chef_server']['api_port'] %>
ProxySet maxattempts=2
Order deny,allow
Allow from all
</Proxy>
LogLevel info
- ErrorLog <%= @params['log_dir'] %>/<%= @params['name'] %>-error.log
- CustomLog <%= @params['log_dir'] %>/<%= @params['name'] %>-access.log combined
+ ErrorLog <%= @params[:log_dir] %>/<%= @params[:name] %>-error.log
+ CustomLog <%= @params[:log_dir] %>/<%= @params[:name] %>-access.log combined
SSLEngine On
- SSLCertificateFile /etc/chef/certificates/<%= @params['server_name'] %>.pem
- SSLCertificateKeyFile /etc/chef/certificates/<%= @params['server_name'] %>.pem
+ SSLCertificateFile /etc/chef/certificates/chef-server-proxy.pem
+ SSLCertificateKeyFile /etc/chef/certificates/chef-server-proxy.pem
RequestHeader set X_FORWARDED_PROTO 'https'
@@ -36,8 +36,8 @@
<% if node['chef_server']['webui_enabled'] -%>
# Server Proxy for WebUI
<VirtualHost *:444>
- ServerName <%= @params['server_name'] %>
- ServerAlias <% @params['server_aliases'].each do |a| %><%= "#{a}" %> <% end %>
+ ServerName <%= @params[:server_name] %>
+ ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
DocumentRoot <%= node['chef_server']['doc_root'] %>
@@ -55,12 +55,12 @@
</Proxy>
LogLevel info
- ErrorLog <%= @params['log_dir'] %>/<%= @params['name'] %>-error.log
- CustomLog <%= @params['log_dir'] %>/<%= @params['name'] %>-access.log combined
+ ErrorLog <%= @params[:log_dir] %>/<%= @params[:name] %>-error.log
+ CustomLog <%= @params[:log_dir] %>/<%= @params[:name] %>-access.log combined
SSLEngine On
- SSLCertificateFile /etc/chef/certificates/<%= @params['server_name'] %>.pem
- SSLCertificateKeyFile /etc/chef/certificates/<%= @params['server_name'] %>.pem
+ SSLCertificateFile /etc/chef/certificates/chef-server-proxy.pem
+ SSLCertificateKeyFile /etc/chef/certificates/chef-server-proxy.pem
RequestHeader set X_FORWARDED_PROTO 'https'

0 comments on commit f6e426f

Please sign in to comment.
Something went wrong with that request. Please try again.