2011-08-21 78 views
3

我正在尝试在本地配置石墨。这些指令非常直接,易于遵循(see here),直到配置apache2的部分,其中的指令变得模糊,并且这些选项似乎都不适用于OS-X。下载石墨源没有提供如安装指南中所述的“vhost.conf”示例,并且我的apache2目录(/ etc/apache2)没有任何以下目录,说明可能是选项:sites-available,sites-启用/conf/vhosts.d/在OS-X Lion上安装Graphite。如何配置apache2?

我需要做这些目录吗?如果是的话,一旦他们被创建,我会放在那里。除了允许mod_python之外,我如何修改httpd.conf?对不起,可能是最基本的apache问题,但我从来没有这样做过!

回答

4

有一个脚本可以启动一个包含石墨的简单开发服务器。我安装到/opt/graphite石墨,因此它的/opt/graphite/bin/run-graphite-devel-server.py

用法:

run-graphite-devel-server.py /path/to/graphite/install 

如:

/opt/graphite/bin/run-graphite-devel-server.py /opt/graphite 

编辑:有很多额外的未包含在发布包,但如果您从源代码库中检出石墨,将包含它们。尽管它有点困难(尽管如果你使用其市场回购的github镜子,并不难),我建议从源头上生产石墨。 (感谢@jabley提到它不在发行版tarball中)。

+2

似乎可悲的是这个脚本并不在目前的版本中提供,但你可以从https://raw.github.com/tmm1/graphite/d0f76a659f4f2dea67f19902002710f601f534aa/bin/得到它run-graphite-devel-server.py Upvoted你的答案,因为我发现它很有用,即使它不直接回答OP! – jabley

0

试试这个:

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/ "@[email protected]/contrib/admin/media/" 
     <Location "/media/"> 
       SetHandler None 
     </Location> 
     <Directory /opt/graphite/conf/> 
       Order deny,allow 
       Allow from all 
     </Directory> 
</VirtualHost>