Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from cramerdev/apache

Apache tweaks
  • Loading branch information...
commit d1474bf6723b796b5ff6a62b53f732fbda1ccd2e 2 parents 212a1a1 + 20a8dc4
@dje dje authored
View
16 recipes/carbon.rb
@@ -22,8 +22,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] )
@@ -31,12 +31,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
@@ -44,8 +44,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
@@ -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
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
Please sign in to comment.
Something went wrong with that request. Please try again.