vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

Could not run on apache with mod_wsgi #106

Open ryuzee opened 10 years ago

ryuzee commented 10 years ago

Hi!

graph-explorer works fine for me with built-in httpd server but when I tried to run it on apache with mod_wsgi, I got these errors as follows. How can I fix the errors?

Traceback (most recent call last):
File "/var/www/graph_explorer/app.wsgi", line 5, in <module>
     import bottle, app
   File "/var/www/graph_explorer/app.py", line 8, in <module>
     from graphs import Graphs
   File "/var/www/graph_explorer/graphs/__init__.py", line 3, in <module>
     from ..structured_metrics import PluginError
 ValueError: Attempted relative import beyond toplevel package

My configuration of mod_wsgi and the new script are as follows.

WSGIDaemonProcess graph_explorer user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias / /var/www/graph_explorer/app.wsgi

<Directory /var/www/graph_explorer>
        WSGIProcessGroup graph_explorer
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
</Directory>

app.wsgi

import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import bottle, app
application = bottle.default_app()
Dieterbe commented 10 years ago

sorry, i have no experience with this kind of setup, not sure how to fix that. you could try changing it to from graph_explorer.structured_metrics import PluginError, maybe.

@hollobon might know more.