Subscribe
Accepted Solution

graphite site returns You don't have permission to access / on this server.

Hi,

 

I am very new to Netapp environment but have good experience working on Linux servers. I found this very interesting to setup an open sourced based real time monitoring and graphs creation tool like Graphite and Grafana.

 

I came across the great post from Christopher Madden on "Quick Start: Installing Graphite and Grafana", My test bed is RHEL and I am trying to setup graphite and grafana on RHEL 7.1. Here is my problem:

 

I followed all steps as illustrated in quick guide but for some reason I am stuck with Graphite while Grafana is configured as expected. When I start apache webserver and try to access Graphite web login, it gives me Erro 403 - You don't have permission to access / on this server."

 

# ls -ld /opt/graphite
drwxr-xr-x 8 root root 4096 May 17 11:56 /opt/graphite

 

# ls -lrt /opt/graphite
total 28
drwxr-xr-- 4 root root 4096 May 16 02:43 lib
drwxr-xr-- 2 root root 4096 May 16 02:43 bin
drwxr-xr-- 2 root root 4096 May 16 02:43 examples
drwxr-xr-x 4 root root 4096 May 17 12:07 webapp
drwxr-xr-x 2 root root 4096 May 17 12:22 conf
drwxr-xr-- 6 apache apache 4096 May 17 12:27 storage
#

 

In error log file I am getting following:

 

[Tue May 17 12:27:44.776043 2016] [:error] [pid 7699] mod_wsgi (pid=7699): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Tue May 17 12:27:44.776098 2016] [:error] [pid 7699] mod_wsgi (pid=7699): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Tue May 17 12:27:44.776121 2016] [:error] [pid 7699] Traceback (most recent call last):
[Tue May 17 12:27:44.776143 2016] [:error] [pid 7699] File "/opt/graphite/conf/graphite.wsgi", line 4, in <module>
[Tue May 17 12:27:44.776196 2016] [:error] [pid 7699] from graphite.wsgi import application
[Tue May 17 12:27:44.776224 2016] [:error] [pid 7699] ImportError: No module named graphite.wsgi
[Tue May 17 12:27:44.782577 2016] [:error] [pid 7700] mod_wsgi (pid=7700): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Tue May 17 12:27:44.782694 2016] [:error] [pid 7700] mod_wsgi (pid=7700): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Tue May 17 12:27:44.782785 2016] [:error] [pid 7700] Traceback (most recent call last):
[Tue May 17 12:27:44.782888 2016] [:error] [pid 7700] File "/opt/graphite/conf/graphite.wsgi", line 4, in <module>
[Tue May 17 12:27:44.782991 2016] [:error] [pid 7700] from graphite.wsgi import application
[Tue May 17 12:27:44.783058 2016] [:error] [pid 7700] ImportError: No module named graphite.wsgi
[Tue May 17 12:27:44.783090 2016] [:error] [pid 7697] mod_wsgi (pid=7697): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Tue May 17 12:27:44.783120 2016] [:error] [pid 7697] mod_wsgi (pid=7697): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Tue May 17 12:27:44.783142 2016] [:error] [pid 7697] Traceback (most recent call last):
[Tue May 17 12:27:44.783167 2016] [:error] [pid 7697] File "/opt/graphite/conf/graphite.wsgi", line 4, in <module>
[Tue May 17 12:27:44.783223 2016] [:error] [pid 7697] from graphite.wsgi import application
[Tue May 17 12:27:44.783250 2016] [:error] [pid 7697] ImportError: No module named graphite.wsgi
[Tue May 17 12:27:44.788407 2016] [:error] [pid 7698] mod_wsgi (pid=7698): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Tue May 17 12:27:44.788438 2016] [:error] [pid 7698] mod_wsgi (pid=7698): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Tue May 17 12:27:44.788459 2016] [:error] [pid 7698] Traceback (most recent call last):
[Tue May 17 12:27:44.788483 2016] [:error] [pid 7698] File "/opt/graphite/conf/graphite.wsgi", line 4, in <module>
[Tue May 17 12:27:44.788536 2016] [:error] [pid 7698] from graphite.wsgi import application
[Tue May 17 12:27:44.788564 2016] [:error] [pid 7698] ImportError: No module named graphite.wsgi
[Tue May 17 12:27:44.789582 2016] [:error] [pid 7701] mod_wsgi (pid=7701): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Tue May 17 12:27:44.789662 2016] [:error] [pid 7701] mod_wsgi (pid=7701): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Tue May 17 12:27:44.789724 2016] [:error] [pid 7701] Traceback (most recent call last):
[Tue May 17 12:27:44.789787 2016] [:error] [pid 7701] File "/opt/graphite/conf/graphite.wsgi", line 4, in <module>
[Tue May 17 12:27:44.789920 2016] [:error] [pid 7701] from graphite.wsgi import application
[Tue May 17 12:27:44.789988 2016] [:error] [pid 7701] ImportError: No module named graphite.wsgi

 

 

Here is my virtual host conf file contents:

 

# cat /etc/httpd/conf.d/graphite-vhost.conf
# This needs to be in your server's config somewhere, probably
# the main httpd.conf
# NameVirtualHost *:80

# This line also needs to be in your server's config.
# LoadModule wsgi_module modules/mod_wsgi.so

# You need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
# you will need to change all the occurances of /opt/graphite/
# in this file to your chosen install location.

<IfModule !wsgi_module.c>
LoadModule wsgi_module modules/mod_wsgi.so
</IfModule>

# XXX You need to set this up!
# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
WSGISocketPrefix run/wsgi

<VirtualHost *:81>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
#
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common

# I've found that an equal number of processes & threads tends
# to show the best performance for Graphite (ymmv).
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/conf/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
# must change @DJANGO_ROOT@ to be the path to your django
# installation, which is probably something like:
# /usr/lib/python2.6/site-packages/django
Alias /media/ "/usr/lib/python2.7/site-packages/django/contrib/admin/media/"
<Location "/media/">
SetHandler None
</Location>

# The graphite.wsgi file has to be accessible by apache. It won't
# be visible to clients because of the DocumentRoot though.

<Directory /opt/graphite/>
Options All
AllowOverride All
Require all granted
</Directory>

</VirtualHost>

#

 

 

I did lot of search and checks but I am back to square. No able to locate where is the issue.  I will highly thankful, If you can help based on the experiece you have with these tools.

 

Thanks in advance!

 

Deepak

 

 

 

Re: graphite site returns You don't have permission to access / on this server.

The issue is now fixed and it turned out that change in default umask setting caused all this trouble.

 

 

Re: graphite site returns You don't have permission to access / on this server.

Great to hear!  Maybe you can also set your answer as "correct"?  It makes it easier to see that the question was answered when searching!

 

Thanks,
Chris

Re: graphite site returns You don't have permission to access / on this server.

Can you send what/where you changed exactly?  Sorry, i'm not really a xNIX guy and i've been fighting this for a while now.  Thx.