############################
#     Apache HTTPD 2.2     #
#       Virtual Host       #
#    By Jorge Schrauwen    #
############################
# Core Configuration
ServerRoot "/srv/httpd"
ServerName Cygnus
PidFile logs/httpd.pid

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

# Multi-Processing Module Configuration
# Windows NT
<IfModule mpm_winnt.c>
    #250 Prod, 25 dev - wrowe
    ThreadsPerChild 25
    MaxRequestsPerChild  0
    <IfDefine WINFIX>
        #Fix broken AcceptEx (-DWINFIX)
        EnableSendfile Off
        EnableMMAP Off
        Win32DisableAcceptEx
    </IfDefine>
</IfModule>

# UNIX Compatible
<IfModule !mpm_winnt.c>
    #daemon user
    User apache
    Group apache

    <IfModule prefork.c>
        StartServers       8
        MinSpareServers    5
        MaxSpareServers   20
        ServerLimit      256
        MaxClients       256
        MaxRequestsPerChild  4000
    </IfModule>
    <IfModule worker.c>
        StartServers         2
        MaxClients         150
        MinSpareThreads     25
        MaxSpareThreads     25
        ThreadsPerChild     25
        MaxRequestsPerChild  0
    </IfModule>
</IfModule>

# Module Includes
# -> General Modules
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so

# -> Protocal Modules
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so

# -> Database Modules
LoadModule dbd_module modules/mod_dbd.so

# -> Authentication Modules
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so

# -> Content Providers
LoadModule cgid_module modules/mod_cgid.so
LoadModule include_module modules/mod_include.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule imagemap_module modules/mod_imagemap.so

# -> Content Modifiers
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule deflate_module modules/mod_deflate.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so

# -> Proxy Modules
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

# -> Caching Modules
#LoadModule cache_module modules/mod_cache.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule mem_cache_module modules/mod_mem_cache.so

# -> Miscellaneous Modules
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule env_module modules/mod_env.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule info_module modules/mod_info.so
#LoadModule status_module modules/mod_status.so
#LoadModule isapi_module modules/mod_isapi.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so

# Base Configuration
LogLevel error
ErrorLog logs/error_log
ServerTokens Full
ServerSignature On
UseCanonicalName Off

AccessFileName .htaccess

TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

<IfModule mod_auth_digest.c>
    BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
</IfModule>

<IfDefine MANUAL>
    AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/srv/httpd/manual$1"

    <Directory "/srv/httpd/manual">
        Options Indexes
        AllowOverride None
        Order allow,deny
        Allow from all

        <Files *.html>
            SetHandler type-map
        </Files>

        SetEnvIf Request_URI ^/manual/de/ prefer-language=de
        SetEnvIf Request_URI ^/manual/en/ prefer-language=en
        SetEnvIf Request_URI ^/manual/es/ prefer-language=es
        SetEnvIf Request_URI ^/manual/fr/ prefer-language=fr
        SetEnvIf Request_URI ^/manual/ja/ prefer-language=ja
        SetEnvIf Request_URI ^/manual/ko/ prefer-language=ko
        SetEnvIf Request_URI ^/manual/ru/ prefer-language=ru
        RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
    </Directory>
</IfDefine>

# Log Configuration
<IfModule mod_log_config.c>
  LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-agent}i\"" combined
  #CustomLog logs/access_log combined
  <IfModule mod_rewrite.c>
    RewriteLogLevel 0
    #RewriteLog logs/rewrite_log
  </IfModule>
</IfModule>


# Content Provider Configuration
# PHP Configuration
LoadModule php5_module "modules/libphp5.so"

# Perl Configuration
<IfModule mpm_winnt.c>
        LoadFile "/perl/bin/perl58.dll"
</IfModule>
LoadModule perl_module modules/mod_perl.so

<IfModule mod_perl.c>
    #perl startup modules
        PerlModule ModPerl::Util;
        PerlModule Apache2::RequestRec;
        PerlModule Apache2::RequestIO;
        PerlModule Apache2::RequestUtil;
        PerlModule Apache2::ServerRec;
        PerlModule Apache2::ServerUtil;
        PerlModule Apache2::Connection;
        PerlModule Apache2::Log;
        PerlModule Apache2::Const:common;
        PerlModule APR::Const:common;
        PerlModule APR::Table;
        PerlModule Apache2::compat;
        #PerlModule CGI;
        PerlResponseHandler ModPerl::Registry;
</IfModule>

# mod_security 2 Configuration
<IfDefine SECURITY>
    #Load mod_unique_id and mod_security 2
    LoadModule unique_id_module modules/mod_unique_id.so
    LoadModule security2_module modules/mod_security2.so
    <IfModule mod_security2.c>
        #Enable mod_security
        SecRuleEngine On
        SecDefaultAction log,auditlog,deny,status:403,phase:2,t:lowercase,t:replaceNulls,t:compressWhitespace

        #Log Configuration
        SecAuditEngine RelevantOnly
        SecAuditLogType Serial
        SecAuditLog logs/mod_security2.log

        #General Settings
        SecServerSignature "jHTTP Server/3.1"
        #SecTmpDir /temp
        #SecUploadDir /temp/uploads
        #SecUploadKeepFiles RelevantOnly

        #Rules
        SecRule ARGS "c:/" t:normalisePathWin
        SecRule ARGS "\.\./" t:normalisePathWin
    </IfModule>
</IfDefine>

# Error Configuration
Alias /error "/srv/httpd/error"

<Directory "/srv/httpd/error">
        Options MultiViews -Indexes
        AllowOverride None
        Order allow,deny
        Allow from all
        #<IfModule mod_php5.c>
        #        AddType application/x-httpd-php .php
        #        AddType application/x-httpd-php .phtml
        #        AddType application/x-httpd-php-source .phps
        #</IfModule>
</Directory>

#ErrorDocument 400 /error/?code=400
#ErrorDocument 401 /error/?code=401
#ErrorDocument 403 /error/?code=403
#ErrorDocument 404 /error/?code=404
#ErrorDocument 500 /error/?code=500
#ErrorDocument 502 /error/?code=502
#ErrorDocument 503 /error/?code=503
#ErrorDocument 504 /error/?code=504

# Deflate Configuration
# mod_headers is also needed, also see log configurationg in httpd.conf
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
        #DeflateCompressionLevel 9
        <Location />
                AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml
                <IfModule mod_headers.c>
                        Header append Vary User-Agent
                </IfModule>
        </Location>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
</IfModule>

# Direcotory Index Configuration
DirectoryIndex index.php index.html index.html.var index.htm index.cgi index.shtm index.shtml

Alias /icons/ "/srv/httpd/icons/"

<Directory "/srv/httpd/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

IndexOptions FancyIndexing VersionSort FoldersFirst XHTML

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/dir.gif index.htm index.html index.php
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip .rar
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName footer.html
HeaderName header.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

DefaultLanguage en

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw


LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset off

AddCharset ISO-8859-1  .iso8859-1 .latin1
AddCharset ISO-8859-2  .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3  .iso8859-3 .latin3
AddCharset ISO-8859-4  .iso8859-4 .latin4
AddCharset ISO-8859-5  .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6  .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7  .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8  .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9  .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5        .Big5       .big5
AddCharset WINDOWS-1251 .cp-1251   .win-1251
AddCharset CP866       .cp866
AddCharset KOI8-r      .koi8-r .koi8-ru
AddCharset KOI8-ru     .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8       .utf8
AddCharset GB2312      .gb2312 .gb
AddCharset utf-7       .utf7
AddCharset utf-8       .utf8
AddCharset big5        .big5 .b5
AddCharset EUC-TW      .euc-tw
AddCharset EUC-JP      .euc-jp
AddCharset EUC-KR      .euc-kr
AddCharset shift_jis   .sjis

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler type-map var

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully

# Host Configuration
Include conf/hosts.conf