简体   繁体   English

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

[英]Installing Graphite on OS-X Lion. How to configure apache2?

I'm trying to configure graphite locally. 我正在尝试在本地配置石墨。 The instructions are pretty straight forward and easy to follow (see here) , right up to the part about configuring apache2, where the instructions become vague, and none of the options seem to apply to OS-X. 这些说明非常直接且易于遵循(参见此处) ,直到关于配置apache2的部分,其中指令变得模糊,并且所有选项似乎都不适用于OS-X。 Downloading the graphite source didnt provide an example "vhost.conf" as described in the installation guide, and my apache2 directory (/etc/apache2) doesnt have any of the following directories that the instructions might be options: sites-available, sites-enables, /conf/vhosts.d/ 下载石墨源并没有提供安装指南中描述的示例“vhost.conf”,而我的apache2目录(/ etc / apache2)没有以下任何指令可能是选项的目录:sites-available,sites-启用,/ conf / vhosts.d /

do i need to make these directories? 我需要制作这些目录吗? if so what do i put there once they're created. 如果是这样,一旦它们被创造,我会把它放在那里。 how do i modify httpd.conf, aside from allowing mod_python? 除了允许mod_python之外,我如何修改httpd.conf? sorry for what is probably the most basic of apache questions, but i've never done this before! 抱歉可能是最基本的apache问题,但我以前从未这样做过!

There's a script to start a simple development server included with graphite. 有一个脚本可以启动一个包含石墨的简单开发服务器。 I have graphite installed to /opt/graphite , so it's /opt/graphite/bin/run-graphite-devel-server.py 我将石墨安装到/opt/graphite ,所以它是/opt/graphite/bin/run-graphite-devel-server.py

usage: 用法:

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

eg: 例如:

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

edit: There are a lot of extras that aren't included in the release package but are included if you check out graphite from their source repository. 编辑: 许多附加内容未包含在发行包中,但如果从其源代码存储库中查看石墨,则会包含这些附加内容。 Even though it's a little more difficult (although not too difficult if you use the github mirror of their bazaar repo), I recommend building graphite from source. 虽然它有点困难(虽然如果你使用他们的集市回购的github镜子并不太难),我建议从源头建造石墨。 (thanks @jabley for mentioning it wasn't in the release tarball). (感谢@jabley提到它不是在发布tarball中)。

Try this: 试试这个:

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM