Skip to content
peterstadler edited this page Jan 29, 2013 · 5 revisions

Configuring eXist

Currently the WeGA-WebApp is designed to run as the only web application within one eXist instance. Following files need to be modified:

${EXIST_HOME}/conf.xml

indexer: preserve-whitespace-mixed-content must be set to "yes":

<indexer preserve-whitespace-mixed-content="yes"/>

transformer: must use Saxon for XSLT 2.0 support. Follow instructions for Upgrading eXist for XSLT 2.0 (Saxon) and replace

<transformer class="org.apache.xalan.processor.TransformerFactoryImpl" caching="yes"/>

with

<transformer class="net.sf.saxon.TransformerFactoryImpl" caching="yes">
    <attribute name="http://saxon.sf.net/feature/version-warning" 
            value="false" type="boolean"/>
</transformer>

By the way, when your developing your XSLT Stylesheets you should set caching to "no". Set it back to "yes" when moving to your production environment.

modules: activate Cache, Compression, DateTime, HTTPClient, Image and Math within /xquery/builtin-modules:

<module uri="http://exist-db.org/xquery/cache" class="org.exist.xquery.modules.cache.CacheModule" />
<module uri="http://exist-db.org/xquery/compression" class="org.exist.xquery.modules.compression.CompressionModule" />
<module uri="http://exist-db.org/xquery/datetime"    class="org.exist.xquery.modules.datetime.DateTimeModule" />
<module uri="http://exist-db.org/xquery/httpclient"  class="org.exist.xquery.modules.httpclient.HTTPClientModule" />
<module uri="http://exist-db.org/xquery/image" class="org.exist.xquery.modules.image.ImageModule" />
<module uri="http://exist-db.org/xquery/math"        class="org.exist.xquery.modules.math.MathModule" />

${EXIST_HOME}/mime-types.xml

add a mime type for GZIP:

<mime-type name="application/gzip" type="binary">
    <description>GZIP archive</description>
    <extensions>.gz</extensions>
</mime-type>

${EXIST_HOME}/webapp/WEB-INF/controller-config.xml

Deactivate everything you don't need. A minimal configuration to run the WeGA-WebApp looks like:

<configuration xmlns="http://exist.sourceforge.net/NS/exist">
	<forward pattern="/xmlrpc" servlet="org.exist.xmlrpc.RpcServlet"/>
	<forward pattern="/(rest|servlet)/" servlet="EXistServlet"/>
    <root pattern="/exist/*" path="/"/>
    <root pattern="/*" path="xmldb:exist:///db/webapp"/>
	<forward pattern=".*\.(xql|xqy|xquery)$" servlet="XQueryServlet"/>
</configuration>

Crucial are the root directives that will redirect all requests to "/exist/" to the file system (so you can still access all adminstrative pages) but redirects everything else to our "webapp" collection in the database.

${EXIST_HOME}/webapp/WEB-INF/web.xml

Again, deactivate everything you don't need. I especially recommend commenting out all betterform, SOAP and cocoon related stuff.

log4j.xml

The location of the file depends: when running eXist as a service via the wrapper, the file ${EXIST_HOME}/tools/wrapper/conf/log4j.xml should be modified. Otherwise, it's ${EXIST_HOME}/log4j.xml.

Add an appropriate logger for the WeGA-WebApp (and adapt the location of the log file):

<appender name="wega.core" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="${exist.home}/webapp/WEB-INF/logs/wega.log"/>
    <param name="MaxFileSize" value="500KB"/>
    <param name="Encoding" value="UTF-8"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p (%F [%M]:%L) - %m %n"/>
    </layout>
</appender>

<category name="wega.webapp" additivity="false">
    <priority value="info"/>
    <appender-ref ref="wega.core"/>
</category>

Configuring Digilib

Clone this wiki locally