diff --git a/.gitignore b/.gitignore index 32c4421..77cbe8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,10 @@ -.project -.buildpath \ No newline at end of file +.vagrant +Berksfile.lock +Gemfile.lock +*~ +*# +.#* +\#*# +.*.sw[a-z] +*.un~ +/cookbooks diff --git a/attributes/default.rb b/attributes/default.rb index 52dcc7c..9704601 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -32,3 +32,4 @@ default['sonar']['java_command'] = "java" default['sonar']['logfile_maxsize'] = "0" default['sonar']['syslog_loglevel'] = "NONE" +default['sonar']['enable_mod_proxy_ajp'] = false diff --git a/recipes/proxy_apache.rb b/recipes/proxy_apache.rb index 1d2075c..c8363e9 100644 --- a/recipes/proxy_apache.rb +++ b/recipes/proxy_apache.rb @@ -38,20 +38,13 @@ include_recipe "apache2" -template "sonar_server.conf" do - path "#{node[:nginx][:dir]}/sites-enabled/" - source "apache_site_#{node['sonar']['web_template']}.erb" - owner "root" - group "root" - mode 0644 -end - if node['sonar']['enable_mod_proxy_ajp'] == true include_recipe "apache2::mod_proxy_ajp" else include_recipe "apache2::mod_proxy" end -apache_site "sonar_server.conf" do - enable :true -end \ No newline at end of file +web_app node['sonar]['web_domain'] do + template "apache_site_#{node['sonar']['web_template']}.erb" + server_name node['sonar']['web_domain'] +end diff --git a/templates/default/apache_site_default.erb b/templates/default/apache_site_default.erb index 4e70d88..e2df6c2 100644 --- a/templates/default/apache_site_default.erb +++ b/templates/default/apache_site_default.erb @@ -1,10 +1,12 @@ ProxyRequests Off ProxyPreserveHost On - ServerName <%= node['sonar']['web_domain'] %> - ServerAdmin admin@<%= node['sonar']['web_domain'] %> + ServerName <%= @params[:server_name] %> + ServerAdmin <%= node[:apache][:contact] %> ProxyPass / http://<%= node['sonar']['web_host'] %>:<%= node['sonar']['web_port'] %>/ ProxyPassReverse / http://<%= node['sonar']['web_host'] %>:<%= node['sonar']['web_port'] %>/ - ErrorLog logs/<%= node['sonar']['web_domain'] %>/sonar/error.log - CustomLog logs/<%= node['sonar']['web_domain'] %>/sonar/access.log common - \ No newline at end of file + + LogLevel warn + CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined + ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log + diff --git a/templates/default/sonar.properties.erb b/templates/default/sonar.properties.erb index f5e3e61..813982c 100644 --- a/templates/default/sonar.properties.erb +++ b/templates/default/sonar.properties.erb @@ -120,7 +120,7 @@ sonar.jdbc.timeBetweenEvictionRunsMillis: 30000 # The Update Center requires an internet connection to request http://update.sonarsource.org # It is activated by default: -#sonar.updatecenter.activate=true +sonar.updatecenter.activate=true # HTTP proxy (default none) #http.proxyHost=