Skip to content

Instantly share code, notes, and snippets.

@rasputnik
Created June 20, 2014 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasputnik/376b9e69426afa0f43bd to your computer and use it in GitHub Desktop.
Save rasputnik/376b9e69426afa0f43bd to your computer and use it in GitHub Desktop.
apache vhost template for graphite
# <%= @sysadmin_beware %>
# This configuration assumes the default installation prefix
# of /usr/share/graphite/
<% #grab some variables
wsgifile = scope.lookupvar("graphite::settings::wsgipath")
-%>
<IfModule !wsgi_module.c>
LoadModule wsgi_module modules/mod_wsgi.so
</IfModule>
WSGISocketPrefix run/wsgi
<VirtualHost *:80>
ServerAdmin <%= admin %>
ServerName <%= name %>
DocumentRoot <%= docroot %>
# I've found that an equal number of processes & threads tends
# to show the best performance for Graphite (ymmv).
WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
WSGIProcessGroup graphite
WSGIApplicationGroup %{GLOBAL}
WSGIImportScript <%= wsgifile -%> process-group=graphite application-group=%{GLOBAL}
WSGIScriptAlias / <%= wsgifile -%>
Alias /content/ <%= docroot -%>/content/
<Location "/content/">
SetHandler None
</Location>
Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
<Location "/media/">
SetHandler None
</Location>
# The graphite.wsgi file has to be accessible by apache. It won't
# be visible to clients because of the DocumentRoot though.
<Directory /usr/share/graphite/>
Order deny,allow
Allow from all
</Directory>
ErrorLog <%= logdir -%>/<%= name -%>-error.log
CustomLog <%= logdir -%>/<%= name -%>-access.log client-ip
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment