-
Notifications
You must be signed in to change notification settings - Fork 10
Installation
Currently the WeGA-WebApp is designed to run as the only web application within one eXist instance. Following files need to be modified:
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. eXist 2.1 already ships with Saxon-HE 9, you only might want to consider changing caching to "yes" when developing your XSLT Stylesheets. Set it back to "yes" when moving to your production environment.
<transformer class="net.sf.saxon.TransformerFactoryImpl" caching="yes">
<attribute name="http://saxon.sf.net/feature/version-warning"
value="false" type="boolean"/>
</transformer>modules: activate Cache, Compression, DateTime and Image 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/image" class="org.exist.xquery.modules.image.ImageModule" />Replace <Arg>/exist</Arg> under <Call name="addWebApplication"> with <Arg>/</Arg>.
As mentioned before, our eXist web application is supposed to be the only application running within the Jetty server. This directive sets the Jetty root context to our application. The next file (controller-config.xml) will deal with subsequent mappings.
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="/apps/*" path="xmldb:exist:///db/apps"/>
<root pattern="/exist/*" path="/"/>
<root pattern="/*" path="xmldb:exist:///db/webapp"/>
<forward pattern=".*\.(xql|xqy|xquery)$" servlet="XQueryServlet"/>
</configuration>- root pattern
/apps/*will redirect all requests to the database collection "/db/apps" so you can call other apps, especially dashboard and eXide (disable for production use) - root pattern
/exist/*will redirect all requests to "/exist/" to the file system (so you can still access the admin pages – disable for production use) - everything else will be redirected to our "webapp" collection in the database.
Again, deactivate everything you don't need. I especially recommend commenting out all betterform, SOAP and cocoon related stuff.
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>If you are starting eXist via the wrapper, you might want to change all file paths from ${exist.home}/webapp/WEB-INF/logs to ${exist.home}/tools/wrapper/logs so all your logs will be in one place.