{% if ansible_os_family == "Debian" %}

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
LogLevel warn
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Include mods-available/ssl.load
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*conf

<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

{% elif ansible_os_family == "FreeBSD" %}
Include /usr/local/etc/apache24/httpd.conf
LoadModule ssl_module        libexec/apache24/mod_ssl.so
LoadModule dav_module        libexec/apache24/mod_dav.so
LoadModule dav_svn_module    libexec/apache24/mod_dav_svn.so
LoadModule authz_svn_module  libexec/apache24/mod_authz_svn.so
{% elif ansible_os_family == "Alpine" %}
Include /etc/apache2/httpd.conf
LoadModule dav_module       /usr/lib/apache2/mod_dav.so
LoadModule dav_svn_module   /usr/lib/apache2/mod_dav_svn.so
{% elif ansible_os_family == "RedHat" %}
Include /etc/httpd/conf/httpd.conf
{% endif %}

PidFile {{ subversion_server_dir }}/apache.pid
Listen {{ subversion_repo_ip }}:{{ apache_port }} https
SSLEngine on
SSLCertificateFile	{{ subversion_server_dir }}/server.pem
SSLCertificateKeyFile {{ subversion_server_dir }}/server.key
SSLCertificateChainFile {{ subversion_server_dir }}/server.pem
ErrorLog {{ subversion_server_dir }}/apache2-error.log

<Location /svn>
   DAV svn
   SVNParentPath {{ subversion_server_dir }}
   Require all granted
</Location>

<Location /svnauth>
    DAV svn
    SVNParentPath {{ subversion_server_dir }}
    AuthType Basic
    AuthName "Subversion repositories"
    AuthUserFile {{ subversion_server_dir }}/svn-auth-users
    Require valid-user
</Location>
