Last active
September 19, 2016 22:54
-
-
Save cixelsyd/129e49b208c615c521f91c9579e8119d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WSGISocketPrefix /var/run/httpd | |
<VirtualHost *:80> | |
ServerName graphite.test.com | |
DocumentRoot /opt/graphite/webapp | |
WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 | |
WSGIProcessGroup graphite | |
WSGIApplicationGroup %{GLOBAL} | |
WSGIImportScript /opt/graphite/webapp/../conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL} | |
WSGIScriptAlias /graphite /opt/graphite/webapp/../conf/graphite.wsgi/graphite | |
# https://answers.launchpad.net/graphite/+question/264888 | |
Alias /graphite/static /opt/graphite/webapp/content | |
<Location "/graphite/static/"> | |
SetHandler None | |
</Location> | |
Alias /content/ /opt/graphite/webapp/content/ | |
<Location "/content/"> | |
SetHandler None | |
</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.7/site-packages/django/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 /opt/graphite/webapp/../conf/> | |
Require all granted | |
</Directory> | |
<Directory /opt/graphite/webapp/content > | |
Require all granted | |
Options FollowSymLinks | |
</Directory> | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
RewriteEngine On | |
LogLevel info rewrite:trace1 | |
ErrorLog /var/log/httpd/graphite_web-error.log | |
CustomLog /var/log/httpd/graphite_web-access.log combined | |
</VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
sys.path.append('/opt/graphite/webapp') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings' | |
import django.core.handlers.wsgi | |
application = django.core.handlers.wsgi.WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment