=== modified file 'src/docbkx/en/dhis2_implementation_guide_installation.xml' --- src/docbkx/en/dhis2_implementation_guide_installation.xml 2012-05-17 10:05:13 +0000 +++ src/docbkx/en/dhis2_implementation_guide_installation.xml 2012-08-10 11:04:44 +0000 @@ -4,12 +4,19 @@ Installation The installation chapter provides information on how to install DHIS 2 in various contexts, including online central server, offline local network, standalone application and self-contained package called DHIS 2 Live. DHIS 2 runs on all platforms for which there exists a Java Runtime Environment version 6 or higher, which includes most popular operating systems such as Windows, Linux and Mac. DHIS 2 also runs on many relational database systems such as PostgreSQL, MySQL, H2 and Derby. DHIS 2 is packaged as a standard Java Web Archive (WAR-file) and thus runs on any Servlet containers such as Tomcat and Jetty. - The DHIS 2 team recommends Ubuntu 10.04 LTS operating system, PostgreSQL database system and Tomcat Servlet container as the preferred environment for server installations. The mentioned frameworks can be regarded as market leaders within their domain and is heavily field tested over many years. + The DHIS 2 team recommends Ubuntu 12.04 LTS operating system, PostgreSQL database system and + Tomcat Servlet container as the preferred environment for server installations. The mentioned + frameworks can be regarded as market leaders within their domain and is heavily field tested + over many years. This chapter provides a guide for setting up the above technology stack. It should however be read as a guide for getting up and running and not as an exhaustive documentation for the mentioned environment. We refer to the offical Ubuntu, PostgreSQL and Tomcat documentation for in-depth reading.
Server setup - This section describes how to set up a server instance of DHIS 2 on Ubuntu 10.04 64 bit with PostgreSQL as database system and Tomcat as Servlet container. The term invoke refers to executing a given command in a terminal. - For a national server the recommended configuration is a quad-core 2 Ghz processor or higher and 12 Gb RAM or higher. Note that a 64 bit operating system is required for utilizing more than 4 Gb of RAM, the Ubuntu 10.04 64 bit edition is thus recommended. + This section describes how to set up a server instance of DHIS 2 on Ubuntu 12.04 64 bit + with PostgreSQL as database system and Tomcat as Servlet container. The term invoke refers to executing a given command in a terminal. + For a national server the recommended configuration is a quad-core 2 Ghz processor or + higher and 12 Gb RAM or higher. Note that a 64 bit operating system is required for utilizing + more than 4 Gb of RAM, the Ubuntu 12.04 64 bit edition is thus recommended. For this guide we assume that 4 Gb RAM is allocated for PostgreSQL and 7 GB RAM is allocated for Tomcat. If you are running a different configuration please adjust the suggested values accordingly! The steps marked as optional, like the step for performance tuning, can be done at a later stage. Create new user (optional) You might want to create a dedicated user for running DHIS - it is not recommended to run as the root user. Create a new user called dhis by invoking useradd -d /home/dhis -m dhis -s /bin/bash Then make the user able to perform operations temporarily as root user by invoking adduser dhis admin If there is no admin group you must create it first by invoking groupadd admin Then invoke passwd dhis to set the password for your account. Make sure you set a strong password with at least 15 random characters. You might want to disable remote login for the root account for improved security by invoking sudo passwd -l root @@ -28,14 +35,15 @@ sudo update-alternatives --set java /usr/lib/jvm/java-7-openjdk/bin/java Please check that the path the Java binaries are correct as they might vary from system to system, e.g. on AMD systems you might see ../java-7-openjdk-amd64/.. Check that your installation is okay by invoking java -version Install PostgreSQL - Install PostgreSQL by invoking sudo apt-get install postgresql-8.4 - First configure client authentication by opening the following file by invoking - sudo nano /etc/postgresql/8.4/main/pg_hba.conf - Scroll down towards the end of the file and replace the word peer with md5 so that it reads - local all all md5 - Switch to the postgres user by invoking sudo su postgres Log into psql by invoking psql Create a user called dhis by invoking create user dhis with password '<dhis>'; Replace the password <dhis> with something secure. Create a database by invoking create database dhis2 with owner dhis encoding 'utf8'; Exit psql by invoking \q Return to your session by invoking exit You now have a PostgreSQL user called dhis and a database called dhis2. + Install PostgreSQL by invoking sudo apt-get install postgresql-9.1 + Switch to the postgres user by invoking sudo su postgres. + Create a non-priveleged user called dhis by invoking + createuser -SDRP dhis. Enter a secure password at the prompt. Create a database by invoking + createdb -O dhis dhis2. Return to your session by invoking exit You now have a + PostgreSQL user called dhis and a database called dhis2. Do performance tuning by opening the following file by invoking - sudo nano /etc/postgresql/8.4/main/postgresql.conf + sudo nano /etc/postgresql/9.1/main/postgresql.conf and set the following properties: shared_buffers = 512MB Determines how much memory PostgreSQL can use for caching of query data. Is set too low by default since it depends on kernel shared memory which is low on some operating systems. @@ -58,9 +66,13 @@ hibernate.connection.driver_class = org.postgresql.Driver hibernate.connection.url = jdbc:postgresql:dhis2 hibernate.connection.username = dhis -hibernate.connection.password = dhis +hibernate.connection.password = xxxx hibernate.hbm2ddl.auto = update - A common mistake is to have a white-space after the last property value - make sure there is no white-space at the end of any line. + A common mistake is to have a white-space after the last property value - make sure there + is no white-space at the end of any line. Also remember that this file contains the clear text + password for your dhis2 database so needs to be protected from unauthorized access. To do this + invoke chmod 0600 hibernate.properties which ensures that only the dhis user which owns the + file is allowed to read or write to it. Install Tomcat Download the Tomcat binary distribution from http://tomcat.apache.org/download-70.cgi A useful tool for downloading files from the web is wget. Extract to a convenient location. This guide assumes that you have navigated to the root directory of the extracted archive. Clear the pre-installed web applications by invoking rm -rf webapps/* Download the latest DHIS 2 WAR file from http://dhis2.org/download, move it to the webapps directory and rename it to ROOT.war