Use Gwiki WAR archive

How to deploy GWiki as WAR in an Servlet Container or Application Server.

The GWiki WAR contains all necessary libraries, pages etc. to start a Wiki.

Starting point

The easiest way to start GWiki in a standard servlet container - like tomcat, bea weblogic, etc. - is to use the gwiki-webapp project (download prebuild WAR or source repository project gwiki-webapp in Downloads), but you can use also an existant web application project to register GWiki as servlet.

The files

The libraries

GWiki itself uses maven to build the project and fetch the depending libraries. You can also download a prebuild war archive (see Downloads), where all libraries - including gwiki libraries - can be found in the WEB-INF/lib directory.


This is a sample web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="" xmlns:xsi=""
	xsi:schemaLocation=" web-app_2_4.xsd"
	<display-name>Genome Wiki Web</display-name>



			<!--  Register class, loading the GWikiDAOContext -->


Registering the gwiki18n is optional. This uses GWiki as I18N-Backend for standard JSP/Java pages outside GWiki. See also: Use GWiki I18N outside GWiki.
The servlet WikiService is to register the GWiki itelf. In the sample above, GWiki pages are accessable below the /gwiki path (defined via servletPath param.
The servlet paramter ...GWikiBootstrapConfigLoader.className and ...GWikiBootstrapConfigLoader.fileName are used to locate the GWikiContext.xml. In this case it is found in the ServletContext with the path WEB-INF/GWikiContext.xml.
The servlet mapping directs the servlet container to direct all requests /gwiki/* to the WikiService Servlet.
The welcome-file is optional and just redirects requests to the webapplication without any path to the GWiki Servlet.


<?xml version="1.0" encoding="UTF-8"?>
	<bean id="GWikiBootstrapConfig" class="de.micromata.genome.gwiki.model.config.GWikiDAOContext">
		<property name="staticContentFromClassPath" value="true" />
		<property name="storage">
			<bean class="">
					<bean class="de.micromata.genome.gdbfs.ReadWriteCombinedFileSystem">
							<bean class="de.micromata.genome.gdbfs.StdFileSystem">
							<bean class="de.micromata.genome.gdbfs.CpZipRamFileSystem">
		<property name="enableWebDav" value="true" />
		<property name="webDavUserName" value="${gwiki.davadmin.user}" />
		<property name="webDavPasswordHash" value="${gwiki.davadmin.pass}" />

This file defines the basic configuration of GWiki.
It uses the standard file system to store wiki pages. The location ${gwiki.file.path} is a variable, which has to be defined outside.
The properties ${...} can be provided by the JNDI context of the web container or via Java system properties.

The property enableWebDav is optional. If you don't want to enable direct WEBDAV access to the GWiki virtual file system, just set this to "false".


This is a standard definition to deploy f.e. in Tomcat.
Depending on the servlet container you use, this may be defined in anothe way.

<Context reloadable="false" debug="0" cookies="true"  >
	<Parameter name="gwiki.file.path" value="C:/Users/roger/d/dhl/gwiki/gwiki-webapp/gwikifiles" />
	<Parameter name="gwiki.davadmin.user" value="gwikidavadmin"/>
	<!--  gWiki2010Admin -->
	<Parameter name="gwiki.davadmin.pass" value="fyasCKUvAqBMb0JuqQjFpiptvcE\="/>

The context basically only defines some parameter, passed to the servlet.
The gwiki.file.path value has to be an empty directory. There new and modified pages will be stored.


Before using this example, you should change the password. In this example the password is gWiki2010Admin. The hash code of password can be build a SHA hash, based
on the UTF-8 encoding of the string (In source code see encrypt in the GWikiUserAuthorization class.


This is just a dummy Manifest. You may change it to your needs.

Last modified 2013-01-14 18:53 by rkommer. ViewCount: 12055
By Roger Rene Kommer and Micromata