Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up graphite on my Mac OS X 10.7 lion, i've set up apache to call the python graphite script via WSGI, but when i try to access it, i get a forbiden from apache and in the error log.

 "client denied by server configuration: /opt/graphite/webapp/graphite.wsgi"

I've checked that the scripts location is allowed in httpd.conf, and the permissions of the file, but they seem correct. What do i have to do to get access. Below is the httpd.conf, which is nearly the graphite example.

<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>

Can you help?

share|improve this question

4 Answers 4

For newer versions of apache you might need this.

<Directory /opt/graphite/conf>
    #Order deny,allow
    #Allow from all
    Options All
    AllowOverride All
    Require all granted
</Directory>
share|improve this answer
    
You may only need Require all granted –  chrishiestand Aug 15 at 9:29

http://wiki.apache.org/httpd/ClientDeniedByServerConfiguration

It is always one of those reasons.

share|improve this answer

You are missing:

<Directory /opt/graphite/webapp>
Order deny,allow
Allow from all
</Directory>

<Directory /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-   packages/django/contrib/admin/media>
Order deny,allow
Allow from all
</Directory>

You also don't need:

<Location "/content/">
        SetHandler None
</Location>
<Location "/media/">
        SetHandler None
</Location>

That 'SetHandler None' stuff is old mod_python stuff and not needed for mod_wsgi.

share|improve this answer
1  
Is the media alias & <Directory> necessary? The only contrib/admin directory I can find in my Django 1.4 installation doesn't contain a media subdir. –  Richard Barnett May 1 '13 at 2:57
    
Don't assume your issue is the same. Post a fresh question with all your specific details. –  Graham Dumpleton May 1 '13 at 3:19
    
Thanks, Graham; I don't actually have an issue as Graphite seems to be working fine when including the media alias & <Directory>. I'll ask a fresh question if it hits problems. –  Richard Barnett May 2 '13 at 0:25

This fixed it for me:

chmod a+x graphite.wsgi

After you have determined that is the issue try reducding execute permissions to the owner of the file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.