...
There is an Apache Virtual Hosts file provided in the graphite-web/examples directory. You can use this to configure your Apache installation.
Things to pay attention to in this file:
...
WSGISocketPrefix run/wsgi
this needs to be set to a directory that the webserver can write to and can be either a relative or an absolute path.
The following, minimal Apache vhost configuration file should be enough to get started
No Format |
---|
<IfModule !wsgi_module.c>
LoadModule wsgi_module modules/mod_wsgi.so
</IfModule>
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>
ServerAdmin webmaster@myhost.edu
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
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}
WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi
Alias /content/ /opt/graphite/webapp/content/
|
Both the <Location "/content/"> and <Location "/media/"> do not specify access. You may need to add them.
ie.
<Location "/content/">
SetHandler None
</Location>
to
<Location "/content/"> SetHandler None Order deny,allow Allow from all </Location> <Directory /opt/graphite/conf/> Options All AllowOverride All Require all granted </Directory> <Directory /opt/graphite/webapp> Options All AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> |
Anchor | ||||
---|---|---|---|---|
|
...
in /opt/graphite/conf/carbon.conf but this will not harm the running process and does not need to be disabled.
...
Note: If you are not running the carbon-cache.py daemon as root, then you will need to make the /opt/graphite/storage/whisper directory writable by whichever user you will run carbon-cache.py as.
Code Block |
---|
sudo chown -R ubuntu /opt/graphite/storage/whisper |
For example: If you are running Apache as www-data and the carbon-cache.py as ubuntu then your /opt/graphite/storage directory will look like
No Format |
---|
> ls -l /opt/graphite/storage
-rw-r--r-- 1 www-data www-data 5 Sep 8 21:46 carbon-cache-a.pid
-rw-r--r-- 1 www-data www-data 69632 Sep 8 21:50 graphite.db
-rw-r--r-- 1 www-data www-data 762 Sep 8 21:50 index
drwxr-xr-x 2 www-data www-data 4096 Sep 8 21:40 lists/
drwxr-xr-x 4 www-data www-data 4096 Sep 8 21:46 log/
drwxr-xr-x 2 www-data www-data 4096 Sep 8 21:40 rrd/
drwxr-xr-x 5 ubuntu www-data 4096 Sep 10 18:19 whisper/ |
This will allow carbon-cache.py to add new metrics to the whisper tables and still allow the web application to read them.
Anchor | ||||
---|---|---|---|---|
|
...