10.3 Deploying on Tomcat
The Daisy webapp can be freely moved out of the DAISY_HOME/daisywiki
directory and deployed on another servlet container. It has no
dependencies on the other stuff from DAISY_HOME, but it does need
access to the daisywiki data directory (not the repository data directory). It
does not need access to the relational database. See also the diagram
in the
Here is how you can deploy Daisy on Tomcat (this was tried with Tomcat 5.0.28, 5.5.17 and 6.0.10):
First copy Daisy's webapp (directory DAISY_HOME/daisywiki/webapp) to TOMCAT_HOME/webapps/cocoon (thus the webapp directory gets renamed to cocoon).
Then make sure recent versions of xerces and xalan are in the endorsed library path of Tomcat, you can do this like this (in the Tomcat directory):
$ ls common/endorsed/ xercesImpl.jar xml-apis.jar $ rm common/endorsed/* $ cp webapps/cocoon/WEB-INF/lib/xercesImpl-<version>.jar common/endorsed/ $ cp webapps/cocoon/WEB-INF/lib/xml-apis.jar common/endorsed/ $ cp webapps/cocoon/WEB-INF/lib/xalan-<version>.jar common/endorsed/
To avoid encoding problems, edit the file TOMCAT_HOME/conf/server.xml, search for the element <Connector port="8080" ... and add to it the following two attributes:
URIEncoding="UTF-8" useBodyEncodingForURI="true"
Also, make sure your file encoding is set to UTF-8 (e.g. via the CATALINA_OPTS environment variable):
export CATALINA_OPTS=-Dfile.encoding=UTF-8
To inform the webapp of the location of the wikidata directory, a system property daisywiki.data should be supplied. This can be done as follows:
Windows: set CATALINA_OPTS=-Ddaisywiki.data=<path to wikidata directory> Linux: export CATALINA_OPTS=-Ddaisywiki.data=<path to wikidata directory>
However, this does not work if you want to deploy the Daisy Wiki webapp
multiple times inside the same servlet container, using different wikidata
directories. In that case, you might either specify the daisyswiki.data
parameter
<?xml version="1.0" encoding="UTF-8"?> <Context reloadable="true"> <!-- specify wiki data directoty --> <Parameter name="daisywiki.data" value="/path/to/your/daisy/wiki/data" override="false" /> ... </Context>
See
Now start Tomcat, and surf to http://localhost:8080/cocoon/daisy/. That's all there is to it. Note that Daisy requires an expanded webapp, not a war archive.
Previous