OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Install all the system level dependencies. |
| 4 sudo apt-get install --assume-yes apache2 apache2-mpm-worker apache2-utils apach
e2.2-bin \ |
| 5 apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 build-essential p
ython-dev \ |
| 6 libapache2-mod-wsgi libaprutil1-ldap memcached python-cairo-dev python-django
python-ldap \ |
| 7 python-memcache python-pysqlite2 sqlite3 libapache2-mod-python python-pip font
config \ |
| 8 monit |
| 9 |
| 10 # Now install system dependencies that we need, but aren't satisfiable via |
| 11 # apt-get. |
| 12 sudo pip install --upgrade django==1.5 |
| 13 sudo pip install --upgrade django-tagging 'twisted<12.0' |
| 14 sudo pip install pytz |
| 15 sudo pip install pyparsing |
| 16 |
| 17 # Apache runs as the user www-data and we also need the Graphite server, which |
| 18 # is a WSGI Django application, to run as www-data. Sadly under Debian the |
| 19 # $HOME directory for www-data is /var/www, which is where files are by |
| 20 # default served from for Apache, so we can't store any data there securely, |
| 21 # so we create a /home/www-data directory and install Graphite web and its |
| 22 # dependencies there. |
| 23 sudo mkdir /home/www-data |
| 24 sudo chown www-data:default /home/www-data |
| 25 |
| 26 # Vars to use with 'install'. |
| 27 PARAMS="-D --verbose --backup=none --group=default --owner=www-data --preserve-t
imestamps" |
| 28 EXE_PARAMS="$PARAMS --mode=766" |
| 29 CONFIG_PARAMS="$PARAMS --mode=666" |
| 30 |
| 31 # Copy over scripts we will run as www-data. |
| 32 sudo install $EXE_PARAMS continue_install.sh continue_install2.sh /home/www-data |
| 33 |
| 34 # The continue_install.sh script installs local per-user copies of ceres, |
| 35 # whisper, carbon and graphite-web. |
| 36 sudo su www-data -c /home/www-data/continue_install.sh |
| 37 |
| 38 # Now that the default installs are in place, overwrite the installs with our |
| 39 # custom config files. |
| 40 sudo install $CONFIG_PARAMS graphite.wsgi carbon.conf storage-schemas.conf \ |
| 41 /home/www-data/graphite/conf |
| 42 sudo install $CONFIG_PARAMS local_settings.py /home/www-data/graphite/lib/graphi
te/ |
| 43 sudo install $CONFIG_PARAMS monitoring_monit /etc/monit/conf.d/monitoring |
| 44 |
| 45 # Now run the continue_install2.sh script as www-data, which creates the |
| 46 # sqlite database if needed and starts the carbon service. |
| 47 sudo su www-data -c /home/www-data/continue_install2.sh |
| 48 |
| 49 # Add to the configuration of Apache so that we load the Graphite WSGI |
| 50 # application, and restart the server. |
| 51 sudo cp httpd.conf /etc/apache2/conf.d/graphite.conf |
| 52 sudo /etc/init.d/monit restart |
| 53 sudo /etc/init.d/apache2 restart |
OLD | NEW |