【问题标题】:setting up apache2/graphite server设置 apache2/graphite 服务器
【发布时间】:2013-10-08 14:06:05
【问题描述】:

我一直在尝试让我的石墨服务器工作,但是在阅读了这么多关于如何安装和配置所有内容的教程之后,我仍然卡住了。

此时,如果我使用一个简单的虚拟主机,我可以看到 apache2 工作正常(“它工作正常!”),但是一旦我启用配置了石墨的另一个站点,我得到一个 503。

谁能告诉我我的定义有什么问题?提前致谢!

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

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

<VirtualHost *:80>
    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
    # XXX You need to set this up!
    # Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
    WSGISocketPrefix run/wsgi

<VirtualHost *:80>
        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/ "@DJANGO_ROOT@/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/conf/>
                Order deny,allow
                Allow from all
        </Directory>

</VirtualHost>

【问题讨论】:

    标签: apache2 graphite


    【解决方案1】:

    ServerName 54.12.34.222

    在那里提供您的公共 IP。为什么还要在其中定义多个 VirtualHost?

    <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 *:80>
            ServerName 54.100.200.100
            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/ "@DJANGO_ROOT@/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/conf/>
                    Order deny,allow
                    Allow from all
            </Directory>
    
            <Directory /opt/graphite/webapp>
                    Order deny,allow
                    Deny from all
                    AllowOverride All
                    AuthName "Graphite web access"
                    AuthType Basic
                    AuthUserFile /opt/graphite/passwd/passwords
                    Require user webyog
                    Allow from 122.181.14.62, 202.191.170.90 
                    Satisfy Any
            </Directory>
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 2016-12-26
      • 2014-07-10
      • 2013-02-08
      • 1970-01-01
      • 2011-03-24
      • 2018-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多