# aptitude install -y apache libapache-mod-fastcgi

<IfModule mod_fastcgi.c>
 # NOTE: the first location depends on the DocumentRoot setting.
 # Yes, this sucks, but the alternative approach with
 # 'Alias' instead of 'RewriteRule does not work with flup and Django.
 #
 FastCGIExternalServer /srv/fastcgi-kundebunt -socket /var/lib/kundebunt/socket/fcgi.sock
</IfModule>

NameVirtualHost mir.office.noris.de:80
<VirtualHost mir.office.noris.de:80>
 ServerName mir.office.noris.de
 DocumentRoot /srv
 RewriteEngine On
 RewriteRule ^/((mailadmin|auth|releasenotes|popkern|otrsdata|user|stats)(/.*)?)$ /fastcgi-kundebunt/$1
 Alias /css/dj_kunde.css /usr/share/kundebunt/css/dj_kunde.css
 Alias /icons/ /usr/share/kundebunt/icons/
 Alias /yui-noris/ /usr/share/yui-noris/
 Alias /cleverbridge-icons/ /usr/share/cleverbridge-icons/
 ErrorLog       /var/log/apache/error_testservice.log
 CustomLog      /var/log/apache/access_testservice.log combined

 <Directory /usr/share/kundebunt/icons>
    ExpiresActive On
    ExpiresDefault "access plus 1 day"
 </Directory>

 <Directory /usr/share/kundebunt/css>
    ExpiresActive On
    ExpiresDefault "access plus 1 hour"
 </Directory>

# download area - requires mod_autoindex, mod_include
# replace /var/www with DocumentRoot.
<Directory /var/www/download>
  FastCGIAccessChecker /var/www/fastcgi-kundebunt/download/
  ErrorDocument 403 "/auth/login/"
  HeaderName /kundebunt-static/download/header.shtml
  ReadmeName /kundebunt-static/download/footer.shtml
  IndexOptions -FancyIndexing +IconsAreLinks +SuppressHTMLPreamble +TrackModified +VersionSort +HTMLTable +SuppressRules +SuppressLastModified +SuppressDescription +SuppressSize +SuppressColumnSorting +FoldersFirst +IgnoreCase +IconHeight +IconWidth
  IndexIgnore . ..
</Directory>

<Location /kundebunt-static/download>
  Options +Includes
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
</Location>

# collectd-proxy - requires mod_proxy, mod_proxy_http
# requests to /collectd/graph.cgi are to be checked and forwarded
# to collect1 to get the graphs. Be aware that the session cookie
# will be transmitted in cleartext to collect1!
<Location /collectd>
        FastCGIAccessChecker /var/www/fastcgi-kundebunt/collectd/
        ErrorDocument 403 "/auth/login/"
</Location>
RewriteRule ^/collectd/graph\.cgi$ http://collect1.noris.net/cgi-bin/graph.cgi [P]



</VirtualHost>
