Standalone Jetty
Download
- Download Jetty from http://jetty.mortbay.org
. The latest version is available from http://sourceforge.net/project/showfiles.php?group_id=7322&package_id=106252
.
- Extract the downloaded file whereever you like.
Jetty 6
All that is needed is to give your war file (either a downloaded war file or if you build the code your self, the one from dhis-web-portal/target) a name you like and copy it to Jetty's webapps/ directory.
You run Jetty by opening a command window, going to the Jetty directory and typying
Now direct your web browser to [http://localhost:8080/<YOURWEBAPP>]
Jetty can also be installed as a service.
Jetty homepage
Jetty documentation
Configuration - Jetty 5
- Copy your war file (either a downloaded war file or if you build the code your self, the one from dhis-web-portal/target) to Jetty's webapps/ directory.
- Create a file called dhis.xml in Jetty's etc/ directory and copy and paste the code below into the file. Make sure that the name of the war file, which is dhis.war in the code below, matches the war file you copied to the webapps/ directory.
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure 1.2//EN"
"http://jetty.mortbay.org/configure_1_2.dtd">
<Configure class="org.mortbay.jetty.Server">
<Call name="addListener">
<Arg>
<New class="org.mortbay.http.SocketListener">
<Set name="port">8080</Set>
</New>
</Arg>
</Call>
<Call name="addWebApplication">
<Arg>/</Arg>
<Arg>./webapps/dhis.war</Arg>
</Call>
</Configure>
- Create a file called velocity.properties in Jetty's resources directory and copy and paste the code below into the file.
resource.loader=file, class
file.resource.loader.description=Velocity File Resource Loader
file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.cache=true
file.resource.loader.modificationCheckInterval=60
class.resource.loader.description=Velocity Classpath Resource Loader
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache=true
class.resource.loader.modificationCheckInterval=0
- In the same directory you'll find a log4j.properties file. In this file, make sure that all occurences of DEBUG are replaced with WARN.
Errors
If you get an error saying something like:
you need to replace ext/commons-logging.jar with http://www.ibiblio.org/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.jar
. Then try again.