[% TAGS [- -] %]
[% IF www_csc.apache.port != 443 %]
Listen [% www_csc.apache.port %]
[% END %]

PerlSwitches -I/usr/share/ngcp-www-csc/lib

# ExtendedStatus On

[% IF www_csc.apache.port != 80 && www_admin.apache.port != 80 && ossbss.apache.port != 80 %]
<VirtualHost *:80>
        RewriteEngine On
        RewriteRule ^/(.*) https://%{HTTP_HOST}:[% www_csc.apache.port %]/$1 [L,R]
</VirtualHost>
[% END %]

<VirtualHost *:[% www_csc.apache.port %]>
        ServerAdmin [% www_csc.apache.serveradmin %]
        ServerName [% www_csc.apache.servername %]
        SSLEngine on
        SSLCertificateFile [% www_csc.apache.sslcertfile %]
        SSLCertificateKeyFile [% www_csc.apache.sslcertkeyfile %]

        PerlModule Apache2::RequestUtil csc

        # always keep "Location /" at the top!
        # it will be overridden by later more specific locations
        <Location />
                SetHandler modperl
                PerlResponseHandler csc
        </Location>

        # requires module dumpio
        # LogLevel debug
        # DumpIOInput Off
        # DumpIOOutput Off

        LogLevel [% www_csc.logging.apache.err.level %]
        ErrorLog syslog:[% www_csc.logging.apache.err.facility %]
        CustomLog "|/usr/bin/logger -p [% www_csc.logging.apache.acc.facility %].[% www_csc.logging.apache.acc.level %] -t [% www_csc.logging.apache.acc.identity %]" combined
</VirtualHost>
