# IVLE web application server configuration for Apache 2 with SSL
<VirtualHost *:80>
    ServerName ivle.localhost
    RedirectMatch (.*) https://ivle.localhost$1
</VirtualHost>

<VirtualHost *:80>
    ServerName public.ivle.localhost
    RedirectMatch (.*) https://public.ivle.localhost$1
</VirtualHost>

<VirtualHost *:443>
    ServerName ivle.localhost
    ServerAlias public.ivle.localhost

    # SSL Engine Switch:
    # Enable/Disable SSL for this virtual host.
    SSLEngine on

    # A self-signed (snakeoil) certificate can be created by installing the
    # ssl-cert package.
    # See /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
    # If both key and certificate are stored in the same file, only the
    # SSLCertificateFile directive is needed.
    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    <Location />
        Order allow,deny
        Allow from all

        SetHandler mod_python
        PythonHandler ivle.dispatch
        #PythonDebug On
        PythonOption mod_python.file_session.database_directory /var/lib/ivle/sessions
        PythonOption mod_python.session.cookie_name ivle
    </Location>
</VirtualHost>
