Вопрос

I have graphite 0.9.10 on ubuntu 13. When I run the 'run-graphite-devel-server.py' script in the /opt/graphite/bin directory, the server comes up. However, when I access the url on port 8080, I receive the following (500 internal server) error:

SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS)

Any ideas on how to troubleshoot/resolve the issue.

Request headers:

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Connection  keep-alive
Host    192.168.100.100:8080
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0

Response Headers:

Content-Encoding    gzip
Content-Length  592
Content-Type    text/html; charset=utf-8
Date    Thu, 12 Dec 2013 15:39:53 GMT
Server  WSGIServer/0.1 Python/2.7.5+
Vary    Accept-Encoding
Это было полезно?

Решение 2

The issue was resolved by adding the ALLOWED_HOSTS section in app_settings/settings.py in /opt/graphite/webapp/graphite. For instance (if local address is 192.168.100.100):

ALLOWED_HOSTS = ['localhost', '192.168.100.100'] 

Django appears to enforce the ALLOWED_HOSTS criteria. I was not able to make progress without this change. Hope it helps.

Другие советы

Looks like you'll have to set access controls in graphite virtualhost file in your web-server. It might look like-

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

If you're using apache, the file is by default at- /etc/httpd/conf.d/graphite-vhost.conf

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top