# $Id: development.conf,v 1.1.2.6 2008-01-24 18:05:12 mike Exp $

# This is an Apache 2.0 configuration file.

NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
    ServerName x.resolver.indexdata.com

    DocumentRoot    /usr/local/src/cvs/openurl-resolver/web/htdocs
    ErrorLog        /var/log/apache2/keystone-resolver-error.log
    CustomLog       /var/log/apache2/keystone-resolver-access.log combined

    # Environment variables required for running
    PerlSetEnv KRxsltdir /usr/local/src/cvs/openurl-resolver/etc/xslt
    PerlSetEnv KRuser kr_read
    PerlSetEnv KRpw kr_read_3636
    PerlSetEnv KRrwuser kr_admin
    PerlSetEnv KRrwpw kr_adm_3636
#    PerlSetEnv KRdbms mysql

    # Use "sudo a2enmod rewrite" if this section is rejected
    RewriteEngine on
    RewriteLog /var/log/apache2/keystone-resolver-rewrite.log
    RewriteLogLevel 2
    RewriteRule ^/(index.html|resolve|cookiepusherpusher)?$ /mod_perl/$1
    # Why isn't the next rule taken care of by "DirectoryIndex index.html"?
    RewriteRule (.*)/$ $1/index.html
    RewriteRule ^/mod_perl/resolve/(.+) /mod_perl/resolve?opt_db=$1

    PerlOptions +Parent
    PerlSwitches -I/usr/local/src/cvs/openurl-resolver/lib

    <Directory />
	# Can this be right?  Not <Directory .../htdocs>?
	Options FollowSymLinks
	AllowOverride None
    </Directory>
    <Directory /usr/local/src/cvs/openurl-resolver/web/htdocs/mod_perl>
	Options +ExecCGI
	SetHandler perl-script
	PerlHandler ModPerl::Registry
    </Directory>

    # Admin interface uses HTML::Mason
    <Directory /usr/local/src/cvs/openurl-resolver/web/htdocs/admin>
	<FilesMatch "\.(html|css)$">
	    SetHandler perl-script
	    PerlHandler HTML::Mason::ApacheHandler
	</FilesMatch>
	PerlAddVar MasonCompRoot "private => /usr/local/src/cvs/openurl-resolver/web/htdocs/admin"
	PerlSetVar MasonDataDir /tmp/keystone-resolver-mason
    </Directory>
</VirtualHost>
