Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Apache tweaks #4

Merged
merged 2 commits into from

3 participants

@smith

A few changes for the web recipe:

  • Use the node['apache'] attributes instead of www-data.
  • Don't disable the default site. Not sure about a consensus on this, but I find it annoying when cookbooks disable this and I don't want to on a host. the ServerName directive is set anyway, so it shouldn't be an issue.
  • Remove the NameVirtualHost directive. The opscode apache cookbook sets this in ports.conf.
@dje

Looks good. Thanks.

@dje dje merged commit d1474bf into from
@hectcastro hectcastro commented on the diff
recipes/web.rb
((25 lines not shown))
end
-directory "/opt/graphite/storage/whisper" do
- owner "www-data"
- group "www-data"
+%w{ log webapp whisper }.each do |dir|

I haven't gotten an opportunity to test, but doesn't this change conflict with Graphite's vhost configuration?

https://github.com/heavywater/chef-graphite/blob/master/templates/default/graphite-vhost.conf.erb#L14-15

@smith
smith added a note

Good catch. #7 should address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2012
  1. @smith

    Apache tweaks

    smith authored
  2. @smith
This page is out of date. Refresh to see the latest.
View
16 recipes/carbon.rb
@@ -21,8 +21,8 @@
end
template "/opt/graphite/conf/carbon.conf" do
- owner "www-data"
- group "www-data"
+ owner node['apache']['user']
+ group node['apache']['group']
variables( :line_receiver_interface => node[:graphite][:carbon][:line_receiver_interface],
:pickle_receiver_interface => node[:graphite][:carbon][:pickle_receiver_interface],
:cache_query_interface => node[:graphite][:carbon][:cache_query_interface] )
@@ -30,12 +30,12 @@
end
template "/opt/graphite/conf/storage-schemas.conf" do
- owner "www-data"
- group "www-data"
+ owner node['apache']['user']
+ group node['apache']['group']
end
-execute "carbon: change graphite storage permissions to www-data" do
- command "chown -R www-data:www-data /opt/graphite/storage"
+execute "carbon: change graphite storage permissions to apache user" do
+ command "chown -R #{node['apache']['user']}:#{node['apache']['group']} /opt/graphite/storage"
only_if do
f = File.stat("/opt/graphite/storage")
f.uid == 0 and f.gid == 0
@@ -43,8 +43,8 @@
end
directory "/opt/graphite/lib/twisted/plugins/" do
- owner "www-data"
- group "www-data"
+ owner node['apache']['user']
+ group node['apache']['group']
end
runit_service "carbon-cache" do
View
30 recipes/web.rb
@@ -29,30 +29,18 @@
source "graphite-vhost.conf.erb"
end
-apache_site "000-default" do
- enable false
-end
-
apache_site "graphite"
-directory "/opt/graphite/storage/log" do
- owner "www-data"
- group "www-data"
-end
-
-directory "/opt/graphite/storage/log/webapp" do
- owner "www-data"
- group "www-data"
-end
-
directory "/opt/graphite/storage" do
- owner "www-data"
- group "www-data"
+ owner node['apache']['user']
+ group node['apache']['group']
end
-directory "/opt/graphite/storage/whisper" do
- owner "www-data"
- group "www-data"
+%w{ log webapp whisper }.each do |dir|

I haven't gotten an opportunity to test, but doesn't this change conflict with Graphite's vhost configuration?

https://github.com/heavywater/chef-graphite/blob/master/templates/default/graphite-vhost.conf.erb#L14-15

@smith
smith added a note

Good catch. #7 should address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ directory "/opt/graphite/storage/#{dir}" do
+ owner node['apache']['user']
+ group node['apache']['group']
+ end
end
cookbook_file "/opt/graphite/bin/set_admin_passwd.py" do
@@ -70,7 +58,7 @@
end
file "/opt/graphite/storage/graphite.db" do
- owner "www-data"
- group "www-data"
+ owner node['apache']['user']
+ group node['apache']['group']
mode "644"
end
View
4 templates/default/graphite-vhost.conf.erb
@@ -1,4 +1,6 @@
-NameVirtualHost *:80
+# Graphite Apache Virtual Host
+#
+# Generated by Chef
# You may need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
View
2  templates/default/sv-carbon-cache-run.erb
@@ -1,3 +1,3 @@
#!/bin/sh
exec 2>&1
-exec chpst -u www-data:www-data -l /opt/graphite/storage/carbon-cache.lock -- /opt/graphite/bin/carbon-cache.py --debug start
+exec chpst -u <%= node['apache']['user'] %>:<%= node['apache']['group'] %> -l /opt/graphite/storage/carbon-cache.lock -- /opt/graphite/bin/carbon-cache.py --debug start
Something went wrong with that request. Please try again.