# -*- apache -*-

<VirtualHost *:80>
    ServerName www.hgbook.org
    ServerAdmin bos@serpentine.com
    ErrorLog logs/hgbook-error_log
    # Debian:
    # CustomLog logs/hgbook-access_log full
    # Fedora:
    CustomLog logs/hgbook-access_log combined
    Options +MultiViews
    DirectoryIndex index.html.var index.html
    DocumentRoot "/home/bos/hg/hgbook/en/html"

    # Actively redirect requests via a ServerAlias to the canonical hostname.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !=www.hgbook.org
    RewriteRule ^(.*) http://www.hgbook.org$1 [R]

    <Location "/">
        SetHandler python-program
	# hg clone http://bitbucket.org/mirror/django-trunk/
        PythonPath "['/home/bos/hg/django-trunk', '/home/bos/hg/hgbook/web'] + sys.path"
        PythonHandler django.core.handlers.modpython
        PythonAutoReload Off
        SetEnv DJANGO_SETTINGS_MODULE hgbook.settings
        PythonDebug Off
    </Location>

    <Location ~ "^/$">
        SetHandler None
        DirectoryIndex index.html
    </Location>

    <Location ~ "^/index.html">
        SetHandler None
    </Location>

    <Location ~ "^/robots.txt">
        SetHandler None
    </Location>

    <Location "/read">
        SetHandler None
    </Location>

    <Location "/support">
        SetHandler None
    </Location>

    <Location "/media">
        SetHandler None
    </Location>

    Alias /media /home/bos/hg/django-trunk/django/contrib/admin/media

    <Directory "/home/bos/hg/hgbook/en/html">
        Options Indexes FollowSymlinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <Directory "/home/bos/hg/hgbook/en/html">
        AllowOverride AuthConfig
    </Directory>

    <Directory "/home/bos/hg/hgbook/en/html/support">
        Options None
    </Directory>
</VirtualHost>

<Directory "/home/bos/hg/django-trunk/django/contrib/admin/media">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
