<VirtualHost *:80>
    DocumentRoot /usr/share/kdav/

    LogFormat "%{X-Forwarded-For}i %{%a %b %d %T %Y}t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
    ErrorLog "|/bin/cat"
    CustomLog "|/bin/cat" proxy

    RewriteEngine On
    # redirect well-known url http://sabre.io/dav/service-discovery/
    # (redirect may need to be done to the absolute external url)
    RewriteRule ^/.well-known/carddav$ / [R]
    RewriteRule ^/.well-known/caldav$ / [R]
    # This makes every request go to server.php
    RewriteRule ^/(.*)$ /server.php [L]

    # Output buffering needs to be off, to prevent high memory usage
    php_flag output_buffering off

    # This is also to prevent high memory usage
    php_flag always_populate_raw_post_data off

    # SabreDAV is not compatible with mbstring function overloading
    php_flag mbstring.func_overload off

    # set higher limits by default
    php_value memory_limit 256M
    php_value max_execution_time 259200

</VirtualHost>
