This repository was archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathgraphite.conf.erb
More file actions
94 lines (81 loc) · 3.94 KB
/
Copy pathgraphite.conf.erb
File metadata and controls
94 lines (81 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# You need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
# you will need to change all the occurances of /opt/graphite/
# in this file to your chosen install location.
<IfModule mpm_prefork_module>
ServerLimit <%= scope.lookupvar('graphite::gr_graphiteweb_mpm_limit') %>
MaxRequestWorkers <%= scope.lookupvar('graphite::gr_graphiteweb_mpm_maxrequest') %>
</IfModule>
<IfModule !wsgi_module.c>
<%- if @osfamily == "Debian" -%>
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
<%- end -%>
<%- if @osfamily == "RedHat" -%>
LoadModule wsgi_module modules/mod_wsgi.so
<%- end -%>
</IfModule>
# XXX You need to set this up!
# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
WSGISocketPrefix <%= scope.lookupvar('graphite::params::apache_wsgi_socket_prefix') %>
<VirtualHost *:<%= scope.lookupvar('graphite::gr_web_server_port') %>>
ServerName <%= scope.lookupvar('graphite::gr_web_servername') %>
DocumentRoot "<%= scope.lookupvar('graphite::graphiteweb_webapp_dir_REAL') %>"
<% if ![nil, '', :undef].include?(scope.lookupvar('graphite::gr_apache_noproxy')) %> NoProxy <%= scope.lookupvar('graphite::gr_apache_noproxy') %><% end %>
ErrorLog <%= scope.lookupvar('graphite::gr_apache_logdir') %>/graphite-web-error.log
CustomLog <%= scope.lookupvar('graphite::gr_apache_logdir') %>/graphite-web-access.log common
# I've found that an equal number of processes & threads tends
# to show the best performance for Graphite (ymmv).
WSGIDaemonProcess graphite processes=<%= scope.lookupvar('graphite::wsgi_processes') -%> threads=<%= scope.lookupvar('graphite::wsgi_threads') -%> display-name='%{GROUP}' inactivity-timeout=<%= scope.lookupvar('graphite::wsgi_inactivity_timeout') %>
WSGIProcessGroup graphite
WSGIApplicationGroup %{GLOBAL}
WSGIImportScript <%= scope.lookupvar('graphite::graphiteweb_conf_dir_REAL') %>/graphite_wsgi.py process-group=graphite application-group=%{GLOBAL}
# XXX You will need to create this file! There is a graphite.wsgi.example
# file in this directory that you can safely use, just copy it to graphite.wgsi
WSGIScriptAlias / <%= scope.lookupvar('graphite::graphiteweb_conf_dir_REAL') %>/graphite_wsgi.py
Alias /content/ <%= scope.lookupvar('graphite::graphiteweb_webapp_dir_REAL') %>/content/
<Location ~ "/(content|static)/">
SetHandler None
<% if scope.lookupvar('graphite::gr_apache_24') %>
Options All
AllowOverride All
Require all granted
<% end %>
</Location>
# XXX In order for the django admin site media to work you
# must change @DJANGO_ROOT@ to be the path to your django
# installation, which is probably something like:
# /usr/lib/python2.6/site-packages/django
Alias /media/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media/"
<Location "/media/">
SetHandler None
<% if scope.lookupvar('graphite::gr_apache_24') %>
Options All
AllowOverride All
Require all granted
<% end %>
</Location>
# The graphite.wsgi file has to be accessible by apache. It won't
# be visible to clients because of the DocumentRoot though.
<Directory <%= scope.lookupvar('graphite::graphiteweb_conf_dir_REAL') %> >
<% if scope.lookupvar('graphite::gr_apache_24') %>
Options All
AllowOverride All
Require all granted
<% else %>
Order deny,allow
Allow from all
<% end %>
</Directory>
<% if scope.lookupvar('graphite::gr_web_cors_allow_from_all') %>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS, POST"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
<% end %>
<% if scope.lookupvar('graphite::gr_use_ssl') %>
SSLEngine on
SSLCertificateFile <%= scope.lookupvar('graphite::gr_ssl_cert') %>
SSLCertificateKeyFile <%= scope.lookupvar('graphite::gr_ssl_key') %>
SSLCACertificatePath <%= scope.lookupvar('graphite::gr_ssl_dir') %>
<% end %>
</VirtualHost>