# Non-SSL for the CSS Keepalive
<VirtualHost web1.buffalo.edu:8080>
    DocumentRoot "/var/www/html"
    ServerName ps.dev.buffalo.edu
    ServerAdmin admin@buffalo.edu
    ErrorLog logs/web1.buffalo.edu-error_log
    CustomLog logs/web1.buffalo.edu-access_log common

    <Location /csdevss/keepalive.html>
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        RequestHeader unset OAM_REMOTE_USER

        # Public file within a protected directory
        Satisfy Any
        Allow from all
    </Location>

    <Location />
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        # Map the URLs to expose via Apache
        # Expose the console via Apache
        SetHandler weblogic-handler
    </Location>

</VirtualHost>

<VirtualHost web1.buffalo.edu:443>
    DocumentRoot "/var/www/html"
    ServerName ps.dev.buffalo.edu
    ServerAdmin admin@buffalo.edu
    ErrorLog logs/ps.dev.buffalo.edu-error_log
    CustomLog logs/ps.dev.buffalo.edu-access_log common

    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/server.crt
    SSLCertificateKeyFile /etc/pki/tls/private/server.key
    SSLCertificateChainFile /etc/pki/tls/certs/ca-bundle

    RewriteEngine On
    RewriteLogLevel 0
    RewriteLog /tmp/mod_rewrite.log

    RewriteRule ^/$ /psp/csdevss/EMPLOYEE/HRMS/h/?tab=DEFAULT [R,L]

    RewriteCond %{QUERY_STRING} cmd=logout
    RewriteRule .* https://portal.buffalo.edu [R,L]

    RewriteCond %{QUERY_STRING} cmd=login
    RewriteCond %{REQUEST_URI} !ubsis-ss.html
    RewriteRule (.*) /psp/csdevss/EMPLOYEE/HRMS/ubsis-ss.html?cmd=login [R,L]

    RewriteCond %{QUERY_STRING} cmd=expire
    RewriteCond %{REQUEST_URI} !ubsis-ss.html
    RewriteRule (.*) /psp/csdevss/EMPLOYEE/HRMS/ubsis-ss.html?cmd=expire [R,L]

    <Location /csdevss/keepalive.html>
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        RequestHeader unset OAM_REMOTE_USER

        # Public file within a protected directory
        Satisfy Any
        Allow from all
    </Location>

    <Location /csdevss/styles.css>
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        RequestHeader unset OAM_REMOTE_USER

        # Public file within a protected directory
        Satisfy Any
        Allow from all
    </Location>

    <Location /csdevss/images>
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        RequestHeader unset OAM_REMOTE_USER

        # Public file within a protected directory
        Satisfy Any
        Allow from all
    </Location>

    <Location /psp/csdevss/EMPLOYEE/HRMS/ubsis-ss.html>
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        WLTempDir /tmp

        RequestHeader unset OAM_REMOTE_USER

        # Public file within a protected directory
        Satisfy Any
        Allow from all 
    </Location>

    <Location />
        WebLogicHost web1.buffalo.edu
        WebLogicPort 8081
        #WLLogFile /tmp/wlproxy.log
        WLTempDir /tmp

        # Map the URLs to expose via Apache
        # Expose the console via Apache
        SetHandler weblogic-handler

        # Shibboleth Authentication
        AuthType shibboleth
        ShibRequireSession On
        ShibUseHeaders On
	ShibUseEnvironment On
        require valid-user
    </Location>

    <IfModule mod_alias.c>
          <Location /shibboleth-sp>
               Allow from all
          </Location>
          Alias /shibboleth-sp/main.css /usr/share/share/shibboleth/main.css
    </IfModule>

</VirtualHost>
