###################################
#	default.php

ScriptAlias /cgi-bin/ /home/www/cgi-bin/
#NameVirtualHost *:80
NameVirtualHost *:443
ServerName koc.se
ServerAdmin ziver@koc.se

#<VirtualHost *:80>
#    Redirect / http://koc.se
#</VirtualHost>

# WebAdmin {
    <VirtualHost *:80>
        ServerName admin.koc.se:80
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^443$
        RewriteRule ^(.*)$ https://admin.koc.se$1 [L,R]
    </VirtualHost>
    <VirtualHost *:443>
        ServerName admin.koc.se:443
        DocumentRoot  ".$config["apache_www_path"]."/admin

        SSLEngine on
        SSLCertificateFile  ".$config["apache_conf_path"]."/cert/server.crt
        SSLCertificateKeyFile  ".$config["apache_conf_path"]."/cert/server.key
    </VirtualHost>

    <VirtualHost *:80>
        ServerName server:80
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^443$
        RewriteRule ^(.*)$ https://server$1 [L,R]
    </VirtualHost>
    <VirtualHost *:443>
        ServerName server:443
        DocumentRoot  ".$config["apache_www_path"]."/admin

        SSLEngine on
        SSLCertificateFile  ".$config["apache_conf_path"]."/cert/server.crt
        SSLCertificateKeyFile  ".$config["apache_conf_path"]."/cert/server.key
    </VirtualHost>

    <VirtualHost *:80>
        ServerName localhost:80
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^443$
        RewriteRule ^(.*)$ https://localhost$1 [L,R]
    </VirtualHost>
    <VirtualHost *:443>
        ServerName localhost:443
        DocumentRoot ".$config["apache_www_path"]."/admin

        SSLEngine on
        SSLCertificateFile  ".$config["apache_conf_path"]."/cert/server.crt
        SSLCertificateKeyFile  ".$config["apache_conf_path"]."/cert/server.key
    </VirtualHost>

    <VirtualHost *:80>
        ServerName 192.168.0.2:80
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^443$
        RewriteRule ^(.*)$ https://192.168.0.2$1 [L,R]
    </VirtualHost>
    <VirtualHost *:443>
        ServerName 192.168.0.2:443
        DocumentRoot ".$config["apache_www_path"]."/admin

        SSLEngine on
        SSLCertificateFile  ".$config["apache_conf_path"]."/cert/server.crt
        SSLCertificateKeyFile  ".$config["apache_conf_path"]."/cert/server.key
    </VirtualHost>
#}
# Mythweb
#<VirtualHost *:80>
#    ServerName mythtv.koc.se
#    DirectoryIndex mythweb
#    DocumentRoot /var/www
#
#    # Include /etc/apache2/sites-available/mythweb.conf
#</VirtualHost>
# TvHeadend
<VirtualHost *:80>
    ServerName tv.koc.se:80

    ProxyPreserveHost on
    ProxyPass / http://localhost:9981/
    ProxyPassReverse / http://localhost:9981/
</VirtualHost>

