##
##  davical-apache.conf -- DAViCal Apache Custom Configuration
##

ServerRoot             @l_prefix@
ServerAdmin            root@@l_hostname@.@l_domainname@
ServerName             @l_hostname@.@l_domainname@
ServerTokens           Prod
User                   @l_rusr@
Group                  @l_rgrp@
<IfDefine !SSL>
Listen                 127.0.0.1:8080
</IfDefine>
<IfDefine SSL>
Listen                 127.0.0.1:8443
</IfDefine>

#   runtime files
PidFile                @l_prefix@/var/davical/run/apache.pid
ScoreBoardFile         @l_prefix@/var/davical/run/apache.sb
LockFile               @l_prefix@/var/davical/run/apache.lck

#   include apache-php
Include                @l_prefix@/etc/apache/apache.d/apache-php.conf

#  server behaviour
Timeout                300
KeepAlive              on
MaxKeepAliveRequests   100
KeepAliveTimeout       15
MinSpareServers        5
MaxSpareServers        10
StartServers           5
MaxClients             15
MaxRequestsPerChild    500
HostnameLookups        off
UseCanonicalName       on

#   access logging
LogFormat              "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat              "%h %l %u %t \"%r\" %>s %b" common
LogFormat              "%{Referer}i -> %U" referer
LogFormat              "%{User-agent}i" agent
CustomLog              @l_prefix@/var/davical/log/apache.access.log common

#   error logging
LogLevel               warn
ErrorLog               @l_prefix@/var/davical/log/apache.error.log
ServerSignature        on

#   SSL/TLS support
<IfDefine SSL>
SSLEngine              on
SSLRandomSeed          startup builtin
SSLRandomSeed          connect builtin
SSLMutex               sem
SSLCADNRequestFile     @l_prefix@/etc/x509/example-ca.crt.pem
SSLCACertificateFile   @l_prefix@/etc/x509/example-ca.crt.pem
SSLCertificateFile     @l_prefix@/etc/x509/example-server.crt.pem
SSLCertificateKeyFile  @l_prefix@/etc/x509/example-server.key.pem
SSLSessionCache        shm:@l_prefix@/var/davical/run/apache.ssl_scache(512000)
SSLSessionCacheTimeout 300
SSLCipherSuite         ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SetEnvIf               User-Agent ".*MSIE.*" \
                       nokeepalive ssl-unclean-shutdown \
                       downgrade-1.0 force-response-1.0
</IfDefine>

#   secure root directory
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

#   configure PHP
AddType           application/x-httpd-php .php
php_admin_flag    magic_quotes_gpc        on
php_admin_flag    register_globals        on
php_admin_flag    register_argc_argv      off

#   configure DAViCal
php_value         include_path            @l_prefix@/lib/davical/davical/inc:@l_prefix@/lib/davical/davical/htdocs:@l_prefix@/lib/davical/awl/inc
php_value         error_reporting         "E_ALL&~E_NOTICE"
php_value         default_charset         "utf-8"
RewriteEngine     on
RewriteRule       ^/caldav/(.*)$          /caldav.php/$1 [PT]
DocumentRoot      @l_prefix@/lib/davical/davical/htdocs
DirectoryIndex    index.php
<Directory        @l_prefix@/lib/davical/davical/htdocs>
    <IfDefine SSL>
        SSLOptions +StdEnvVars
    </IfDefine>
    Options       None
    AllowOverride None
    Order         allow,deny
    Allow         from all
</Directory>

