title: setting up apache2/graphite server
body: <p>I've been trying to make my graphite server work but after reading so many tutorials of how to install and configure everything, I'm still stuck.</p>
  
  <p>At this point, if I use a simple virtualHost, I can see that the apache2 is working fine ("It works!"), but once I enable the other site where the graphite is configured, I get a 503.</p>
  
  <p>could anyone tell me whats wrong in my definitions? Thanks in advance!</p>
  
  <pre><code># 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.
  
  &lt;IfModule !wsgi_module.c&gt;
      LoadModule wsgi_module modules/mod_wsgi.so
  &lt;/IfModule&gt;
  
  # XXvX You need to set this up!
  # Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
  WSGISocketPrefix run/wsgi
  
  &lt;VirtualHost *:80&gt;
      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 &amp; 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/
      &lt;Location "/content/"&gt;
              SetHandler None
      &lt;/Location&gt;
  
      # 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
  
  &lt;VirtualHost *:80&gt;
          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 &amp; 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/
          &lt;Location "/content/"&gt;
                  SetHandler None
          &lt;/Location&gt;
  
          # 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/"
          &lt;Location "/media/"&gt;
                  SetHandler None
          &lt;/Location&gt;
  
          # The graphite.wsgi file has to be accessible by apache. It won't
          # be visible to clients because of the DocumentRoot though.
          &lt;Directory /opt/graphite/conf/&gt;
                  Order deny,allow
                  Allow from all
          &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>