=== modified file 'tools/dhis2-tools-deb/Makefile' --- tools/dhis2-tools-deb/Makefile 2013-05-28 12:06:12 +0000 +++ tools/dhis2-tools-deb/Makefile 2014-07-04 10:56:19 +0000 @@ -1,4 +1,4 @@ -TARGET=dhis2-tools_1.0-0ubuntu1_all.deb +TARGET=dhis2-tools_1.1-0ubuntu1_all.deb all: deb test === modified file 'tools/dhis2-tools-deb/docs/Makefile' --- tools/dhis2-tools-deb/docs/Makefile 2013-05-28 12:06:12 +0000 +++ tools/dhis2-tools-deb/docs/Makefile 2014-07-04 10:56:19 +0000 @@ -6,3 +6,4 @@ clean: rm -f *.gz + rm -f ../pkg/usr/share/man/man1/* === added file 'tools/dhis2-tools-deb/docs/architecture.svg' --- tools/dhis2-tools-deb/docs/architecture.svg 1970-01-01 00:00:00 +0000 +++ tools/dhis2-tools-deb/docs/architecture.svg 2014-07-04 10:56:19 +0000 @@ -0,0 +1,1350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + PHYSICAL SPACE (Data centre/Server room) + + + + + + + + + + + + + + + + + + + Postgresql Database + + web Proxy(nginx) + + + Operating system + + Hardware + + + Router + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MOHCCPremises + + + + + + + + + + + + + + + + + + + Users + + + + Users + + + + + + + DHIS WEB APPLICATION + + + Webapp container(tomcat) + + DHIS2 instances + + + + + + === modified file 'tools/dhis2-tools-deb/docs/manual.xml' --- tools/dhis2-tools-deb/docs/manual.xml 2013-06-14 13:19:16 +0000 +++ tools/dhis2-tools-deb/docs/manual.xml 2014-07-04 10:56:19 +0000 @@ -11,14 +11,86 @@ Overview The dhis2-tools package is a collection of tools and utilities for installing and managing - DHIS2 applications on an ubuntu server. The tools provide the ability to go from a "blank" + DHIS2 applications on an ubuntu server. The tools provide the ability to go from a "blank" server with only ssh running, to a fully functioning dhis2 installation in a matter of - minutes. Used together they can also be combined into automated scripts to facilitate rapid + minutes. Used together they can also be combined into automated scripts to facilitate rapid reconstruction of a given configuration. - - - - DHIS2 tools + The tools have been collected and developed over a number of years. This documentation + differs in some respects from the installation guidelines in the dhis2 user manual in that it describes + the implementation of a specific approach rather than the more general tutorial nature of the + user manual. It is recommended that implementers do also study the material in the user manual as it provides additional + information, eg. how to tune the postgresql server. The rationale of the tools described in + this manual includes: + + + to ease the process of installation so that it can be easily explained, documented + and executed; + + + to assist system administrators (particularly, but not exclusively, lesser experienced + ones) to implement reasonable security measures by default and thus minimize vulnerabilities + brought about through human error and negligence; + + + + to provide a set of scripts to assist the administrator with tasks related to managing their + dhis2 system, beyond the one-off process of installation. + + + The package remains a work in progress and there are a number of areas where it could and should + (and hopefully will be improved). For example, + + currently the tuning of the postgresql database is not covered. There are ways in which + this could be at least semi-automated; + nginx configuration is assisted by means of providing a sample configuration file. + This configuration could be made more dynamic; + the format of what is currently packaged is an Ubuntu linux deb package. There is + also considerable interest in the Redhat/CentOS flavour of linux for running dhis2. It should be + possible to offer a yum format package to facilitate use on these systems. + + + + + +
+ Single machine all-in-one installation + +
+
+
+ + Installation + This manual assumes that you have installed a minimal distribution of ubuntu server 12.04 LTS. + By minimal we mean that only the base operating system is installed together with an openssh server. + During the installation you shouls avoid to install ANY other packages (like java, postgres, nginx etc). + The dhis2-tools package and install.sh script will ensure that these required packages are installed + as dependencies. + + It is recommended as a general guideline that before proceeding any further you should strengthen the + security of the system at this point by securing your ssh service properly and installing a host based + firewall like ufw. This process is described eleswhere(?). + + Once your base system is properly installed and secured you can proceed to install the + dhis2-tools package. To do so you need to copy the two file dhis2-tools-xxx.deb and install.sh + to the server. Place them together in a directory under your user's home directory. To do this + you will need to use a tool like scp (on linux) or winscp on windows. + + + Once the files are in place you can install the tools by typing the following: + + sudo ./install.sh + there must be at least + one user who has full sudo rights (usermod -G sudo bobj). That user can run the + dhis-create-admin command and create new dhis administrators. These dhis admins do not need to + have root access at all, but they have full rights to the database and all (other) dhis + commands. The idea being that as you work with fledgling dhis admin users you can give them + rights without making them all root. Maybe it is too fanciful .. all the magic is happening in + /etc/sudoers.d/dhis2 (though looking at that again I suspect I actually have something wrong + there) + + + + DHIS2 tools reference @@ -49,22 +121,24 @@ will have a home directory created in /var/lib/dhis2/<username>. This directory acts as both the DHIS2_HOME directory and also the CATALINA_BASE directory for the tomcat servlet container. - By default the instance is allocated 2G of heap space RAM. This can be adjusted by - editing the parameters in /var/lib/dhis2/<name>/bin/setenv.sh. + By default the instance is allocated 2G of heap space RAM. This can be adjusted by + editing the parameters in /var/lib/dhis2/<name>/bin/setenv.sh. The servlet container is configured to run with an http connector pool of a maximum of - 100 threads. This parameter can be adjusted by editing /var/lib/dhis2/<name>/conf/server.conf. - The servlet container configuration has been specially tweaked for running DHIS2. For + 100 threads. This parameter can be adjusted by editing /var/lib/dhis2/<name>/conf/server.conf. + The servlet container configuration has been specially tweaked for running DHIS2. For example tomcat filters are used to ensure that all static content from the web application - are cacheable by web proxy servers such as nginx or apache. The lib directory of the + are cacheable by web proxy servers such as nginx or apache. The lib directory of the webapp has been explicitly placed in the application classpath so that additional jars such as java compiled apache camel routes can be made available to the DHIS2 application. - Note that a dhis2 war file is not deployed by default. See the manual page for + Note that a dhis2 war file is not deployed by default. See the manual page for dhis2-deploy-war for instructions to deploy a dhis2 war file over the internet from the latest stable global build, latest trunk build or from a user specified war file on the filesystem. You need to be a member of the dhis2-admin group to - use these and other tools for managing the instance. See the manual page for dhis2-create-admin. @@ -72,7 +146,9 @@ -p - http port + + http port + @@ -157,42 +233,55 @@ - /usr/bin/dhis2-deploy-stable + /usr/bin/dhis2-deploy-war instance name - + OPTIONS -t - Deploy war from latest trunk build. NOT RECOMMENDED for production systems + + Deploy war from latest trunk build. NOT RECOMMENDED for production + systems + -l - Deploy war located at a custom url + + Deploy war located at a custom url + -f - Deploy war from a file on the filesystem + + Deploy war from a file on the filesystem + - + Description - Deploys a dhis2 war file to the instance. The default behaviour when no options are given is to download and deploy the latest stable release from http://stable.dhis2.org. + Deploys a dhis2 war file to the instance. The default behaviour when no options are + given is to download and deploy the latest stable release from + http://stable.dhis2.org. Examples - dhis2-deploy-war myInstance deploys the latest stable release from dhis2.org into myInstance. - dhis2-deploy-war -f wars/dhis.war myInstance deploys the war file at wars/dhis.war into myInstance. - dhis2-deploy-war -t myInstance deploys the latest trunk build from the dhis2 team integration server into myInstance. Don't use this in production. - dhis2-deploy-war -l http://mywars.org/dhis.war myInstance deploys the war file from a user provided url into myInstance. + dhis2-deploy-war myInstance deploys the latest stable release from + dhis2.org into myInstance. + dhis2-deploy-war -f wars/dhis.war myInstance deploys the war file + at wars/dhis.war into myInstance. + dhis2-deploy-war -t myInstance deploys the latest trunk build from + the dhis2 team integration server into myInstance. Don't use this in production. + dhis2-deploy-war -l http://mywars.org/dhis.war myInstance deploys + the war file from a user provided url into myInstance. === renamed file 'tools/dhis2-tools-deb/install_14.04.sh' => 'tools/dhis2-tools-deb/install.sh' --- tools/dhis2-tools-deb/install_14.04.sh 2014-06-27 15:35:16 +0000 +++ tools/dhis2-tools-deb/install.sh 2014-07-04 10:56:19 +0000 @@ -1,9 +1,64 @@ -#!/bin/sh -# set -e +#!/usr/bin/env bash +# ____ __ ______________ +# / __ \/ / / / _/ ___/__ \ +# / / / / /_/ // / \__ \__/ / +# / /_/ / __ // / ___/ / __/ +# /_____/_/ /_/___//____/____/ +# +# DHIS2 installation helper script + +set -e + +# Make sure we are on a supported distribution +DISTRO=$(lsb_release -si) +RELEASE=$(lsb_release -sr) + +echo "Attempting installion of dhis2-tools on $DISTRO linux version $RELEASE" +# No CentOS version yet :-( +if [ $DISTRO != 'Ubuntu' ] +then + echo "Sorry installation only supported on Ubuntu at this time" + echo "Exiting ..." + exit 1 +fi + +# Only tested on LTS Ubuntu versions +case $RELEASE in + + 12.04) + echo "installing on 12.04" + echo "setup repositories for postgresql and nginx"; + # new way to install postgres 9.2 (https://wiki.postgresql.org/wiki/Apt) + echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" >/etc/apt/sources.list.d/pgdg.list + wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - + # need to use a ppa for nginx + apt-get -y install python-software-properties -y + add-apt-repository ppa:nginx/stable -y;; + + 14.04) + echo "installing on 14.04";; + + *) + echo "Only Ubuntu LTS releases (12.04 and 14.04) are supported"; + echo "Exiting ..."; + exit 1;; +esac + +# add dhis2 apt repository to sources +echo 'deb http://apt.dhis2.org/amd64 /' > /etc/apt/sources.list.d/dhis2.list +wget -O - http://apt.dhis2.org/keyFile |apt-key add - + +apt-get update -y # install the dhis2-tools deb -dpkg -i dhis2-tools* -apt-get -y install -f +apt-get install dhis2-tools # Uncomment below to install postgres and nginx servers on this machine # apt-get -y install nginx postgresql +echo "The dhis2-tools are now installed. You may also want to" +echo "install nginx and postgresql servers on this machine. You" +echo "can do so by running:" +echo +echo "apt-get install nginx postgresql" +echo +echo "Type 'apropos dhis2' to see available manual pages." === removed file 'tools/dhis2-tools-deb/install_12.04.sh' --- tools/dhis2-tools-deb/install_12.04.sh 2014-06-30 08:02:26 +0000 +++ tools/dhis2-tools-deb/install_12.04.sh 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -#!/bin/sh -# set -e - -# new way to install postgres 9.2 (https://wiki.postgresql.org/wiki/Apt) -echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" >/etc/apt/sources.list.d/pgdg.list -wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - - -# need to use a ppa for nginx -apt-get -y install python-software-properties -y -add-apt-repository ppa:nginx/stable -y -apt-get -y update - -# install the dhis2-tools deb -dpkg -i dhis2-tools* -apt-get -y install -f - -# Uncomment below to install postgres and nginx servers on this machine -# apt-get -y install nginx postgresql-9.2 === modified file 'tools/dhis2-tools-deb/pkg/DEBIAN/control' --- tools/dhis2-tools-deb/pkg/DEBIAN/control 2014-06-27 15:14:45 +0000 +++ tools/dhis2-tools-deb/pkg/DEBIAN/control 2014-07-04 10:56:19 +0000 @@ -1,6 +1,6 @@ Package: dhis2-tools Source: dhis2-tools -Version: 1.0 +Version: 1.1 Architecture: all Maintainer: DHIS2 developers Installed-Size: 236