Browse files

more minor deployment fixes

  • Loading branch information...
1 parent cc98f6d commit 5c447b1c50c04b01eff4aedbc2cb2856acfa1f27 @cdavis cdavis committed Sep 14, 2009
Showing with 83 additions and 12 deletions.
  1. +32 −7 INSTALL
  2. +2 −0
  3. +2 −3 README
  4. +1 −1 bin/
  5. +38 −0 example-graphite-vhost.conf
  6. +1 −1
  7. +7 −0 webapp/graphite/templates/500.html
@@ -16,9 +16,8 @@ Graphite requires:
python2.4 or greater
whisper (available for download on the graphite project page)
pycairo (with PNG backend support)
- mod_python
- python-pyparsing
+ mod_python (optional - but highly recommended)
python-ldap (optional - needed for ldap-based webapp authentication)
python-memcached (optional - needed for webapp caching, big performance boost)
python-sqlite2 (optional - a django-supported database module is required)
@@ -30,10 +29,39 @@ First take a look at the 'prefix' option in the setup.cfg file. This specifies
where the graphite application will be installed. Note that if you plan on
installing carbon on the same server you should use the same prefix for it.
+The prefix where graphite is installed under where be referred to as
+$GRAPHITE_ROOT from here on.
Also, do NOT change the 'install-lib' option unless you really know what
you are doing.
+ Initialize the Database
+Once you have installed graphite you must initialize its database like so:
+cd $GRAPHITE_ROOT/webapp/graphite/
+sudo python syncdb
+Note that if you wish to use a custom database setup (like MySQL or Postgres)
+you will need to make those configuration changes first. See the "Custom
+Database Configuration" section below for details.
+ Setup Filesystem Ownership
+The user that apache runs as will need write access to the following directories:
+As well as write access to the following files:
+The apache user must also have read access to $GRAPHITE_ROOT/storage/whisper/
Apache Configuration
First off, Apache has to have mod_python configured, this is usually done
@@ -67,23 +95,20 @@ After you setup your database server, create a database and a user with full
privileges on that database. Now we put that information into the graphite
webapp file.
-Edit the $GRAPHITE_ROOT/webapp/web/
+Edit the $GRAPHITE_ROOT/webapp/graphite/
In particular you will need to uncomment and modify all of the settings
that begin with "DATABASE_". Once you have done this, we need to tell
Django to create our tables.
-cd $GRAPHITE_ROOT/webapp/web/
+cd $GRAPHITE_ROOT/webapp/graphite/
sudo python syncdb
# you will be prompted to create an admin user, this is a good idea
Restart apache and you should see the graphite webapp on the main page.
If you encounter problems, you can increase the verbosity of error output
by adding a "DEBUG = True" line to
-Also remember that by default the apache logs for the graphite webapp are in
Next Steps - setup the backend (carbon)
@@ -1,4 +1,6 @@
include INSTALL
include LICENSE
+include example-graphite-vhost.conf
+include webapp/graphite/
recursive-include webapp/graphite/ *.html
recursive-include webapp/content/ *
@@ -30,11 +30,10 @@ Use the instructions in the INSTALL file.
First you must tell carbon-cache what user it should run as.
-This must be a user with write privileges to $GRAPHITE_ROOT/storage/whisper
+This must be a user with write privileges to $GRAPHITE_ROOT/storage/whisper/
Specify the user account in $GRAPHITE_ROOT/carbon/conf/carbon.conf
-# Next we must make sure that the carbon-cache/apache user owns the storage directory.
-sudo chown -R $CARBON_USER $GRAPHITE_ROOT/storage/
+This user must also have write privileges to $GRAPHITE_ROOT/storage/log/carbon-cache/
Writing a client
@@ -34,7 +34,7 @@
print "Running Graphite from %s under django development server\n" % graphite_root
-command = "%s runserver --pythonpath=%s --settings=web.settings" % (django_admin, python_path, options.port)
+command = "%s runserver --pythonpath=%s --settings=graphite.settings" % (django_admin, python_path, options.port)
print command
sys.exit( os.system(command) >> 8 )
@@ -0,0 +1,38 @@
+NameVirtualHost *:80
+# You may 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.
+<VirtualHost *:80>
+ ServerName graphite
+ DocumentRoot "/opt/graphite/webapp"
+ ErrorLog /opt/graphite/storage/log/webapp-error.log
+ CustomLog /opt/graphite/storage/log/webapp-access.log common
+ <Location "/">
+ SetHandler python-program
+ PythonPath "/opt/graphite/webapp + sys.path"
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE graphite.settings
+ PythonDebug Off
+ PythonAutoReload Off
+ </Location>
+ <Location "/content/">
+ SetHandler None
+ </Location>
+ <Location "/media/">
+ SetHandler None
+ </Location>
+ # NOTE: 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/ "@DJANGO_ROOT@/contrib/admin/media/"
@@ -29,7 +29,7 @@
description='Enterprise scalable realtime graphing',
package_dir={'' : 'webapp'},
packages=['graphite', 'graphite.account', 'graphite.browser', 'graphite.cli', 'graphite.composer', 'graphite.render', 'graphite.whitelist'],
- package_data={'graphite' : ['templates/*']},
+ package_data={'graphite' : ['templates/*', '']},
data_files=webapp_content.items() + storage_dirs,
@@ -0,0 +1,7 @@
+<h2 style="font-face: Verdana">
+<p>Graphite encountered an unexpected error while handling your request.</p>
+<p>Please contact your site administrator if the problem persists.</p>

0 comments on commit 5c447b1

Please sign in to comment.