访问 wsgi 石墨脚本时拒绝客户端

Dr *_*ams 16 wsgi apache-2.2 graphite

我正在尝试在我的 Mac OS X 10.7 lion 上设置石墨,我已经设置了 apache 以通过 WSGI 调用 python 石墨脚本,但是当我尝试访问它时,我从 apache 和错误日志中得到一个禁止.

 "client denied by server configuration: /opt/graphite/webapp/graphite.wsgi"
Run Code Online (Sandbox Code Playgroud)

我已经检查了 httpd.conf 中允许的脚本位置以及文件的权限,但它们似乎是正确的。我需要做什么才能获得访问权限。下面是 httpd.conf,它几乎是石墨示例。

<IfModule !wsgi_module.c>
   LoadModule wsgi_module modules/mod_wsgi.so
</IfModule>
WSGISocketPrefix /usr/local/apache/run/wigs   
<VirtualHost _default_:*>
    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}
    # XXX You will need to create this file! There is a graphite.wsgi.example
    # file in this directory that you can safely use, just copy it to graphite.wgsi
    WSGIScriptAlias / /opt/graphite/webapp/graphite.wsgi
    Alias /content/ /opt/graphite/webapp/content/
    <Location "/content/">
            SetHandler None
    </Location>
    # XXX In order for the django admin site media to work you
    Alias /media/ "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-   packages/django/contrib/admin/media/"
    <Location "/media/">
            SetHandler None
    </Location>
    # The graphite.wsgi file has to be accessible by apache. 
    <Directory "/opt/graphite/webapp/">
            Options +ExecCGI
            Order deny,allow
            Allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

你能帮我吗?

小智 26

从 apache 2.4 开始,Require all granted需要:

<Directory /opt/graphite/conf>
    Require all granted
</Directory>
Run Code Online (Sandbox Code Playgroud)

直到 apache 2.2,你会写:

<Directory /opt/graphite/conf>
    Order deny,allow
    Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

请参阅升级说明

请注意,您可以激活mod_access_compat以在 apache 2.4 中使用旧的(2.4 之前的)指令。如果您想快速排除这是您最初问题的原因,这可能很有用,但坦率地说,迁移Require到此很容易,使用此模块只是为了推迟它是没有意义的。

  • 您可能只需要“要求所有授予” (3认同)