Python 在OS-X Lion上安装Graphite。如何配置apache2?

Python 在OS-X Lion上安装Graphite。如何配置apache2?,python,macos,apache2,graphite,Python,Macos,Apache2,Graphite,我正在尝试在本地配置graphite。这些说明非常直截了当且易于遵循,一直到关于配置apache2的部分,其中的说明变得模糊,并且似乎没有任何选项适用于OS-X。下载graphite源代码没有提供安装指南中描述的示例“vhost.conf”和我的apache2目录(/etc/apache2)没有说明可能是选项的以下目录:站点可用、站点启用、/conf/vhosts.d/ 我需要制作这些目录吗?如果是这样的话,一旦它们被创建了,我该在那里放些什么呢。除了允许mod_python之外,如何修改htt

我正在尝试在本地配置graphite。这些说明非常直截了当且易于遵循,一直到关于配置apache2的部分,其中的说明变得模糊,并且似乎没有任何选项适用于OS-X。下载graphite源代码没有提供安装指南中描述的示例“vhost.conf”和我的apache2目录(/etc/apache2)没有说明可能是选项的以下目录:站点可用、站点启用、/conf/vhosts.d/


我需要制作这些目录吗?如果是这样的话,一旦它们被创建了,我该在那里放些什么呢。除了允许mod_python之外,如何修改httpd.conf?抱歉,这可能是apache最基本的问题,但我以前从未这样做过

有一个脚本可以启动graphite附带的简单开发服务器。我已将graphite安装到
/opt/graphite
,因此它是
/opt/graphite/bin/run graphite devel server.py

用法:

run-graphite-devel-server.py /path/to/graphite/install
例如:

编辑:发布包中没有包含很多额外的内容,但是如果您从graphite的源存储库中签出graphite,就会包含这些内容。尽管这有点困难(如果你使用他们的集市回购的github镜像,也不会太困难),我还是建议从源头上构建石墨。(感谢@jabley提到它不在发布tarball中)。

试试这个:

LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so
<IfModule !wsgi_module.c>
        LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so
</IfModule>
WSGISocketPrefix /var/run/apache2/wsgi
<VirtualHost *:80>
        ServerName graphite.local
        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 python-path=/opt/graphite/lib/python2.7/site-packages/
        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/
        <Location "/content/">
                SetHandler None
                Order allow,deny
                Allow from localhost
        </Location>
        Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
        <Location "/media/">
                SetHandler None
        </Location>
        <Directory /opt/graphite/conf/>
                Order deny,allow
                Allow from all
        </Directory>
</VirtualHost>
LoadModule wsgi_module/usr/libexec/apache2/mod_wsgi.so
LoadModule wsgi_module/usr/libexec/apache2/mod_wsgi.so
WSGISocketPrefix/var/run/apache2/wsgi
ServerName.local
DocumentRoot“/opt/graphite/webapp”
ErrorLog/opt/graphite/storage/log/webapp/error.log
CustomLog/opt/graphite/storage/log/webapp/access.log通用
WSGIDaemonProcess graphite processes=5线程=5显示名称='{GROUP}'非活动超时=120 python路径=/opt/graphite/lib/python2.7/site-packages/
钨基石墨
WSGIApplicationGroup%{GLOBAL}
WSGIImportScript/opt/graphite/conf/graphite.wsgi进程组=graphite应用程序组=%{GLOBAL}
WSGIScriptAlias//opt/graphite/conf/graphite.wsgi
别名/content//opt/graphite/webapp/content/
SetHandler无
命令允许,拒绝
允许从本地主机
别名/media/“@DJANGO_ROOT@/contrib/admin/media/”
SetHandler无
命令拒绝,允许
通融

遗憾的是,此脚本在当前版本中似乎不可用,但您可以从您的答案中获得它,因为我发现它很有用,即使它没有直接回答OP!
LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so
<IfModule !wsgi_module.c>
        LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so
</IfModule>
WSGISocketPrefix /var/run/apache2/wsgi
<VirtualHost *:80>
        ServerName graphite.local
        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 python-path=/opt/graphite/lib/python2.7/site-packages/
        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/
        <Location "/content/">
                SetHandler None
                Order allow,deny
                Allow from localhost
        </Location>
        Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
        <Location "/media/">
                SetHandler None
        </Location>
        <Directory /opt/graphite/conf/>
                Order deny,allow
                Allow from all
        </Directory>
</VirtualHost>