Skip to content

Instantly share code, notes, and snippets.

@recamshak
Created November 21, 2012 10:35
Show Gist options
  • Save recamshak/4124194 to your computer and use it in GitHub Desktop.
Save recamshak/4124194 to your computer and use it in GitHub Desktop.
Install graphite in a virtualenv (for my webfaction server)
# this script will install whisper, carbon and graphite-web on the current directory
sudo apt-get python-dev
mkvirtualenv --system-site-packages graphite
pip install twisted
pip install django
pip install django-tagging
pip install gunicorn
SITE_PACKAGE=`virtualenvwrapper_get_site_packages_dir`
DIR=`pwd`
pip install whisper
pip install carbon --install-option="--prefix=$DIR" --install-option="--install-lib=$SITE_PACKAGE"
pip install graphite-web --install-option="--prefix=$DIR" --install-option="--install-lib=$SITE_PACKAGE"
export PKG_CONFIG_PATH=$HOME/lib/pkgconfig
export LD_LIBRARY_PATH=$HOME/lib
# install pycairo dependencies
wget http://www.cairographics.org/releases/pixman-0.28.0.tar.gz
tar -xzf pixman-0.28.0.tar.gz
cd pixman-0.28.0
./configure --prefix=$HOME
make
make install
cd ..
wget http://www.cairographics.org/releases/cairo-1.12.8.tar.xz
tar -xJf cairo-1.12.8.tar.xz
cd cairo-1.12.8
./configure --prefix=$HOME
make
make install
cd ..
wget http://www.cairographics.org/releases/py2cairo-1.10.0.tar.bz2
tar -xjf py2cairo-1.10.0.tar.bz2
cd py2cairo-1.10.0
./waf configure --prefix=$VIRTUAL_ENV
./waf build
./waf install
cd ..
rm -rf cairo-1.12.8*
rm -rf pixman-0.28.0*
rm -rf py2cairo-1.10.0*
# configure graphite-web paths
GRAPHITE_WEB_SETTINGS=$SITE_PACKAGE/graphite/local_settings.py
cp $GRAPHITE_WEB_SETTINGS{.example,}
cat >> $GRAPHITE_WEB_SETTINGS <<EOF
GRAPHITE_ROOT = '$DIR'
CONF_DIR = GRAPHITE_ROOT + '/conf'
STORAGE_DIR = GRAPHITE_ROOT + '/storage'
CONTENT_DIR = GRAPHITE_ROOT + '/webapp/content'
DATABASES = {
'default': {
'NAME': GRAPHITE_ROOT + '/storage/graphite.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
}
EOF
# run syncdb
django-admin.py syncdb --settings graphite.settings
@mbrochh
Copy link

mbrochh commented Jun 27, 2014

How come there is sudo in the script when it is meant to be run on Webfaction? Are you using a VPS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment