File graphite-web-path.patch of Package graphite-web
Index: graphite-web-1.1.8/conf/graphite.wsgi.example
===================================================================
--- graphite-web-1.1.8.orig/conf/graphite.wsgi.example
+++ graphite-web-1.1.8/conf/graphite.wsgi.example
@@ -2,6 +2,6 @@ import sys
# In case of multi-instance graphite, uncomment and set appropriate name
# import os
# os.environ['GRAPHITE_SETTINGS_MODULE'] = 'graphite.local_settings'
-sys.path.append('/opt/graphite/webapp')
+sys.path.append('/var/lib/graphite/webapp')
from graphite.wsgi import application
Index: graphite-web-1.1.8/distro/redhat/misc/postinstall
===================================================================
--- graphite-web-1.1.8.orig/distro/redhat/misc/postinstall
+++ graphite-web-1.1.8/distro/redhat/misc/postinstall
@@ -1,6 +1,6 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
-GRAPHITE_PATH=/opt/graphite
+GRAPHITE_PATH=/var/lib/graphite
CONFFILES="graphite.wsgi"
for i in $CONFFILES; do
Index: graphite-web-1.1.8/docs/admin-carbon.rst
===================================================================
--- graphite-web-1.1.8.orig/docs/admin-carbon.rst
+++ graphite-web-1.1.8/docs/admin-carbon.rst
@@ -6,8 +6,8 @@ Starting Carbon
---------------
Carbon can be started with the ``carbon-cache.py`` script::
- /opt/graphite/bin/carbon-cache.py start
+ /usr/lib/graphite/carbon-cache.py start
This starts the main Carbon daemon in the background. Now is a good time
-to check the logs, located in ``/opt/graphite/storage/log/carbon-cache/``
+to check the logs, located in ``/var/lib/graphite/storage/log/carbon-cache/``
for any errors.
Index: graphite-web-1.1.8/examples/example-graphite-vhost.conf
===================================================================
--- graphite-web-1.1.8.orig/examples/example-graphite-vhost.conf
+++ graphite-web-1.1.8/examples/example-graphite-vhost.conf
@@ -18,24 +18,28 @@
# XXX You need to set this up!
# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
# For example, create a directory /var/run/wsgi and use that.
-WSGISocketPrefix run/wsgi
+#WSGISocketPrefix run/wsgi
-<VirtualHost *:80>
+# SUSE:
+WSGISocketPrefix /srv/www/run
+Listen 8000
+
+<VirtualHost *:8000>
ServerName graphite
- DocumentRoot "/opt/graphite/webapp"
- ErrorLog /opt/graphite/storage/log/webapp/error.log
- CustomLog /opt/graphite/storage/log/webapp/access.log common
+ DocumentRoot "/var/lib/graphite/webapp"
+ ErrorLog /var/log/graphite/webapp/error.log
+ CustomLog /var/log/graphite/webapp/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=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
WSGIProcessGroup graphite
WSGIApplicationGroup %{GLOBAL}
- WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL}
+ WSGIImportScript /var/lib/graphite/conf/graphite.wsgi 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 / /opt/graphite/conf/graphite.wsgi
+ WSGIScriptAlias / /var/lib/graphite/conf/graphite.wsgi
# XXX To serve static files, either:
@@ -43,7 +47,7 @@ WSGISocketPrefix run/wsgi
# * Collect static files in a directory by running:
# django-admin.py collectstatic --noinput --settings=graphite.settings
# And set an alias to serve static files with Apache:
- Alias /static/ /opt/graphite/static/
+ Alias /static/ /var/lib/graphite/webapp/content/
########################
# URL-prefixed install #
@@ -51,8 +55,8 @@ WSGISocketPrefix run/wsgi
# If using URL_PREFIX in local_settings for URL-prefixed install (that is not located at "/"))
# your WSGIScriptAlias line should look like the following (e.g. URL_PREFX="/graphite"
- # WSGIScriptAlias /graphite /srv/graphite-web/conf/graphite.wsgi/graphite
- # Alias /graphite/static /opt/graphite/webapp/content
+ # WSGIScriptAlias /graphite /var/lib/graphite/conf/graphite.wsgi
+ # Alias /graphite/static /var/lib/graphite/webapp/content
# <Location "/graphite/static/">
# SetHandler None
# </Location>
@@ -66,7 +70,19 @@ WSGISocketPrefix run/wsgi
# 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/conf/>
+ <Directory /var/lib/graphite/conf/>
+ Options SymLinksIfOwnerMatch
+ <IfVersion < 2.4>
+ Order deny,allow
+ Allow from all
+ </IfVersion>
+ <IfVersion >= 2.4>
+ Require all granted
+ </IfVersion>
+ </Directory>
+
+ <Directory /var/lib/graphite/webapp/content/>
+ Options SymLinksIfOwnerMatch
<IfVersion < 2.4>
Order deny,allow
Allow from all
Index: graphite-web-1.1.8/webapp/graphite/local_settings.py.example
===================================================================
--- graphite-web-1.1.8.orig/webapp/graphite/local_settings.py.example
+++ graphite-web-1.1.8/webapp/graphite/local_settings.py.example
@@ -104,31 +104,31 @@ DEFAULT_XFILES_FACTOR = 0
#
# Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
# to somewhere else
-#GRAPHITE_ROOT = '/opt/graphite'
+GRAPHITE_ROOT = '/var/lib//graphite'
# Most installs done outside of a separate tree such as /opt/graphite will
# need to change these settings. Note that the default settings for each
# of these is relative to GRAPHITE_ROOT.
-#CONF_DIR = '/opt/graphite/conf'
-#STORAGE_DIR = '/opt/graphite/storage'
-#STATIC_ROOT = '/opt/graphite/static'
-#LOG_DIR = '/opt/graphite/storage/log/webapp'
-#INDEX_FILE = '/opt/graphite/storage/index' # Search index file
+CONF_DIR = '/etc/graphite'
+STORAGE_DIR = '/var/lib/graphite/storage'
+STATIC_ROOT = '/var/lib/graphite/static'
+LOG_DIR = '/var/log/graphite'
+INDEX_FILE = '/var/lib/graphite/storage/index' # Search index file
# To further or fully customize the paths, modify the following. Note that the
# default settings for each of these are relative to CONF_DIR and STORAGE_DIR
#
## Webapp config files
-#DASHBOARD_CONF = '/opt/graphite/conf/dashboard.conf'
-#GRAPHTEMPLATES_CONF = '/opt/graphite/conf/graphTemplates.conf'
+DASHBOARD_CONF = '/etc/graphite/dashboard.conf'
+GRAPHTEMPLATES_CONF = '/etc/graphite/graphTemplates.conf'
## Data directories
#
# NOTE: If any directory is unreadable in STANDARD_DIRS it will break metric browsing
#
-#CERES_DIR = '/opt/graphite/storage/ceres'
-#WHISPER_DIR = '/opt/graphite/storage/whisper'
-#RRD_DIR = '/opt/graphite/storage/rrd'
+#CERES_DIR = '/var/lib/graphite/storage/ceres'
+WHISPER_DIR = '/var/lib/graphite/storage/whisper'
+RRD_DIR = '/var/lib/graphite/storage/rrd'
#
# Data directories using the "Standard" metrics finder (i.e. not Ceres)
#STANDARD_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
@@ -248,7 +248,7 @@ DEFAULT_XFILES_FACTOR = 0
#
#DATABASES = {
# 'default': {
-# 'NAME': '/opt/graphite/storage/graphite.db',
+# 'NAME': '/var/lib/graphite/storage/graphite.db',
# 'ENGINE': 'django.db.backends.sqlite3',
# 'USER': '',
# 'PASSWORD': '',
@@ -356,7 +356,7 @@ DEFAULT_XFILES_FACTOR = 0
# A "keyfunc" is a user-defined python function that is given a metric name
# and returns a string that should be used when hashing the metric name.
# This is important when your hashing has to respect certain metric groupings.
-#CARBONLINK_HASHING_KEYFUNC = "/opt/graphite/bin/keyfuncs.py:my_keyfunc"
+#CARBONLINK_HASHING_KEYFUNC = "/usr/lib/graphite/keyfuncs.py:my_keyfunc"
# Prefix for internal carbon statistics.
#CARBON_METRIC_PREFIX='carbon'
Index: graphite-web-1.1.8/webapp/tests/test_finders.py
===================================================================
--- graphite-web-1.1.8.orig/webapp/tests/test_finders.py
+++ graphite-web-1.1.8/webapp/tests/test_finders.py
@@ -342,7 +342,7 @@ class StandardFinderTest(TestCase):
@patch('os.path.realpath', wraps=dummy_realpath)
def test_get_real_metric_path_symlink_inside(self, dummy_realpath):
- input_abs_path='/opt/graphite/storage/whisper/some/symbolic/path/NumConnections.wsp'
+ input_abs_path='/var/lib/graphite/storage/whisper/some/symbolic/path/NumConnections.wsp'
input_metric_path='some.symbolic.path.NumConnections'
expected_metric_path='this.is.the.real.path.NumConnections'
output_metric_path = get_real_metric_path(input_abs_path, input_metric_path)