Permalink
Browse files

Merge pull request #4 from cramerdev/apache

Apache tweaks
  • Loading branch information...
2 parents 212a1a1 + 20a8dc4 commit d1474bf6723b796b5ff6a62b53f732fbda1ccd2e @dje dje committed Apr 21, 2012
Showing with 21 additions and 31 deletions.
  1. +8 −8 recipes/carbon.rb
  2. +9 −21 recipes/web.rb
  3. +3 −1 templates/default/graphite-vhost.conf.erb
  4. +1 −1 templates/default/sv-carbon-cache-run.erb
View
@@ -22,30 +22,30 @@
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] )
notifies :restart, "service[carbon-cache]"
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
end
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,30 +30,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|
+ 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
@@ -71,7 +59,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
@@ -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
@@ -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

0 comments on commit d1474bf

Please sign in to comment.