← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11048: dhis2-tools ubuntu debian package - WIP

 

------------------------------------------------------------
revno: 11048
committer: Bob Jolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-28 13:06:12 +0100
message:
  dhis2-tools ubuntu debian package - WIP
added:
  tools/dhis2-tools-deb/
  tools/dhis2-tools-deb/.bzrignore
  tools/dhis2-tools-deb/Makefile
  tools/dhis2-tools-deb/assemble.sh
  tools/dhis2-tools-deb/docs/
  tools/dhis2-tools-deb/docs/Makefile
  tools/dhis2-tools-deb/docs/manual.xml
  tools/dhis2-tools-deb/install.sh
  tools/dhis2-tools-deb/pkg/
  tools/dhis2-tools-deb/pkg/DEBIAN/
  tools/dhis2-tools-deb/pkg/DEBIAN/conffiles
  tools/dhis2-tools-deb/pkg/DEBIAN/control
  tools/dhis2-tools-deb/pkg/DEBIAN/postinst
  tools/dhis2-tools-deb/pkg/DEBIAN/postrm
  tools/dhis2-tools-deb/pkg/DEBIAN/preinst
  tools/dhis2-tools-deb/pkg/etc/
  tools/dhis2-tools-deb/pkg/etc/sudoers.d/
  tools/dhis2-tools-deb/pkg/etc/sudoers.d/dhis2
  tools/dhis2-tools-deb/pkg/usr/
  tools/dhis2-tools-deb/pkg/usr/bin/
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-backup
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-create-admin
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-deploy-stable
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-instance-create
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-logview
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-nginx
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-restoredb
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-shutdown
  tools/dhis2-tools-deb/pkg/usr/bin/dhis2-startup
  tools/dhis2-tools-deb/pkg/usr/share/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc/copyright
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/dhis2-ssl
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/http-redirect
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx/dhis2
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/backups/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin/setenv.sh
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/Catalina/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/catalina.properties
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/context.xml
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logging.properties
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logrotate.conf
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/server.xml
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/tomcat-users.xml
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/web.xml
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/lib/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/logs/
  tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/webapps/
  tools/dhis2-tools-deb/pkg/usr/share/doc/
  tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/
  tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/changelog.gz
  tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/copyright
  tools/dhis2-tools-deb/pkg/usr/share/man/
  tools/dhis2-tools-deb/pkg/usr/share/man/man1/
  tools/dhis2-tools-deb/pkg/var/
  tools/dhis2-tools-deb/pkg/var/lib/
  tools/dhis2-tools-deb/pkg/var/lib/dhis2/
  tools/dhis2-tools-deb/pkg/var/log/
  tools/dhis2-tools-deb/pkg/var/log/dhis2/
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/gml2dxf.xsl
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/exp/ExportDataMartAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/gml2dxf.xsl'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/gml2dxf.xsl	2011-10-28 12:24:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/gml2dxf.xsl	2013-05-28 12:06:12 +0000
@@ -38,7 +38,7 @@
     <id>0</id>
     <uuid/>
     <name><xsl:value-of select="$name"/></name>
-    <shortName><xsl:value-of select="$name"/></shortName>
+    <shortName><xsl:value-of select="substring($name,1,50)"/></shortName>
     <code/>
     <openingDate/>
     <closedDate/>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/exp/ExportDataMartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/exp/ExportDataMartAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/exp/ExportDataMartAction.java	2013-05-28 12:06:12 +0000
@@ -65,6 +65,9 @@
     // TODO: experiment with different sizes for this to stop data dribbling out
     private static final int GZIPBUFFER = 8192;
 
+    // dummy figure to keep legacy mydatamart happy
+    private static final int DUMMYCOUNT = 100000;
+
     private static final Log log = LogFactory.getLog( ExportDataMartAction.class );
 
     private static final DateFormat dateFormat = new SimpleDateFormat( "yyyyMMdd" );
@@ -233,8 +236,12 @@
         OutputStream out = null;
 
         // how many rows do we expect
-        int count = exportPivotViewService.count( requestType, pType, start, end, dataSourceLevel, dataSourceRoot );
-
+        // int count = exportPivotViewService.count( requestType, pType, start, end, dataSourceLevel, dataSourceRoot );
+        
+        // Turns out it is too expensive to count the size of the resultset on large datamarts
+        // so we just return a dummy value here
+        int count = DUMMYCOUNT;
+        
         ContextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_GZIP, true, filename, true );
 
         // write number of rows to custom header

=== added directory 'tools/dhis2-tools-deb'
=== added file 'tools/dhis2-tools-deb/.bzrignore'
--- tools/dhis2-tools-deb/.bzrignore	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/.bzrignore	2013-05-28 12:06:12 +0000
@@ -0,0 +1,2 @@
+*.deb
+*~

=== added file 'tools/dhis2-tools-deb/Makefile'
--- tools/dhis2-tools-deb/Makefile	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/Makefile	2013-05-28 12:06:12 +0000
@@ -0,0 +1,17 @@
+TARGET=dhis2-tools_1.0-0ubuntu1_all.deb
+
+all: deb test
+
+deb: doc
+	./assemble.sh $(TARGET)
+
+doc:
+	cd docs; make; cd ..
+
+test: 
+	lintian $(TARGET)
+
+clean:
+	rm -f $(TARGET)
+	rm -rf *~
+	cd docs; make clean; cd ..

=== added file 'tools/dhis2-tools-deb/assemble.sh'
--- tools/dhis2-tools-deb/assemble.sh	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/assemble.sh	2013-05-28 12:06:12 +0000
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cd ./pkg
+find . -iname  *~ -exec rm '{}' ';'
+find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums
+chmod 644 DEBIAN/md5sums
+cd ..
+
+fakeroot dpkg -b ./pkg $1
+

=== added directory 'tools/dhis2-tools-deb/docs'
=== added file 'tools/dhis2-tools-deb/docs/Makefile'
--- tools/dhis2-tools-deb/docs/Makefile	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/docs/Makefile	2013-05-28 12:06:12 +0000
@@ -0,0 +1,8 @@
+man: manual.xml
+	docbook2x-man manual.xml
+	gzip -f -9  *.1
+	cp -f *.1.gz ../pkg/usr/share/man/man1
+	chmod 0644 ../pkg/usr/share/man/man1/*
+
+clean:
+	rm -f  *.gz

=== added file 'tools/dhis2-tools-deb/docs/manual.xml'
--- tools/dhis2-tools-deb/docs/manual.xml	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/docs/manual.xml	2013-05-28 12:06:12 +0000
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                      "http://www.docbook.org/xml/4.5/docbookx.dtd";>
+<book>
+  <bookinfo>
+    <title>DHIS2 server tools manual</title>
+    <author>
+      <firstname>Bob</firstname>
+      <surname>Jolliffe</surname>
+    </author>
+  </bookinfo>
+
+  <chapter>
+    <title>Overview</title>
+    <para>Installing and managing DHIS2.</para>
+  </chapter>
+
+  <chapter>
+    <title>DHIS2 tools</title>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-instance-create</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-instance-create</refname>
+        <refpurpose>Creates a new dhis2 instance</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-instance-create</command>
+          <arg choice="opt">
+            <option>OPTIONS</option>
+          </arg>
+          <arg choice="plain">name</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Use this tool to create a new dhis2 instance in a tomcat container.</para>
+      </refsect1>
+      <refsect1>
+        <title>OPTIONS</title>
+        <variablelist>
+          <varlistentry>
+            <term>-p</term>
+            <listitem><para>http port</para></listitem>
+          </varlistentry>
+        </variablelist>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>Create it like this</para>
+      </refsect1>
+    </refentry>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-startup</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-startup</refname>
+        <refpurpose>Starts a dhis2 instance</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-startup</command>
+          <arg choice="opt">instance name</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Start a dhis2 instance</para>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>dhis2-startup myInstance</para>
+      </refsect1>
+    </refentry>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-shutdown</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-shutdown</refname>
+        <refpurpose>Stops a dhis2 instance</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-shutdown</command>
+          <arg choice="opt">instance name</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Stop a dhis2 instance</para>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>dhis2-shutdown myInstance</para>
+      </refsect1>
+    </refentry>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-deploy-stable</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-deploy-stable</refname>
+        <refpurpose>Deploys a war file</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-deploy-stable</command>
+          <arg choice="opt">instance name</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Deploys the latest stable dhis2 war file from http://stable.dhis2.org.</para>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>dhis2-deploy-stable myInstance</para>
+      </refsect1>
+    </refentry>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-logview</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-logview</refname>
+        <refpurpose>Shows log file</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-logview</command>
+          <arg choice="opt">instance name</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Use this tool to view log of dhis2 instance using less.</para>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>dhis2-logview myInstance</para>
+      </refsect1>
+    </refentry>
+
+    <!-- ============================================================================== -->
+    <refentry>
+      <refmeta>
+        <refentrytitle>dhis2-create-admin</refentrytitle>
+        <manvolnum>1</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname>dhis2-create-admin</refname>
+        <refpurpose>Create a user for administering dhis2 instances</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <cmdsynopsis>
+          <command>/usr/bin/dhis2-create-admin</command>
+          <arg choice="opt">username</arg>
+        </cmdsynopsis>
+      </refsynopsisdiv>
+
+      <refsect1>
+        <title>Description</title>
+        <para>Creates a new dhis2 admin user. If the specified user does not exist, she will be
+          created on the system. Otherwise an existing user is modified. The dhis2 admin user will
+          have postgres superuser privileges and wil be a member of the dhis2admin group. </para>
+      </refsect1>
+      <refsect1>
+        <title>Examples</title>
+        <para>Create it like this</para>
+      </refsect1>
+    </refentry>
+  </chapter>
+</book>

=== added file 'tools/dhis2-tools-deb/install.sh'
--- tools/dhis2-tools-deb/install.sh	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/install.sh	2013-05-28 12:06:12 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+# set -e
+
+# need to use a ppa for postgres 9.2 and nginx
+sudo apt-get -y install python-software-properties -y
+sudo add-apt-repository ppa:pitti/postgresql -y 
+sudo add-apt-repository ppa:nginx/stable -y 
+sudo apt-get -y update
+
+# install the dhis2-tools deb
+dpkg -i dhis2-tools* 
+apt-get -y install -f

=== added directory 'tools/dhis2-tools-deb/pkg'
=== added directory 'tools/dhis2-tools-deb/pkg/DEBIAN'
=== added file 'tools/dhis2-tools-deb/pkg/DEBIAN/conffiles'
--- tools/dhis2-tools-deb/pkg/DEBIAN/conffiles	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/DEBIAN/conffiles	2013-05-28 12:06:12 +0000
@@ -0,0 +1,1 @@
+/etc/sudoers.d/dhis2

=== added file 'tools/dhis2-tools-deb/pkg/DEBIAN/control'
--- tools/dhis2-tools-deb/pkg/DEBIAN/control	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/DEBIAN/control	2013-05-28 12:06:12 +0000
@@ -0,0 +1,14 @@
+Package: dhis2-tools
+Source: dhis2-tools
+Version: 1.0
+Architecture: all
+Maintainer: DHIS2 developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
+Installed-Size: 236
+Depends: openjdk-7-jdk,tomcat7-common (>= 7.0.26-1ubuntu1.1),netcat,nginx,ttf-liberation,libtcnative-1,makepasswd,postgresql-9.2
+Section: java
+Priority: optional
+Homepage: http://launchpad.net/dhis2
+Description: Tools for managing dhis2 on ubuntu
+ This package contains a set of tools to assist with
+ the installation and maintenance of the dhis2 (http://dhis2.org)
+ software on ubuntu server.

=== added file 'tools/dhis2-tools-deb/pkg/DEBIAN/postinst'
--- tools/dhis2-tools-deb/pkg/DEBIAN/postinst	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/DEBIAN/postinst	2013-05-28 12:06:12 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+echo "create group for dhis instances and group for dhis admins"
+addgroup dhis2admin 2>/dev/null || { echo "dhis2admin group exists"; }
+addgroup dhis2 2>/dev/null || { echo "dhis2 group exists"; }
+
+# echo "apache module setup"
+# a2enmod rewrite headers proxy_ajp disk_cache ssl
+
+exit 0

=== added file 'tools/dhis2-tools-deb/pkg/DEBIAN/postrm'
--- tools/dhis2-tools-deb/pkg/DEBIAN/postrm	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/DEBIAN/postrm	2013-05-28 12:06:12 +0000
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+# remove dhis2 user groups
+delgroup dhis2 2>dev/null || { echo "dhis2 group doesn't exist"; } 
+delgroup dhis2admin 2>/dev/null || { echo "dhis2admin group doesn't exist"; } 

=== added file 'tools/dhis2-tools-deb/pkg/DEBIAN/preinst'
--- tools/dhis2-tools-deb/pkg/DEBIAN/preinst	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/DEBIAN/preinst	2013-05-28 12:06:12 +0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+echo "Some preinstallation tasks ..."
+
+exit 0

=== added directory 'tools/dhis2-tools-deb/pkg/etc'
=== added directory 'tools/dhis2-tools-deb/pkg/etc/sudoers.d'
=== added file 'tools/dhis2-tools-deb/pkg/etc/sudoers.d/dhis2'
--- tools/dhis2-tools-deb/pkg/etc/sudoers.d/dhis2	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/etc/sudoers.d/dhis2	2013-05-28 12:06:12 +0000
@@ -0,0 +1,10 @@
+# sudoers file for dhis2 admins
+Cmnd_Alias DHIS2CREATE = /usr/bin/dhis2-instance-create
+Cmnd_Alias DHIS2PROGS = /usr/bin/dhis2-*
+
+Runas_Alias DHIS2USERS = %dhis2
+
+# Dhis2 admins can run dhis2-instance-create as root
+%dhis2admin ALL=(root)NOPASSWD:DHIS2CREATE,/usr/sbin/useradd
+# Dhis2 admins can run all dhis2 progs as the dhis2 instance user 
+%dhis2admin ALL=(DHIS2USERS) ALL

=== added directory 'tools/dhis2-tools-deb/pkg/usr'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/bin'
=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-backup'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-backup	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-backup	2013-05-28 12:06:12 +0000
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+#########################################################
+# postgres backup script v1.2
+# author: Bob Jolliffe
+# licence: public domain 
+#
+# using some ideas from 
+# http://wiki.postgresql.org/wiki/Automated_Backup_on_Linux
+#########################################################
+
+BACKUP_DIR=~/backups/
+# REMOTE="ghbackup@178.79.143.102:./dhis"
+USER=$USER
+DBNAME=$USER
+# Keep Sunday's backup
+DAY_OF_WEEK_TO_KEEP=7
+WEEKS_TO_KEEP=6
+DAYS_TO_KEEP=7
+
+EXCLUDED="-T aggregated* -T analytics* -T completeness*"
+
+function perform_backups()
+{
+  SUFFIX=$1
+  FINAL_BACKUP_DIR=$BACKUP_DIR/backup"`date +\%Y-\%m-\%d`$SUFFIX/"
+  
+  if ! mkdir -p $FINAL_BACKUP_DIR; then
+        echo "`date` Cannot create backup directory in $FINAL_BACKUP_DIR. Go and fix it!"
+        exit 1;
+  fi;
+
+  if ! pg_dump -O -Fp $DBNAME $EXCLUDED | gzip > $FINAL_BACKUP_DIR"$DBNAME".sql.gz.in_progress; then
+      echo "`date` [!!ERROR!!] Failed to produce plain backup of database $DBNAME"
+  else
+    mv $FINAL_BACKUP_DIR"$DBNAME".sql.gz.in_progress $FINAL_BACKUP_DIR"$DBNAME".sql.gz
+    # sync to remote server
+    # rsync -avq $BACKUP_DIR $REMOTE
+  fi
+}
+
+# MONTHLY BACKUPS
+DAY_OF_MONTH=`date +%d`
+ 
+if [ $DAY_OF_MONTH = "01" ];
+then
+	# Delete all expired monthly directories
+	find $BACKUP_DIR -maxdepth 1 -name "*-monthly" -exec rm -rf '{}' ';'
+ 
+	perform_backups "-monthly"
+ 
+	exit 0;
+fi
+ 
+# WEEKLY BACKUPS
+DAY_OF_WEEK=`date +%u` #1-7 (Monday-Sunday)
+EXPIRED_DAYS=`expr $((($WEEKS_TO_KEEP * 7) + 1))`
+ 
+if [ $DAY_OF_WEEK = $DAY_OF_WEEK_TO_KEEP ];
+then
+	# Delete all expired weekly directories
+	find $BACKUP_DIR -maxdepth 1 -mtime +$EXPIRED_DAYS -name "*-weekly" -exec rm -rf '{}' ';'
+ 
+	perform_backups "-weekly"
+ 
+	exit 0;
+fi
+
+# Delete daily backups 7 days old or more
+find $BACKUP_DIR -maxdepth 1 -mtime +$DAYS_TO_KEEP -name "*-daily" -exec rm -rf '{}' ';'
+ 
+perform_backups "-daily"
+
+

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-create-admin'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-create-admin	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-create-admin	2013-05-28 12:06:12 +0000
@@ -0,0 +1,26 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance log viewer
+
+if [ "$#" -ne 1 ]; then
+  echo "usage: dhis2-create-admin <user>"
+  exit 1
+fi
+
+ADMINUSER=$1
+
+# if user doesn't exist, create
+id -u $ADMINUSER >/dev/null 2>&1 || {
+    sudo adduser $ADMINUSER
+}
+
+# give user superuser access to postgres
+sudo -u postgres dropuser $ADMINUSER 2>/dev/null || { echo "Creating new postgresql role"; }
+sudo -u postgres createuser -s $ADMINUSER
+# join the dhis2admin group
+sudo usermod -a -G dhis2admin $ADMINUSER

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-deploy-stable'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-deploy-stable	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-deploy-stable	2013-05-28 12:06:12 +0000
@@ -0,0 +1,25 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance startup script
+
+set -e
+
+if [ "$#" -ne 1 ]; then
+  echo "usage: dhis2-deploy-stable <instance name>"
+  exit 1
+fi
+
+INSTANCE=$1
+DHIS2STABLE="http://stable.dhis2.org";
+
+dhis2-shutdown $INSTANCE 2>/dev/null || { echo $INSTANCE not running; } 
+# clean out existing webapps
+sudo -u $INSTANCE rm -rf /var/lib/dhis2/$INSTANCE/webapps/* 1>/dev/null 2>&1 || { echo "No $INSTANCE webapps"; exit 1; } 
+# get the latest stable dhis.war
+sudo -u $INSTANCE wget -O /var/lib/dhis2/$INSTANCE/webapps/$INSTANCE.war $DHIS2STABLE
+dhis2-startup $INSTANCE

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-instance-create'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-instance-create	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-instance-create	2013-05-28 12:06:12 +0000
@@ -0,0 +1,167 @@
+#!/bin/bash
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   Script to deploy a dhis2 instance
+
+set -e
+
+#############################################################
+# the user who is running the deploy script
+# should be in dhis2admin group
+
+if [[ "$(groups $USER)" =~ dhis2admin ]]
+then
+  echo "Good. User is in dhis2admin group"
+else
+  echo "$USER is not in dhis2admin group.  You must be in the dhis2admin group to deploy a new instance"
+  exit 1
+fi
+##############################################################
+# variables and default values
+DHIS2BASEDIR=/var/lib/dhis2
+DHIS2SKEL=/usr/share/dhis2-tools/skel
+
+PROG=`basename $0`
+HTTPPORT=8080
+CREATEDB=true
+###############################################################
+usage() {
+  echo "Usage: $PROG [options] <instance>"
+  echo "  instance: name of the dhis2 instance to create"
+  echo "Options:"
+  echo "  -h, --help       Display this help message"
+  echo "  -n               Do NOT create database for instance"
+  echo "  -p httpport      HTTP port to be used by Tomcat (default is $HTTPPORT)"
+}
+
+###############################################################
+checkport() {
+  type=$1
+  port=$2
+  echo "Checking $type port $port"
+  # Fail if port is non-numeric
+  num=`expr ${port} + 1 2> /dev/null`
+  if [ $? != 0 ] || [ $num -lt 2 ]; then
+    echo "Error: ${type} port '${port}' is not a valid TCP port number."
+    exit 1
+  fi
+
+  # Fail if port is above 65535
+  if [ ${port} -gt 65535 ]; then
+    echo "Error: ${type} port ${port} is above TCP port numbers (> 65535)."
+    exit 1
+  fi
+
+  # Fail if port is below 1024
+  if [ ${port} -lt 1024 ]; then
+    echo "Error: ports below 1024 are reserved to the super-user."
+    exit 1
+  fi
+
+  # Fail if port appears to be in use
+  if nc localhost "${port}" -z > /dev/null; then
+    echo "Error: ${type} port ${port} appears to be in use."
+    exit 1
+  fi
+}
+###############################################################
+
+# main entry point 
+echo checking options
+while getopts p:nh opt
+do
+  case $opt in
+    p) HTTPPORT=$OPTARG ;;
+    n) CREATEDB=false ;;
+    h) usage;;
+    *) echo "Error: Unknown parameter '$OPTARG'."
+        exit 1;;
+  esac
+done
+
+shift $(($OPTIND - 1))
+
+if [ "$#" -lt 1 ]; then
+  usage
+  exit 1
+fi
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+  usage
+  exit 0
+fi
+
+
+TARGET=$1
+# TODO: parameterize database name
+DBNAME=$TARGET
+DHIS2HOME=$DHIS2BASEDIR/$TARGET
+
+# Fail if no target specified
+if [ -z "${TARGET}" ]; then
+  echo "Error: No Dhis2 instance name specified"
+  exit 1
+fi
+echo "You are about to create a Dhis2 instance called '$TARGET'"
+
+###############################################################
+
+#  perform some checks before doing anything
+
+id -u $TARGET >/dev/null 2>&1 && { echo "User $TARGET already exists"; exit 1; }
+checkport HTTP "$HTTPPORT"
+if $CREATEDB; then
+  sudo -u postgres psql $DBNAME -c '\q' >/dev/null 2>&1 && { echo "Database $DBNAME exists"; exit 1; }
+fi
+###############################################################
+
+#  Right, we should be good to go ...
+
+# create the system user
+sudo useradd -m -s /bin/bash -b $DHIS2BASEDIR -c "$TARGET dhis2 instance" -g dhis2 -k $DHIS2SKEL $TARGET
+# create the database user with a strong password
+PASSWORD=$(makepasswd --chars=10)
+sudo -u postgres psql -c "CREATE ROLE $TARGET PASSWORD '$PASSWORD' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;"
+
+if $CREATEDB; then
+  # Create the database
+  sudo -u postgres psql -c  "CREATE DATABASE $DBNAME OWNER $TARGET ENCODING 'UTF-8' TEMPLATE template0;"
+  sudo -u postgres psql -c  "GRANT ALL ON DATABASE $DBNAME TO $TARGET;"
+fi
+
+sudo -u $TARGET sh -c "cat > $DHIS2HOME/hibernate.properties" << EOT
+hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
+hibernate.connection.driver_class = org.postgresql.Driver
+hibernate.connection.url = jdbc:postgresql://localhost:5432/$DBNAME
+hibernate.connection.username = $TARGET
+hibernate.connection.password = $PASSWORD
+hibernate.hbm2ddl.auto = update
+EOT
+
+sudo -u $TARGET chmod 0600  $DHIS2HOME/hibernate.properties
+sudo -u $TARGET sed -i s/HTTPPORT/$HTTPPORT/ $DHIS2HOME/conf/server.xml
+
+sudo -u $TARGET sh -c "cat > $DHIS2HOME/logrotate.conf" << EOT
+$DHIS2HOME/logs/catalina.out {
+   rotate 24
+   dateext
+   monthly
+   create
+   compress
+   copytruncate
+   noolddir
+}
+EOT
+
+###############################################################
+
+# setup user crontab
+
+sudo -u $TARGET sh -c "crontab -u $TARGET -" << EOT
+@reboot /usr/bin/dhis2-startup $TARGET
+20 19 * * * /usr/bin/dhis2_backup $TARGET
+21 00 * * * /usr/sbin/logrotate -s $DHIS2HOME/logrotate.status $DHIS2HOME/logrotate.conf
+EOT

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-logview'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-logview	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-logview	2013-05-28 12:06:12 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance log viewer
+
+if [ "$#" -ne 1 ]; then
+  echo "usage: dhis2-logview <instance name>"
+  exit 1
+fi
+
+INSTANCE=$1
+
+sudo -u $INSTANCE less /var/lib/dhis2/$INSTANCE/logs/catalina.out

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-nginx'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-nginx	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-nginx	2013-05-28 12:06:12 +0000
@@ -0,0 +1,25 @@
+#!/bin/bash
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance startup script
+
+if [ "$#" -lt 1 ]; then 
+  echo "No conf file specifiied - using default" 
+  CONFFILE=/usr/share/dhis2-tools/samples/nginx/dhis2
+else
+  CONFFILE=$1
+fi
+
+BASE=$(basename $CONFFILE)
+
+# nginx setup
+echo "setting up nginx with $CONFFILE"
+[[ -e /etc/nginx/sites-available/$BASE ]] && { echo "/etc/nginx/sites-available/$BASE already exists"; exit 1; } 
+cp $CONFFILE /etc/nginx/sites-available
+unlink /etc/nginx/sites-enabled/* || { echo "no nginx sites configured"; } 
+ln -s /etc/nginx/sites-available/$BASE /etc/nginx/sites-enabled/$BASE                
+/etc/init.d/nginx restart

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-restoredb'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-restoredb	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-restoredb	2013-05-28 12:06:12 +0000
@@ -0,0 +1,34 @@
+#!/bin/bash
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   Script to restore a database dump
+
+set -e
+
+if [ "$#" -ne 2 ]; then
+  echo "usage: dhis2-restoredb <instance name> <dbdump>"
+  exit 1
+fi
+
+DHIS2_USER=$INSTANCE
+DHIS2_DB=$INSTANCE
+DHIS2_BASE=/var/lib/dhis2/$DHIS2_USER
+BACKUP=$DHIS2_BASE/backup/snapshot_$(date +%Y%m%d%M%S).sql.bz2
+
+# stop tomcat and take a snapshot backup of the current database before doing anything
+dhis2-shutdown $INSTANCE
+sudo -u postgres pg_dump -O $INSTANCE | bzip2 > $BACKUP
+
+# drop and recreate a new blank database
+sudo -u postgres dropdb $DHIS2_DB
+sudo -u postgres createdb -O $DHIS2_USER $DHIS2_DB
+
+# restore the backup into the new database
+cat $2 | sudo -u postgres psql $DHIS2_DB
+
+# restart tomcat
+dhis2-startup $INSTANCE
\ No newline at end of file

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-shutdown'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-shutdown	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-shutdown	2013-05-28 12:06:12 +0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance startup script
+
+if [ "$#" -ne 1 ]; then
+  echo "usage: dhis2-shutdown <instance name>"
+  exit 1
+fi
+
+INSTANCE=$1
+PID=$(cat /var/lib/dhis2/$INSTANCE/tomcat.pid)
+echo "Shutting down dhis2 instance"
+sudo -u $INSTANCE kill $PID || sudo -u $INSTANCE rm $PID 

=== added file 'tools/dhis2-tools-deb/pkg/usr/bin/dhis2-startup'
--- tools/dhis2-tools-deb/pkg/usr/bin/dhis2-startup	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/bin/dhis2-startup	2013-05-28 12:06:12 +0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+#   DHIS2 instance startup script
+
+if [ "$#" -ne 1 ]; then
+  echo "usage: dhis2-startup <instance name>"
+  exit 1
+fi
+
+INSTANCE=$1
+
+sudo -u $INSTANCE CATALINA_BASE=/var/lib/dhis2/$INSTANCE /usr/share/tomcat7/bin/startup.sh
+echo "DHIS2 instance starting for $INSTANCE"
\ No newline at end of file

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc/copyright'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc/copyright	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/doc/copyright	2013-05-28 12:06:12 +0000
@@ -0,0 +1,24 @@
+Copyright (c) 2004-2007, University of Oslo
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of the HISP project nor the names of its contributors may
+  be used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/dhis2-ssl'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/dhis2-ssl	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/dhis2-ssl	2013-05-28 12:06:12 +0000
@@ -0,0 +1,78 @@
+<IfModule mod_ssl.c>
+  <VirtualHost _default_:443>
+
+	#===========================================================
+        # tomcat backends
+	#===========================================================
+	# ProxyPass /DHISMAIN ajp://localhost:DHISMAINPORT/DHISMAIN
+       
+	#===========================================================
+        # try and cache whatever we can
+	#===========================================================
+	CacheEnable disk /
+ 
+	#===========================================================
+	# Rewrite requests for / to main dhis application
+	#===========================================================
+        RewriteEngine on
+        # RewriteRule   ^/$  /DHISMAIN/  [R]
+
+	#===========================================================
+        # Logging
+	#===========================================================
+	ErrorLog /var/log/apache2/error.log
+	LogLevel warn
+	CustomLog /var/log/apache2/ssl_access.log combined
+
+	#===========================================================
+	# standard web server document root for serving content 
+	# outside of dhis2 webapp
+	#===========================================================
+	DocumentRoot /var/www
+	<Directory />
+		Options FollowSymLinks
+		AllowOverride None
+	</Directory>
+	<Directory /var/www/>
+		Options Indexes FollowSymLinks MultiViews
+		AllowOverride None
+		Order allow,deny
+		allow from all
+	</Directory>
+
+	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+	<Directory "/usr/lib/cgi-bin">
+		AllowOverride None
+		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+		Order allow,deny
+		Allow from all
+	</Directory>
+
+	#===========================================================
+	# SSL configuration
+	#===========================================================
+	SSLEngine on
+	
+	# set these to match your server certificate and key
+	SSLCertificateFile    /etc/ssl/certs/server.cer
+	SSLCertificateKeyFile /etc/ssl/private/server.key
+        # some CA's might also provide you with a CA cert to install
+	# SSLCACertificateFile /etc/ssl/certs/EV_CA_Bundle.pem
+	
+	SSLProtocol all
+	SSLCipherSuite HIGH:MEDIUM
+
+	<FilesMatch "\.(cgi|shtml|phtml|php)$">
+		SSLOptions +StdEnvVars
+	</FilesMatch>
+	<Directory /usr/lib/cgi-bin>
+		SSLOptions +StdEnvVars
+	</Directory>
+
+	BrowserMatch "MSIE [2-6]" \
+		nokeepalive ssl-unclean-shutdown \
+		downgrade-1.0 force-response-1.0
+	BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
+
+  </VirtualHost>
+</IfModule>

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/http-redirect'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/http-redirect	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/apache2/http-redirect	2013-05-28 12:06:12 +0000
@@ -0,0 +1,5 @@
+<VirtualHost *:80>
+	ServerAdmin webmaster@localhost
+        ServerName SERVERNAME
+        Redirect permanent / https://SERVERNAME/
+</VirtualHost>

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx/dhis2'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx/dhis2	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/samples/nginx/dhis2	2013-05-28 12:06:12 +0000
@@ -0,0 +1,38 @@
+# apply these settings to all backends
+proxy_cache_path  /var/cache/nginx  keys_zone=dhis:250m  inactive=1d;
+proxy_redirect    off;
+proxy_set_header  Host               $host;
+proxy_set_header  X-Real-IP          $remote_addr;
+proxy_set_header  X-Forwarded-For    $proxy_add_x_forwarded_for;
+proxy_set_header  X-Forwarded-Proto  https;
+proxy_cache       dhis;
+
+# redirect http to https server
+server {
+  listen     80;
+  rewrite    ^ https://$host$request_uri? permanent;
+}
+
+# HTTPS server
+server {
+  listen               443;
+  client_max_body_size 10M;
+
+  # ssl stuff
+  ssl                  on;
+  ssl_certificate      /etc/ssl/certs/ssl-cert-snakeoil.pem;
+  ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;
+  ssl_session_timeout  30m;
+
+  ssl_protocols              SSLv2 SSLv3 TLSv1;
+  ssl_ciphers                HIGH:!aNULL:!MD5;
+  ssl_prefer_server_ciphers  on;
+
+  # nominate a backend as the default
+  rewrite ^/$ /dhis/;
+ 
+  # Proxy pass to servlet containers
+  location /dhis { proxy_pass  http://localhost:8080/dhis; }
+  location /training { proxy_pass  http://localhost:8081/training; }
+  location /demo { proxy_pass  http://localhost:8082/demo; }
+}

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/backups'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin/setenv.sh'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin/setenv.sh	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/bin/setenv.sh	2013-05-28 12:06:12 +0000
@@ -0,0 +1,32 @@
+#!/bin/sh
+#       ____  __  ______________ 
+#      / __ \/ / / /  _/ ___/__ \
+#     / / / / /_/ // / \__ \__/ /
+#    / /_/ / __  // / ___/ / __/ 
+#   /_____/_/ /_/___//____/____/
+#
+# Environment variables used by tomcat
+#
+
+# Virtual machine tuning
+# Set heap size according to your available memory.
+# In most cases this will be all you need to set (be sure
+# you have allocated plenty for postgres).
+
+HEAP=2G
+
+# venture below here only if you know what you are doing ....
+
+# sets basic memory size parameters
+export CATALINA_OPTS="-Xms$HEAP -Xmx$HEAP -XX:MaxPermSize=256m -Xss256m"
+
+# some best practice suggestions from https://gist.github.com/terrancesnyder/986029
+export CATALINA_OPTS="$CATALINA_OPTS -XX:+UseParallelGC"
+export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxGCPauseMillis=1500"
+export CATALINA_OPTS="$CATALINA_OPTS -XX:GCTimeRatio=9"
+export CATALINA_OPTS="$CATALINA_OPTS -server"
+
+# You can generally leave these untouched
+export CATALINA_PID=$CATALINA_BASE/tomcat.pid
+export CATALINA_HOME=/usr/share/tomcat7
+export DHIS2_HOME=$CATALINA_BASE

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/Catalina'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/catalina.properties'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/catalina.properties	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/catalina.properties	2013-05-28 12:06:12 +0000
@@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, no packages are restricted for definition, and none of
+# the class loaders supplied with the JDK call checkPackageDefinition.
+#
+package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
+
+#
+#
+# List of comma-separated paths defining the contents of the "common" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank,the JVM system loader will be used as Catalina's "common" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
+
+#
+# List of comma-separated paths defining the contents of the "server" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank, the "common" loader will be used as Catalina's "server" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+server.loader=${catalina.home}/server/classes,${catalina.home}/server/*.jar
+
+#
+# List of comma-separated paths defining the contents of the "shared" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
+# the "common" loader will be used as Catalina's "shared" loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository 
+# Please note that for single jars, e.g. bar.jar, you need the URL form
+# starting with file:.
+shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/*.jar
+
+#
+# String cache configuration.
+tomcat.util.buf.StringCache.byte.enabled=true
+#tomcat.util.buf.StringCache.char.enabled=true
+#tomcat.util.buf.StringCache.trainThreshold=500000
+#tomcat.util.buf.StringCache.cacheSize=5000

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/context.xml'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/context.xml	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/context.xml	2013-05-28 12:06:12 +0000
@@ -0,0 +1,38 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- The contents of this file will be loaded for each web application -->
+<Context>
+
+    <!-- Default set of monitored resources -->
+    <WatchedResource>WEB-INF/web.xml</WatchedResource>
+	
+    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
+    <!--
+    <Manager pathname="" />
+    -->
+
+    <!-- Uncomment this to enable Comet connection tacking (provides events
+         on session expiration as well as webapp lifecycle) -->
+    <!--
+    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
+    -->
+   <Loader className="org.apache.catalina.loader.VirtualWebappLoader" 
+       virtualClasspath="${catalina.base}/routes/*.jar"
+       searchVirtualFirst="true"/>
+
+</Context>

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logging.properties'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logging.properties	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logging.properties	2013-05-28 12:06:12 +0000
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+handlers = java.util.logging.ConsoleHandler
+
+.handlers = java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#org.apache.catalina.startup.ContextConfig.level = FINE
+#org.apache.catalina.startup.HostConfig.level = FINE
+#org.apache.catalina.session.ManagerBase.level = FINE
+#org.apache.catalina.core.AprLifecycleListener.level=FINE
+
+org.apache.catalina.filters.ExpiresFilter.level = FINE

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logrotate.conf'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logrotate.conf	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/logrotate.conf	2013-05-28 12:06:12 +0000
@@ -0,0 +1,10 @@
+~/logs/catalina.out {
+   rotate 24
+   dateext
+   monthly
+   create
+   compress
+   copytruncate
+   noolddir
+}
+

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/server.xml'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/server.xml	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/server.xml	2013-05-28 12:06:12 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Server port="-1" >
+
+  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
+  <Listener className="org.apache.catalina.core.JasperListener" />
+  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+
+  <Service name="Catalina">
+  
+    <Executor name="tomcatThreadPool" namePrefix="tomcat-http-" 
+           maxThreads="100" minSpareThreads="10" /> 
+                    
+    <Connector port="HTTPPORT" protocol="HTTP/1.1" 
+           executor="tomcatThreadPool" connectionTimeout="20000" />
+ 
+    <Engine name="Catalina" defaultHost="localhost">
+      <Host name="localhost"  appBase="webapps" 
+            unpackWARs="true" autoDeploy="false"
+            xmlValidation="false" xmlNamespaceAware="false">
+      </Host>
+    </Engine>
+  </Service>
+</Server>

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/tomcat-users.xml'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/tomcat-users.xml	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/tomcat-users.xml	2013-05-28 12:06:12 +0000
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<tomcat-users>
+<!--
+  <role rolename="tomcat"/>
+  <role rolename="role1"/>
+  <user username="tomcat" password="tomcat" roles="tomcat"/>
+  <user username="both" password="tomcat" roles="tomcat,role1"/>
+  <user username="role1" password="tomcat" roles="role1"/>
+-->
+</tomcat-users>

=== added file 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/web.xml'
--- tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/web.xml	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/conf/web.xml	2013-05-28 12:06:12 +0000
@@ -0,0 +1,1275 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
+    version="2.5">
+
+  <filter>
+    <filter-name>ExpiresFilter</filter-name>
+    <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
+    <init-param>
+      <param-name>ExpiresDefault</param-name>
+      <param-value>access plus 1 week</param-value>
+    </init-param>
+  </filter>
+  <filter>
+    <filter-name>ImageExpiresFilter</filter-name>
+    <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
+    <init-param>
+      <param-name>ExpiresByType image</param-name>
+      <param-value>access plus 1 week</param-value>
+    </init-param>
+  </filter>
+
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.js</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.css</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.gif</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.woff</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.ttf</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.eot</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>*.ico</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>/images/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>ExpiresFilter</filter-name>
+    <url-pattern>/icons/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>ImageExpiresFilter</filter-name>
+    <url-pattern>/dhis-web-commons/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+
+
+  <!-- ======================== Introduction ============================== -->
+  <!-- This document defines default values for *all* web applications      -->
+  <!-- loaded into this instance of Tomcat.  As each application is         -->
+  <!-- deployed, this file is processed, followed by the                    -->
+  <!-- "/WEB-INF/web.xml" deployment descriptor from your own               -->
+  <!-- applications.                                                        -->
+  <!--                                                                      -->
+  <!-- WARNING:  Do not configure application-specific resources here!      -->
+  <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
+
+
+  <!-- ================== Built In Servlet Definitions ==================== -->
+
+
+  <!-- The default servlet for all web applications, that serves static     -->
+  <!-- resources.  It processes all requests that are not mapped to other   -->
+  <!-- servlets with servlet mappings (defined either here or in your own   -->
+  <!-- web.xml file.  This servlet supports the following initialization    -->
+  <!-- parameters (default values are in square brackets):                  -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   fileEncoding        Encoding to be used to read static resources   -->
+  <!--                       [platform default]                             -->
+  <!--                                                                      -->
+  <!--   input               Input buffer size (in bytes) when reading      -->
+  <!--                       resources to be served.  [2048]                -->
+  <!--                                                                      -->
+  <!--   listings            Should directory listings be produced if there -->
+  <!--                       is no welcome file in this directory?  [false] -->
+  <!--                       WARNING: Listings for directories with many    -->
+  <!--                       entries can be slow and may consume            -->
+  <!--                       significant proportions of server resources.   -->
+  <!--                                                                      -->
+  <!--   output              Output buffer size (in bytes) when writing     -->
+  <!--                       resources to be served.  [2048]                -->
+  <!--                                                                      -->
+  <!--   readonly            Is this context "read only", so HTTP           -->
+  <!--                       commands like PUT and DELETE are               -->
+  <!--                       rejected?  [true]                              -->
+  <!--                                                                      -->
+  <!--   readmeFile          File name to display with the directory        -->
+  <!--                       contents. [null]                               -->
+  <!--                                                                      -->
+  <!--   sendfileSize        If the connector used supports sendfile, this  -->
+  <!--                       represents the minimal file size in KB for     -->
+  <!--                       which sendfile will be used. Use a negative    -->
+  <!--                       value to always disable sendfile.  [48]        -->
+  <!--                                                                      -->
+  <!--   useAcceptRanges     Should the Accept-Ranges header be included    -->
+  <!--                       in responses where appropriate? [true]         -->
+  <!--                                                                      -->
+  <!--  For directory listing customization. Checks localXsltFile, then     -->
+  <!--  globalXsltFile, then defaults to original behavior.                 -->
+  <!--                                                                      -->
+  <!--   localXsltFile       Make directory listings an XML doc and         -->
+  <!--                       pass the result to this style sheet residing   -->
+  <!--                       in that directory. This overrides              -->
+  <!--                       contextXsltFile and globalXsltFile[null]       -->
+  <!--                                                                      -->
+  <!--   contextXsltFile     Make directory listings an XML doc and         -->
+  <!--                       pass the result to this style sheet which is   -->
+  <!--                       relative to the context root. This overrides   -->
+  <!--                       globalXsltFile[null]                           -->
+  <!--                                                                      -->
+  <!--   globalXsltFile      Site wide configuration version of             -->
+  <!--                       localXsltFile This argument is expected        -->
+  <!--                       to be a physical file. [null]                  -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+    <servlet>
+        <servlet-name>default</servlet-name>
+        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <init-param>
+            <param-name>listings</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+
+  <!-- This servlet has been deprecated due to security concerns. Servlets  -->
+  <!-- should be explicitly mapped in web.xml                               -->
+  <!--                                                                      -->
+  <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
+  <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
+  <!-- servlet is mapped to the URL pattern "/servlet/*", but you can map   -->
+  <!-- it to other patterns as well.  The extra path info portion of such a -->
+  <!-- request must be the fully qualified class name of a Java class that  -->
+  <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
+  <!-- of an existing servlet definition.     This servlet supports the     -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+
+<!--
+    <servlet>
+        <servlet-name>invoker</servlet-name>
+        <servlet-class>
+          org.apache.catalina.servlets.InvokerServlet
+        </servlet-class>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
+  <!-- used by Tomcat to support JSP pages.  Traditionally, this servlet    -->
+  <!-- is mapped to the URL pattern "*.jsp".  This servlet supports the     -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   checkInterval       If development is false and checkInterval is   -->
+  <!--                       greater than zero, background compilations are -->
+  <!--                       enabled. checkInterval is the time in seconds  -->
+  <!--                       between checks to see if a JSP page (and its   -->
+  <!--                       dependent files) needs to  be recompiled. [0]  -->
+  <!--                                                                      -->
+  <!--   classdebuginfo      Should the class file be compiled with         -->
+  <!--                       debugging information?  [true]                 -->
+  <!--                                                                      -->
+  <!--   classpath           What class path should I use while compiling   -->
+  <!--                       generated servlets?  [Created dynamically      -->
+  <!--                       based on the current web application]          -->
+  <!--                                                                      -->
+  <!--   compiler            Which compiler Ant should use to compile JSP   -->
+  <!--                       pages.  See the jasper documentation for more  -->
+  <!--                       information.                                   -->
+  <!--                                                                      -->
+  <!--   compilerSourceVM    Compiler source VM. [1.5]                      -->
+  <!--                                                                      -->
+  <!--   compilerTargetVM    Compiler target VM. [1.5]                      -->  
+  <!--                                                                      -->
+  <!--   development         Is Jasper used in development mode? If true,   -->
+  <!--                       the frequency at which JSPs are checked for    -->
+  <!--                       modification may be specified via the          -->
+  <!--                       modificationTestInterval parameter. [true]     -->
+  <!--                                                                      -->
+  <!--   displaySourceFragment                                              -->
+  <!--                       Should a source fragment be included in        -->
+  <!--                       exception messages? [true]                     -->
+  <!--                                                                      -->
+  <!--   dumpSmap            Should the SMAP info for JSR45 debugging be    -->
+  <!--                       dumped to a file? [false]                      -->
+  <!--                       False if suppressSmap is true                  -->
+  <!--                                                                      -->
+  <!--   enablePooling       Determines whether tag handler pooling is      -->
+  <!--                       enabled. This is a compilation option. It will -->
+  <!--                       not alter the behaviour of JSPs that have      -->
+  <!--                       already been compiled. [true]                  -->
+  <!--                                                                      -->
+  <!--   engineOptionsClass  Allows specifying the Options class used to    -->
+  <!--                       configure Jasper. If not present, the default  -->
+  <!--                       EmbeddedServletOptions will be used.           -->
+  <!--                                                                      -->
+  <!--   errorOnUseBeanInvalidClassAttribute                                -->
+  <!--                       Should Jasper issue an error when the value of -->
+  <!--                       the class attribute in an useBean action is    -->
+  <!--                       not a valid bean class?  [true]                -->
+  <!--                                                                      -->
+  <!--   fork                Tell Ant to fork compiles of JSP pages so that -->
+  <!--                       a separate JVM is used for JSP page compiles   -->
+  <!--                       from the one Tomcat is running in. [true]      -->
+  <!--                                                                      -->
+  <!--   genStrAsCharArray   Should text strings be generated as char       -->
+  <!--                       arrays, to improve performance in some cases?  -->
+  <!--                       [false]                                        -->
+  <!--                                                                      -->
+  <!--   ieClassId           The class-id value to be sent to Internet      -->
+  <!--                       Explorer when using <jsp:plugin> tags.         -->
+  <!--                       [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]   -->
+  <!--                                                                      -->
+  <!--   javaEncoding        Java file encoding to use for generating java  -->
+  <!--                       source files. [UTF8]                           -->
+  <!--                                                                      -->
+  <!--   keepgenerated       Should we keep the generated Java source code  -->
+  <!--                       for each page instead of deleting it? [true]   -->
+  <!--                                                                      -->
+  <!--   mappedfile          Should we generate static content with one     -->
+  <!--                       print statement per input line, to ease        -->
+  <!--                       debugging?  [true]                             -->
+  <!--                                                                      -->
+  <!--   modificationTestInterval                                           -->
+  <!--                       Causes a JSP (and its dependent files) to not  -->
+  <!--                       be checked for modification during the         -->
+  <!--                       specified time interval (in seconds) from the  -->
+  <!--                       last time the JSP was checked for              -->
+  <!--                       modification. A value of 0 will cause the JSP  -->
+  <!--                       to be checked on every access.                 -->
+  <!--                       Used in development mode only. [4]             -->
+  <!--                                                                      -->
+  <!--   recompileOnFail     If a JSP compilation fails should the          -->
+  <!--                       modificationTestInterval be ignored and the    -->
+  <!--                       next access trigger a re-compilation attempt?  -->
+  <!--                       Used in development mode only and is disabled  -->
+  <!--                       by default as compilation may be expensive and -->
+  <!--                       could lead to excessive resource usage.        -->
+  <!--                       [false]                                        -->
+  <!--                                                                      -->
+  <!--   scratchdir          What scratch directory should we use when      -->
+  <!--                       compiling JSP pages?  [default work directory  -->
+  <!--                       for the current web application]               -->
+  <!--                                                                      -->
+  <!--   suppressSmap        Should the generation of SMAP info for JSR45   -->
+  <!--                       debugging be suppressed?  [false]              -->
+  <!--                                                                      -->
+  <!--   trimSpaces          Should white spaces in template text between   -->
+  <!--                       actions or directives be trimmed?  [false]     -->
+  <!--                                                                      -->
+  <!--   xpoweredBy          Determines whether X-Powered-By response       -->
+  <!--                       header is added by generated servlet  [false]  -->
+  <!--                                                                      -->
+  <!-- If you wish to use Jikes to compile JSP pages:                       -->
+  <!--   Please see the "Using Jikes" section of the Jasper-HowTo           -->
+  <!--   page in the Tomcat documentation.                                  -->
+
+    <servlet>
+        <servlet-name>jsp</servlet-name>
+        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+        <init-param>
+            <param-name>fork</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>xpoweredBy</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <load-on-startup>3</load-on-startup>
+    </servlet>
+
+
+  <!-- NOTE: An SSI Filter is also available as an alternative SSI          -->
+  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
+  <!--                                                                      -->
+  <!-- Server Side Includes processing servlet, which processes SSI         -->
+  <!-- directives in HTML pages consistent with similar support in web      -->
+  <!-- servers like Apache.  Traditionally, this servlet is mapped to the   -->
+  <!-- URL pattern "*.shtml".  This servlet supports the following          -->
+  <!-- initialization parameters (default values are in square brackets):   -->
+  <!--                                                                      -->
+  <!--   buffered            Should output from this servlet be buffered?   -->
+  <!--                       (0=false, 1=true)  [0]                         -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   expires             The number of seconds before a page with SSI   -->
+  <!--                       directives will expire.  [No default]          -->
+  <!--                                                                      -->
+  <!--   isVirtualWebappRelative                                            -->
+  <!--                       Should "virtual" paths be interpreted as       -->
+  <!--                       relative to the context root, instead of       -->
+  <!--                       the server root?  (0=false, 1=true) [0]        -->
+  <!--                                                                      -->
+  <!--   inputEncoding       The encoding to assume for SSI resources if    -->
+  <!--                       one is not available from the resource.        -->
+  <!--                       [Platform default]                             -->
+  <!--                                                                      -->
+  <!--   outputEncoding      The encoding to use for the page that results  -->
+  <!--                       from the SSI processing. [UTF-8]               -->
+  <!--                                                                      -->
+  <!--   allowExec           Is use of the exec command enabled? [false]    -->
+
+<!--
+    <servlet>
+        <servlet-name>ssi</servlet-name>
+        <servlet-class>
+          org.apache.catalina.ssi.SSIServlet
+        </servlet-class>
+        <init-param>
+          <param-name>buffered</param-name>
+          <param-value>1</param-value>
+        </init-param>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>expires</param-name>
+          <param-value>666</param-value>
+        </init-param>
+        <init-param>
+          <param-name>isVirtualWebappRelative</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <load-on-startup>4</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- Common Gateway Includes (CGI) processing servlet, which supports     -->
+  <!-- execution of external applications that conform to the CGI spec      -->
+  <!-- requirements.  Typically, this servlet is mapped to the URL pattern  -->
+  <!-- "/cgi-bin/*", which means that any CGI applications that are         -->
+  <!-- executed must be present within the web application.  This servlet   -->
+  <!-- supports the following initialization parameters (default values     -->
+  <!-- are in square brackets):                                             -->
+  <!--                                                                      -->
+  <!--   cgiPathPrefix        The CGI search path will start at             -->
+  <!--                        webAppRootDir + File.separator + this prefix. -->
+  <!--                        [WEB-INF/cgi]                                 -->
+  <!--                                                                      -->
+  <!--   debug                Debugging detail level for messages logged    -->
+  <!--                        by this servlet.  [0]                         -->
+  <!--                                                                      -->
+  <!--   executable           Name of the executable used to run the        -->
+  <!--                        script. [perl]                                -->
+  <!--                                                                      -->
+  <!--   parameterEncoding    Name of parameter encoding to be used with    -->
+  <!--                        CGI servlet.                                  -->
+  <!--                        [System.getProperty("file.encoding","UTF-8")] -->
+  <!--                                                                      -->
+  <!--   passShellEnvironment Should the shell environment variables (if    -->
+  <!--                        any) be passed to the CGI script? [false]     -->
+  <!--                                                                      -->
+  <!--   stderrTimeout        The time (in milliseconds) to wait for the    -->
+  <!--                        reading of stderr to complete before          -->
+  <!--                        terminating the CGI process. [2000]           -->
+
+<!--
+    <servlet>
+        <servlet-name>cgi</servlet-name>
+        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>cgiPathPrefix</param-name>
+          <param-value>WEB-INF/cgi</param-value>
+        </init-param>
+         <load-on-startup>5</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- ================ Built In Servlet Mappings ========================= -->
+
+
+  <!-- The servlet mappings for the built in servlets defined above.  Note  -->
+  <!-- that, by default, the CGI and SSI servlets are *not* mapped.  You    -->
+  <!-- must uncomment these mappings (or add them to your application's own -->
+  <!-- web.xml deployment descriptor) to enable these services              -->
+
+    <!-- The mapping for the default servlet -->
+    <servlet-mapping>
+        <servlet-name>default</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+    <!-- The mapping for the deprecated invoker servlet -->
+<!--
+    <servlet-mapping>
+        <servlet-name>invoker</servlet-name>
+        <url-pattern>/servlet/*</url-pattern>
+    </servlet-mapping>
+-->
+
+    <!-- The mapping for the JSP servlet -->
+    <servlet-mapping>
+        <servlet-name>jsp</servlet-name>
+        <url-pattern>*.jsp</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>jsp</servlet-name>
+        <url-pattern>*.jspx</url-pattern>
+    </servlet-mapping>
+
+    <!-- The mapping for the SSI servlet -->
+<!--
+    <servlet-mapping>
+        <servlet-name>ssi</servlet-name>
+        <url-pattern>*.shtml</url-pattern>
+    </servlet-mapping>
+-->
+
+    <!-- The mapping for the CGI Gateway servlet -->
+
+<!--
+    <servlet-mapping>
+        <servlet-name>cgi</servlet-name>
+        <url-pattern>/cgi-bin/*</url-pattern>
+    </servlet-mapping>
+-->
+
+
+  <!-- ================== Built In Filter Definitions ===================== -->
+
+  <!-- NOTE: An SSI Servlet is also available as an alternative SSI         -->
+  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
+  <!--                                                                      -->
+  <!-- Server Side Includes processing filter, which processes SSI          -->
+  <!-- directives in HTML pages consistent with similar support in web      -->
+  <!-- servers like Apache.  Traditionally, this filter is mapped to the    -->
+  <!-- URL pattern "*.shtml", though it can be mapped to "*" as it will     -->
+  <!-- selectively enable/disable SSI processing based on mime types. For   -->
+  <!-- this to work you will need to uncomment the .shtml mime type         -->
+  <!-- definition towards the bottom of this file.                          -->
+  <!-- The contentType init param allows you to apply SSI processing to JSP -->
+  <!-- pages, javascript, or any other content you wish.  This filter       -->
+  <!-- supports the following initialization parameters (default values are -->
+  <!-- in square brackets):                                                 -->
+  <!--                                                                      -->
+  <!--   contentType         A regex pattern that must be matched before    -->
+  <!--                       SSI processing is applied.                     -->
+  <!--                       [text/x-server-parsed-html(;.*)?]              -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   expires             The number of seconds before a page with SSI   -->
+  <!--                       directives will expire.  [No default]          -->
+  <!--                                                                      -->
+  <!--   isVirtualWebappRelative                                            -->
+  <!--                       Should "virtual" paths be interpreted as       -->
+  <!--                       relative to the context root, instead of       -->
+  <!--                       the server root?  (0=false, 1=true) [0]        -->
+  <!--                                                                      -->
+  <!--   allowExec           Is use of the exec command enabled? [false]    -->
+
+<!--
+    <filter>
+        <filter-name>ssi</filter-name>
+        <filter-class>
+          org.apache.catalina.ssi.SSIFilter
+        </filter-class>
+        <init-param>
+          <param-name>contentType</param-name>
+          <param-value>text/x-server-parsed-html(;.*)?</param-value>
+        </init-param>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>expires</param-name>
+          <param-value>666</param-value>
+        </init-param>
+        <init-param>
+          <param-name>isVirtualWebappRelative</param-name>
+          <param-value>0</param-value>
+        </init-param>
+    </filter>
+-->
+
+
+  <!-- ==================== Built In Filter Mappings ====================== -->
+
+  <!-- The mapping for the SSI Filter -->
+<!--
+    <filter-mapping>
+        <filter-name>ssi</filter-name>
+        <url-pattern>*.shtml</url-pattern>
+    </filter-mapping>
+-->
+
+
+  <!-- ==================== Default Session Configuration ================= -->
+  <!-- You can set the default session timeout (in minutes) for all newly   -->
+  <!-- created sessions by modifying the value below.                       -->
+
+    <session-config>
+        <session-timeout>30</session-timeout>
+    </session-config>
+
+
+  <!-- ===================== Default MIME Type Mappings =================== -->
+  <!-- When serving static resources, Tomcat will automatically generate    -->
+  <!-- a "Content-Type" header based on the resource's filename extension,  -->
+  <!-- based on these mappings.  Additional mappings can be added here (to  -->
+  <!-- apply to all web applications), or in your own application's web.xml -->
+  <!-- deployment descriptor.                                               -->
+
+    <mime-mapping>
+        <extension>abs</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ai</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aif</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aifc</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aiff</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aim</extension>
+        <mime-type>application/x-aim</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>art</extension>
+        <mime-type>image/x-jg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>asf</extension>
+        <mime-type>video/x-ms-asf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>asx</extension>
+        <mime-type>video/x-ms-asf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>au</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>avi</extension>
+        <mime-type>video/x-msvideo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>avx</extension>
+        <mime-type>video/x-rad-screenplay</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bcpio</extension>
+        <mime-type>application/x-bcpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bin</extension>
+        <mime-type>application/octet-stream</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bmp</extension>
+        <mime-type>image/bmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>body</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cdf</extension>
+        <mime-type>application/x-cdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cer</extension>
+        <mime-type>application/x-x509-ca-cert</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>class</extension>
+        <mime-type>application/java</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cpio</extension>
+        <mime-type>application/x-cpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>csh</extension>
+        <mime-type>application/x-csh</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>css</extension>
+        <mime-type>text/css</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dib</extension>
+        <mime-type>image/bmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>doc</extension>
+        <mime-type>application/msword</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dtd</extension>
+        <mime-type>application/xml-dtd</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dv</extension>
+        <mime-type>video/x-dv</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dvi</extension>
+        <mime-type>application/x-dvi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>eps</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>etx</extension>
+        <mime-type>text/x-setext</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>exe</extension>
+        <mime-type>application/octet-stream</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gif</extension>
+        <mime-type>image/gif</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gtar</extension>
+        <mime-type>application/x-gtar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gz</extension>
+        <mime-type>application/x-gzip</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>hdf</extension>
+        <mime-type>application/x-hdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>hqx</extension>
+        <mime-type>application/mac-binhex40</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>htc</extension>
+        <mime-type>text/x-component</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>htm</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>html</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>hqx</extension>
+        <mime-type>application/mac-binhex40</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ief</extension>
+        <mime-type>image/ief</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jad</extension>
+        <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jar</extension>
+        <mime-type>application/java-archive</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>java</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jnlp</extension>
+        <mime-type>application/x-java-jnlp-file</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpe</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpeg</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpg</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>js</extension>
+        <mime-type>text/javascript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jsf</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jspf</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>kar</extension>
+        <mime-type>audio/x-midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>latex</extension>
+        <mime-type>application/x-latex</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>m3u</extension>
+        <mime-type>audio/x-mpegurl</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mac</extension>
+        <mime-type>image/x-macpaint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>man</extension>
+        <mime-type>application/x-troff-man</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mathml</extension>
+        <mime-type>application/mathml+xml</mime-type> 
+    </mime-mapping>
+    <mime-mapping>
+        <extension>me</extension>
+        <mime-type>application/x-troff-me</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mid</extension>
+        <mime-type>audio/x-midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>midi</extension>
+        <mime-type>audio/x-midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mif</extension>
+        <mime-type>application/x-mif</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mov</extension>
+        <mime-type>video/quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>movie</extension>
+        <mime-type>video/x-sgi-movie</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp1</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp2</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp3</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp4</extension>
+        <mime-type>video/mp4</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpa</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpe</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpeg</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpega</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpg</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpv2</extension>
+        <mime-type>video/mpeg2</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ms</extension>
+        <mime-type>application/x-wais-source</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>nc</extension>
+        <mime-type>application/x-netcdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>oda</extension>
+        <mime-type>application/oda</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Database -->
+        <extension>odb</extension>
+        <mime-type>application/vnd.oasis.opendocument.database</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Chart -->
+        <extension>odc</extension>
+        <mime-type>application/vnd.oasis.opendocument.chart</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Formula -->
+        <extension>odf</extension>
+        <mime-type>application/vnd.oasis.opendocument.formula</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Drawing -->
+        <extension>odg</extension>
+        <mime-type>application/vnd.oasis.opendocument.graphics</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Image -->
+        <extension>odi</extension>
+        <mime-type>application/vnd.oasis.opendocument.image</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Master Document -->
+        <extension>odm</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-master</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Presentation -->
+        <extension>odp</extension>
+        <mime-type>application/vnd.oasis.opendocument.presentation</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Spreadsheet -->
+        <extension>ods</extension>
+        <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Text -->
+        <extension>odt</extension>
+        <mime-type>application/vnd.oasis.opendocument.text</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ogg</extension>
+        <mime-type>application/ogg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Drawing Template -->
+        <extension>otg </extension>
+        <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- HTML Document Template -->
+        <extension>oth</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-web</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Presentation Template -->
+        <extension>otp</extension>
+        <mime-type>application/vnd.oasis.opendocument.presentation-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Spreadsheet Template -->
+        <extension>ots</extension>
+        <mime-type>application/vnd.oasis.opendocument.spreadsheet-template </mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Text Template -->
+        <extension>ott</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pbm</extension>
+        <mime-type>image/x-portable-bitmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pct</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pdf</extension>
+        <mime-type>application/pdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pgm</extension>
+        <mime-type>image/x-portable-graymap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pic</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pict</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pls</extension>
+        <mime-type>audio/x-scpls</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>png</extension>
+        <mime-type>image/png</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pnm</extension>
+        <mime-type>image/x-portable-anymap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pnt</extension>
+        <mime-type>image/x-macpaint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ppm</extension>
+        <mime-type>image/x-portable-pixmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ppt</extension>
+        <mime-type>application/vnd.ms-powerpoint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pps</extension>
+        <mime-type>application/vnd.ms-powerpoint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ps</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>psd</extension>
+        <mime-type>image/x-photoshop</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qt</extension>
+        <mime-type>video/quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qti</extension>
+        <mime-type>image/x-quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qtif</extension>
+        <mime-type>image/x-quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ras</extension>
+        <mime-type>image/x-cmu-raster</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rdf</extension>
+        <mime-type>application/rdf+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rgb</extension>
+        <mime-type>image/x-rgb</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rm</extension>
+        <mime-type>application/vnd.rn-realmedia</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>roff</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rtf</extension>
+        <mime-type>application/rtf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rtx</extension>
+        <mime-type>text/richtext</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sh</extension>
+        <mime-type>application/x-sh</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>shar</extension>
+        <mime-type>application/x-shar</mime-type>
+    </mime-mapping>
+<!--
+    <mime-mapping>
+        <extension>shtml</extension>
+        <mime-type>text/x-server-parsed-html</mime-type>
+    </mime-mapping>
+-->
+    <mime-mapping>
+        <extension>smf</extension>
+        <mime-type>audio/x-midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sit</extension>
+        <mime-type>application/x-stuffit</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>snd</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>src</extension>
+        <mime-type>application/x-wais-source</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sv4cpio</extension>
+        <mime-type>application/x-sv4cpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sv4crc</extension>
+        <mime-type>application/x-sv4crc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>svg</extension>
+        <mime-type>image/svg+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>svgz</extension>
+        <mime-type>image/svg+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>swf</extension>
+        <mime-type>application/x-shockwave-flash</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>t</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tar</extension>
+        <mime-type>application/x-tar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tcl</extension>
+        <mime-type>application/x-tcl</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tex</extension>
+        <mime-type>application/x-tex</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>texi</extension>
+        <mime-type>application/x-texinfo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>texinfo</extension>
+        <mime-type>application/x-texinfo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tif</extension>
+        <mime-type>image/tiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tiff</extension>
+        <mime-type>image/tiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tr</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tsv</extension>
+        <mime-type>text/tab-separated-values</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>txt</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ulw</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ustar</extension>
+        <mime-type>application/x-ustar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>vxml</extension>
+        <mime-type>application/voicexml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xbm</extension>
+        <mime-type>image/x-xbitmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xht</extension>
+        <mime-type>application/xhtml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xhtml</extension>
+        <mime-type>application/xhtml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xls</extension>
+        <mime-type>application/vnd.ms-excel</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xml</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xpm</extension>
+        <mime-type>image/x-xpixmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xsl</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xslt</extension>
+        <mime-type>application/xslt+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xul</extension>
+        <mime-type>application/vnd.mozilla.xul+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xwd</extension>
+        <mime-type>image/x-xwindowdump</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>vsd</extension>
+        <mime-type>application/x-visio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wav</extension>
+        <mime-type>audio/x-wav</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Wireless Bitmap -->
+        <extension>wbmp</extension>
+        <mime-type>image/vnd.wap.wbmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- WML Source -->
+        <extension>wml</extension>
+        <mime-type>text/vnd.wap.wml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Compiled WML -->
+        <extension>wmlc</extension>
+        <mime-type>application/vnd.wap.wmlc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- WML Script Source -->
+        <extension>wmls</extension>
+        <mime-type>text/vnd.wap.wmlscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Compiled WML Script -->
+        <extension>wmlscriptc</extension>
+        <mime-type>application/vnd.wap.wmlscriptc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wmv</extension>
+        <mime-type>video/x-ms-wmv</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wrl</extension>
+        <mime-type>x-world/x-vrml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wspolicy</extension>
+        <mime-type>application/wspolicy+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>Z</extension>
+        <mime-type>application/x-compress</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>z</extension>
+        <mime-type>application/x-compress</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>zip</extension>
+        <mime-type>application/zip</mime-type>
+    </mime-mapping>
+
+  <!-- ==================== Default Welcome File List ===================== -->
+  <!-- When a request URI refers to a directory, the default servlet looks  -->
+  <!-- for a "welcome file" within that directory and, if present,          -->
+  <!-- to the corresponding resource URI for display.  If no welcome file   -->
+  <!-- is present, the default servlet either serves a directory listing,   -->
+  <!-- or returns a 404 status, depending on how it is configured.          -->
+  <!--                                                                      -->
+  <!-- If you define welcome files in your own application's web.xml        -->
+  <!-- deployment descriptor, that list *replaces* the list configured      -->
+  <!-- here, so be sure that you include any of the default values that     -->
+  <!-- you wish to include.                                                 -->
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
+</web-app>

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/lib'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/logs'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/dhis2-tools/skel/webapps'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/doc'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools'
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/changelog.gz'
Binary files tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/changelog.gz	1970-01-01 00:00:00 +0000 and tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/changelog.gz	2013-05-28 12:06:12 +0000 differ
=== added file 'tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/copyright'
--- tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/copyright	1970-01-01 00:00:00 +0000
+++ tools/dhis2-tools-deb/pkg/usr/share/doc/dhis2-tools/copyright	2013-05-28 12:06:12 +0000
@@ -0,0 +1,135 @@
+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166
+Upstream-Name: Tomcat7
+Upstream-Contact: Merten Falk <nevesenin@xxxxxxxx>
+Source: http://tomcat.apache.org/download-70.cgi
+Upstream-Authors:
+    Alex Chaffee
+    Alex Cruikshank [alex@xxxxxxxxxxxx]
+    Amy Roh
+    Andre de Jesus
+    Andrew R. Jaquith
+    Andy Clark
+    Aner Perez
+    Anil V (akv@xxxxxxxxxxx)
+    Anselm Baird-Smith
+    Arnaud  Le Hors, IBM
+    Bela Ban (modifications for synchronous replication)
+    Bill Barker
+    Bill Burke
+    Bip Thelin
+    Cedrik LIME
+    Carson McDonald
+    Costin@xxxxxxxxxxx
+    Craig R. McClanahan
+    Dan Milstein [danmil@xxxxxxxxx]
+    Dan Sandberg
+    Daniel Rall
+    Danno Ferrin
+    David Becker
+    Denis Benoit
+    Eric Rescorla
+    Eric Ye, IBM
+    Fabien Carrion
+    Fabrizio Giustina
+    Filip Hanik
+    Gabriele Garuglieri
+    Gal Shachor [shachor@xxxxxxxxxx]
+    Glenn L. Nielsen
+    Glenn Marcy, IBM
+    Greg Murray
+    Gunnar Rjnning
+    Hans Bergsten <hans@xxxxxxxxxxxxxxxxxx>
+    Harish Prabandham
+    Henri Gomez [hgomez@xxxxxxxxxx]
+    Ignacio J. Ortega
+    Jacek Laskowski
+    Jacob Hookom [jacob@xxxxxxxxxx]
+    James Duncan Davidson [duncan@xxxxxxxxxxx]
+    James Todd [gonzo@xxxxxxx]
+    Jan Luehe
+    Jason Brittain
+    Jason Hunter [jch@xxxxxxxxxxx]
+    Jason van Zyl
+    Jayson Falkner
+    Jean-Francois Arcand
+    Jean-Frederic Clere
+    Jeffrey Rodriguez
+    John Holman
+    John McNally
+    Jon S. Stevens
+    Justyna Horwat
+    Keith Wannamaker [Keith@xxxxxxxxxxxxxx]
+    Kevin Seguin
+    Kief Morris (kief@xxxxxxxx)
+    Kin-man Chung
+    Larry Cable
+    Larry Isaacs
+    Malcolm Edgar
+    Mandar Raje
+    Mark Roth
+    Mark Thomas
+    Martin Cooper
+    Martin T Dengler [root@xxxxxxxxxxxxxxxxx]
+    Mel Martinez [mmartinez@xxxxxxxxx]
+    Michael Glavassevich, IBM
+    Mladen Turk
+    Neil Graham, IBM
+    Nicola Ken Barozzi
+    Paul Speed
+    Peter Donald
+    Peter Lin
+    Peter Rossbach (pero@xxxxxxxxxx)
+    Pierre Delisle
+    Rafal Krzewski Rafal.Krzewski@xxxxxxxxxx
+    Rahul Srivastava, Sun Microsystems Inc.
+    Rainer Jung
+    Rajiv Mordani
+    Remy Maucharat
+    Remy Maucherat
+    Richard A. Sitze
+    Robert Field (inner SDEInstaller class)
+    Rod Waldhoff
+    Scott Sanders
+    Sean C. Sullivan
+    Sean Legassick
+    Sean Legassick
+    Shawn Bayern
+    Stan Bailes
+    Stefan Freyr Stefansson
+    Stefano Mazzocchi
+    TAMURA Kent, IBM
+    Takayuki Kaneko
+    Tim Fennell
+    Tim Funk
+    Tim Tye
+    Vivek Chopra
+    Yoav Shapira <yoavs@xxxxxxxxxx>
+
+Files: *
+Copyright: 2000-2011 Apache Software Foundation.
+  2002, International Business Machines Corporation.
+License: Apache-2.0
+
+Files: debian/*
+Copyright:
+  2008,2011, Canonical Ltd.
+  2008, Paul Cager <paul-debian@xxxxxxxxxxxxxxxxxx>
+  2010, Thierry Carrez <thierry.carrez@xxxxxxxxxx>
+  2011, Ernesto Hernanez-Novich <emhn@xxxxxx>
+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian GNU/Linux and Ubuntu systems, the complete text of the Apache 2.0 
+ License can be found in the `/usr/share/common-licenses/Apache-2.0' file.

=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/man'
=== added directory 'tools/dhis2-tools-deb/pkg/usr/share/man/man1'
=== added directory 'tools/dhis2-tools-deb/pkg/var'
=== added directory 'tools/dhis2-tools-deb/pkg/var/lib'
=== added directory 'tools/dhis2-tools-deb/pkg/var/lib/dhis2'
=== added directory 'tools/dhis2-tools-deb/pkg/var/log'
=== added directory 'tools/dhis2-tools-deb/pkg/var/log/dhis2'

Follow ups