2013-12-12 154 views
0

我在Ubuntu 13上有石墨0.9.10。當我運行/ opt/graphite/bin目錄中的'run-graphite-devel-server.py'腳本時,服務器出現。然而,當我訪問端口8080上的網址,我收到以下(500內部服務器)錯誤:石墨安裝拋出錯誤

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

如何解決任何想法/解決問題。

請求頭

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 

響應頭

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 

回答

1

這個問題是通過添加app_settings/settings.py在/ opt /的ALLOWED_HOSTS部分解石墨/ Web應用程序/石墨。例如(如果本地地址是192.168.100.100):

ALLOWED_HOSTS = ['localhost', '192.168.100.100'] 

Django的出現執行ALLOWED_HOSTS標準。沒有這種改變,我無法取得進展。希望能幫助到你。

1

看起來你必須設置access controls石墨虛擬主機文件在網絡服務器。它看起來喜歡 -

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

如果你使用Apache,該文件是默認AT-/etc/httpd/conf.d/graphite-vhost.conf

+0

感謝分享 –