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

revision-diff.txt (109 KB)

Please don’t try and use this yet … I have just discovered bzr clobbers all the correct file permissions which causes a bad deb to be created.

The only solution to this will be to have a script to “manually” fix all the permissions after checking out from bzr. hopefully will get that fixed today.

···

On 28 May 2013 07:07, noreply@launchpad.net wrote:


revno: 11048

committer: Bob Jolliffe bobjolliffe@gmail.com

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>
  • <xsl:value-of select=“$name”/>
  • <xsl:value-of select=“substring($name,1,50)”/>

=== 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](http://www.docbook.org/xml/4.5/docbookx.dtd)">
    

+

  • DHIS2 server tools manual
  •  <firstname>Bob</firstname>
    
  •  <surname>Jolliffe</surname>
    
  • Overview
  • Installing and managing DHIS2.

  • DHIS2 tools
  •  <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>
    
  •  <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>
    
  •  <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>
    
  •  <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](http://stable.dhis2.org).</para>
    
  •  </refsect1>
    
  •  <refsect1>
    
  •    <title>Examples</title>
    
  •    <para>dhis2-deploy-stable myInstance</para>
    
  •  </refsect1>
    
  •  <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>
    
  •  <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>
    

+

=== 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@lists.launchpad.net

+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 ”

  • 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 ”

  • 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] ”

  • 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 ”

  • 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 ”

  • 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 ”

  • 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 ”

  • 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 @@

+

  •   #===========================================================
    
  •    # 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
    

+

=== 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/](https://SERVERNAME/)
    

+

=== 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](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-INF/web.xml

  •    <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-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-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-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-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-name>default</servlet-name>
    
  •    <url-pattern>/</url-pattern>
    

+<!–

  •    <servlet-name>invoker</servlet-name>
    
  •    <url-pattern>/servlet/*</url-pattern>
    

±->

  •    <servlet-name>jsp</servlet-name>
    
  •    <url-pattern>*.jsp</url-pattern>
    
  •    <servlet-name>jsp</servlet-name>
    
  •    <url-pattern>*.jspx</url-pattern>
    

+<!–

  •    <servlet-name>ssi</servlet-name>
    
  •    <url-pattern>*.shtml</url-pattern>
    

±->

+<!–

  •    <servlet-name>cgi</servlet-name>
    
  •    <url-pattern>/cgi-bin/*</url-pattern>
    

±->

+<!–

  •    <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-name>ssi</filter-name>
    
  •    <url-pattern>*.shtml</url-pattern>
    

±->

  •    <session-timeout>30</session-timeout>
    
  •    <extension>abs</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>ai</extension>
    
  •    <mime-type>application/postscript</mime-type>
    
  •    <extension>aif</extension>
    
  •    <mime-type>audio/x-aiff</mime-type>
    
  •    <extension>aifc</extension>
    
  •    <mime-type>audio/x-aiff</mime-type>
    
  •    <extension>aiff</extension>
    
  •    <mime-type>audio/x-aiff</mime-type>
    
  •    <extension>aim</extension>
    
  •    <mime-type>application/x-aim</mime-type>
    
  •    <extension>art</extension>
    
  •    <mime-type>image/x-jg</mime-type>
    
  •    <extension>asf</extension>
    
  •    <mime-type>video/x-ms-asf</mime-type>
    
  •    <extension>asx</extension>
    
  •    <mime-type>video/x-ms-asf</mime-type>
    
  •    <extension>au</extension>
    
  •    <mime-type>audio/basic</mime-type>
    
  •    <extension>avi</extension>
    
  •    <mime-type>video/x-msvideo</mime-type>
    
  •    <extension>avx</extension>
    
  •    <mime-type>video/x-rad-screenplay</mime-type>
    
  •    <extension>bcpio</extension>
    
  •    <mime-type>application/x-bcpio</mime-type>
    
  •    <extension>bin</extension>
    
  •    <mime-type>application/octet-stream</mime-type>
    
  •    <extension>bmp</extension>
    
  •    <mime-type>image/bmp</mime-type>
    
  •    <extension>body</extension>
    
  •    <mime-type>text/html</mime-type>
    
  •    <extension>cdf</extension>
    
  •    <mime-type>application/x-cdf</mime-type>
    
  •    <extension>cer</extension>
    
  •    <mime-type>application/x-x509-ca-cert</mime-type>
    
  •    <extension>class</extension>
    
  •    <mime-type>application/java</mime-type>
    
  •    <extension>cpio</extension>
    
  •    <mime-type>application/x-cpio</mime-type>
    
  •    <extension>csh</extension>
    
  •    <mime-type>application/x-csh</mime-type>
    
  •    <extension>css</extension>
    
  •    <mime-type>text/css</mime-type>
    
  •    <extension>dib</extension>
    
  •    <mime-type>image/bmp</mime-type>
    
  •    <extension>doc</extension>
    
  •    <mime-type>application/msword</mime-type>
    
  •    <extension>dtd</extension>
    
  •    <mime-type>application/xml-dtd</mime-type>
    
  •    <extension>dv</extension>
    
  •    <mime-type>video/x-dv</mime-type>
    
  •    <extension>dvi</extension>
    
  •    <mime-type>application/x-dvi</mime-type>
    
  •    <extension>eps</extension>
    
  •    <mime-type>application/postscript</mime-type>
    
  •    <extension>etx</extension>
    
  •    <mime-type>text/x-setext</mime-type>
    
  •    <extension>exe</extension>
    
  •    <mime-type>application/octet-stream</mime-type>
    
  •    <extension>gif</extension>
    
  •    <mime-type>image/gif</mime-type>
    
  •    <extension>gtar</extension>
    
  •    <mime-type>application/x-gtar</mime-type>
    
  •    <extension>gz</extension>
    
  •    <mime-type>application/x-gzip</mime-type>
    
  •    <extension>hdf</extension>
    
  •    <mime-type>application/x-hdf</mime-type>
    
  •    <extension>hqx</extension>
    
  •    <mime-type>application/mac-binhex40</mime-type>
    
  •    <extension>htc</extension>
    
  •    <mime-type>text/x-component</mime-type>
    
  •    <extension>htm</extension>
    
  •    <mime-type>text/html</mime-type>
    
  •    <extension>html</extension>
    
  •    <mime-type>text/html</mime-type>
    
  •    <extension>hqx</extension>
    
  •    <mime-type>application/mac-binhex40</mime-type>
    
  •    <extension>ief</extension>
    
  •    <mime-type>image/ief</mime-type>
    
  •    <extension>jad</extension>
    
  •    <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
    
  •    <extension>jar</extension>
    
  •    <mime-type>application/java-archive</mime-type>
    
  •    <extension>java</extension>
    
  •    <mime-type>text/plain</mime-type>
    
  •    <extension>jnlp</extension>
    
  •    <mime-type>application/x-java-jnlp-file</mime-type>
    
  •    <extension>jpe</extension>
    
  •    <mime-type>image/jpeg</mime-type>
    
  •    <extension>jpeg</extension>
    
  •    <mime-type>image/jpeg</mime-type>
    
  •    <extension>jpg</extension>
    
  •    <mime-type>image/jpeg</mime-type>
    
  •    <extension>js</extension>
    
  •    <mime-type>text/javascript</mime-type>
    
  •    <extension>jsf</extension>
    
  •    <mime-type>text/plain</mime-type>
    
  •    <extension>jspf</extension>
    
  •    <mime-type>text/plain</mime-type>
    
  •    <extension>kar</extension>
    
  •    <mime-type>audio/x-midi</mime-type>
    
  •    <extension>latex</extension>
    
  •    <mime-type>application/x-latex</mime-type>
    
  •    <extension>m3u</extension>
    
  •    <mime-type>audio/x-mpegurl</mime-type>
    
  •    <extension>mac</extension>
    
  •    <mime-type>image/x-macpaint</mime-type>
    
  •    <extension>man</extension>
    
  •    <mime-type>application/x-troff-man</mime-type>
    
  •    <extension>mathml</extension>
    
  •    <mime-type>application/mathml+xml</mime-type>
    
  •    <extension>me</extension>
    
  •    <mime-type>application/x-troff-me</mime-type>
    
  •    <extension>mid</extension>
    
  •    <mime-type>audio/x-midi</mime-type>
    
  •    <extension>midi</extension>
    
  •    <mime-type>audio/x-midi</mime-type>
    
  •    <extension>mif</extension>
    
  •    <mime-type>application/x-mif</mime-type>
    
  •    <extension>mov</extension>
    
  •    <mime-type>video/quicktime</mime-type>
    
  •    <extension>movie</extension>
    
  •    <mime-type>video/x-sgi-movie</mime-type>
    
  •    <extension>mp1</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>mp2</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>mp3</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>mp4</extension>
    
  •    <mime-type>video/mp4</mime-type>
    
  •    <extension>mpa</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>mpe</extension>
    
  •    <mime-type>video/mpeg</mime-type>
    
  •    <extension>mpeg</extension>
    
  •    <mime-type>video/mpeg</mime-type>
    
  •    <extension>mpega</extension>
    
  •    <mime-type>audio/x-mpeg</mime-type>
    
  •    <extension>mpg</extension>
    
  •    <mime-type>video/mpeg</mime-type>
    
  •    <extension>mpv2</extension>
    
  •    <mime-type>video/mpeg2</mime-type>
    
  •    <extension>ms</extension>
    
  •    <mime-type>application/x-wais-source</mime-type>
    
  •    <extension>nc</extension>
    
  •    <mime-type>application/x-netcdf</mime-type>
    
  •    <extension>oda</extension>
    
  •    <mime-type>application/oda</mime-type>
    
  •    <!-- OpenDocument Database -->
    
  •    <extension>odb</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.database</mime-type>
    
  •    <!-- OpenDocument Chart -->
    
  •    <extension>odc</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.chart</mime-type>
    
  •    <!-- OpenDocument Formula -->
    
  •    <extension>odf</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.formula</mime-type>
    
  •    <!-- OpenDocument Drawing -->
    
  •    <extension>odg</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.graphics</mime-type>
    
  •    <!-- OpenDocument Image -->
    
  •    <extension>odi</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.image</mime-type>
    
  •    <!-- OpenDocument Master Document -->
    
  •    <extension>odm</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.text-master</mime-type>
    
  •    <!-- OpenDocument Presentation -->
    
  •    <extension>odp</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.presentation</mime-type>
    
  •    <!-- OpenDocument Spreadsheet -->
    
  •    <extension>ods</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type>
    
  •    <!-- OpenDocument Text -->
    
  •    <extension>odt</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.text</mime-type>
    
  •    <extension>ogg</extension>
    
  •    <mime-type>application/ogg</mime-type>
    
  •    <!-- OpenDocument Drawing Template -->
    
  •    <extension>otg </extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type>
    
  •    <!-- HTML Document Template -->
    
  •    <extension>oth</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.text-web</mime-type>
    
  •    <!-- OpenDocument Presentation Template -->
    
  •    <extension>otp</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.presentation-template</mime-type>
    
  •    <!-- OpenDocument Spreadsheet Template -->
    
  •    <extension>ots</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.spreadsheet-template </mime-type>
    
  •    <!-- OpenDocument Text Template -->
    
  •    <extension>ott</extension>
    
  •    <mime-type>application/vnd.oasis.opendocument.text-template</mime-type>
    
  •    <extension>pbm</extension>
    
  •    <mime-type>image/x-portable-bitmap</mime-type>
    
  •    <extension>pct</extension>
    
  •    <mime-type>image/pict</mime-type>
    
  •    <extension>pdf</extension>
    
  •    <mime-type>application/pdf</mime-type>
    
  •    <extension>pgm</extension>
    
  •    <mime-type>image/x-portable-graymap</mime-type>
    
  •    <extension>pic</extension>
    
  •    <mime-type>image/pict</mime-type>
    
  •    <extension>pict</extension>
    
  •    <mime-type>image/pict</mime-type>
    
  •    <extension>pls</extension>
    
  •    <mime-type>audio/x-scpls</mime-type>
    
  •    <extension>png</extension>
    
  •    <mime-type>image/png</mime-type>
    
  •    <extension>pnm</extension>
    
  •    <mime-type>image/x-portable-anymap</mime-type>
    
  •    <extension>pnt</extension>
    
  •    <mime-type>image/x-macpaint</mime-type>
    
  •    <extension>ppm</extension>
    
  •    <mime-type>image/x-portable-pixmap</mime-type>
    
  •    <extension>ppt</extension>
    
  •    <mime-type>application/vnd.ms-powerpoint</mime-type>
    
  •    <extension>pps</extension>
    
  •    <mime-type>application/vnd.ms-powerpoint</mime-type>
    
  •    <extension>ps</extension>
    
  •    <mime-type>application/postscript</mime-type>
    
  •    <extension>psd</extension>
    
  •    <mime-type>image/x-photoshop</mime-type>
    
  •    <extension>qt</extension>
    
  •    <mime-type>video/quicktime</mime-type>
    
  •    <extension>qti</extension>
    
  •    <mime-type>image/x-quicktime</mime-type>
    
  •    <extension>qtif</extension>
    
  •    <mime-type>image/x-quicktime</mime-type>
    
  •    <extension>ras</extension>
    
  •    <mime-type>image/x-cmu-raster</mime-type>
    
  •    <extension>rdf</extension>
    
  •    <mime-type>application/rdf+xml</mime-type>
    
  •    <extension>rgb</extension>
    
  •    <mime-type>image/x-rgb</mime-type>
    
  •    <extension>rm</extension>
    
  •    <mime-type>application/vnd.rn-realmedia</mime-type>
    
  •    <extension>roff</extension>
    
  •    <mime-type>application/x-troff</mime-type>
    
  •    <extension>rtf</extension>
    
  •    <mime-type>application/rtf</mime-type>
    
  •    <extension>rtx</extension>
    
  •    <mime-type>text/richtext</mime-type>
    
  •    <extension>sh</extension>
    
  •    <mime-type>application/x-sh</mime-type>
    
  •    <extension>shar</extension>
    
  •    <mime-type>application/x-shar</mime-type>
    

+<!–

  •    <extension>shtml</extension>
    
  •    <mime-type>text/x-server-parsed-html</mime-type>
    

±->

  •    <extension>smf</extension>
    
  •    <mime-type>audio/x-midi</mime-type>
    
  •    <extension>sit</extension>
    
  •    <mime-type>application/x-stuffit</mime-type>
    
  •    <extension>snd</extension>
    
  •    <mime-type>audio/basic</mime-type>
    
  •    <extension>src</extension>
    
  •    <mime-type>application/x-wais-source</mime-type>
    
  •    <extension>sv4cpio</extension>
    
  •    <mime-type>application/x-sv4cpio</mime-type>
    
  •    <extension>sv4crc</extension>
    
  •    <mime-type>application/x-sv4crc</mime-type>
    
  •    <extension>svg</extension>
    
  •    <mime-type>image/svg+xml</mime-type>
    
  •    <extension>svgz</extension>
    
  •    <mime-type>image/svg+xml</mime-type>
    
  •    <extension>swf</extension>
    
  •    <mime-type>application/x-shockwave-flash</mime-type>
    
  •    <extension>t</extension>
    
  •    <mime-type>application/x-troff</mime-type>
    
  •    <extension>tar</extension>
    
  •    <mime-type>application/x-tar</mime-type>
    
  •    <extension>tcl</extension>
    
  •    <mime-type>application/x-tcl</mime-type>
    
  •    <extension>tex</extension>
    
  •    <mime-type>application/x-tex</mime-type>
    
  •    <extension>texi</extension>
    
  •    <mime-type>application/x-texinfo</mime-type>
    
  •    <extension>texinfo</extension>
    
  •    <mime-type>application/x-texinfo</mime-type>
    
  •    <extension>tif</extension>
    
  •    <mime-type>image/tiff</mime-type>
    
  •    <extension>tiff</extension>
    
  •    <mime-type>image/tiff</mime-type>
    
  •    <extension>tr</extension>
    
  •    <mime-type>application/x-troff</mime-type>
    
  •    <extension>tsv</extension>
    
  •    <mime-type>text/tab-separated-values</mime-type>
    
  •    <extension>txt</extension>
    
  •    <mime-type>text/plain</mime-type>
    
  •    <extension>ulw</extension>
    
  •    <mime-type>audio/basic</mime-type>
    
  •    <extension>ustar</extension>
    
  •    <mime-type>application/x-ustar</mime-type>
    
  •    <extension>vxml</extension>
    
  •    <mime-type>application/voicexml+xml</mime-type>
    
  •    <extension>xbm</extension>
    
  •    <mime-type>image/x-xbitmap</mime-type>
    
  •    <extension>xht</extension>
    
  •    <mime-type>application/xhtml+xml</mime-type>
    
  •    <extension>xhtml</extension>
    
  •    <mime-type>application/xhtml+xml</mime-type>
    
  •    <extension>xls</extension>
    
  •    <mime-type>application/vnd.ms-excel</mime-type>
    
  •    <extension>xml</extension>
    
  •    <mime-type>application/xml</mime-type>
    
  •    <extension>xpm</extension>
    
  •    <mime-type>image/x-xpixmap</mime-type>
    
  •    <extension>xsl</extension>
    

[Message clipped]