dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16447
[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 462: Coped apache section from detailed installation to installation chapter. Removed detailed install...
------------------------------------------------------------
revno: 462
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Tue 2012-03-13 13:38:06 +0100
message:
Coped apache section from detailed installation to installation chapter. Removed detailed installation chapter.
removed:
src/docbkx/en/dhis2_implementation_guide_installation_detailed.xml
src/docbkx/en/resources/images/dhis2_ubuntu_installation/
src/docbkx/en/resources/images/dhis2_ubuntu_installation/CRS Comments - Google Chrome.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Continue-Yes.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Create-folder.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/JAVA_HOME.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Java-agreement.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Add-Server.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Guru Hint - Saving passwords.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin_NewServerRegistration.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Pg_hba.conf.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Places-Home.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/Postgresql.conf.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid (2).png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/download java jdk.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit password.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_password-unix.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_sources.list.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/export_CATALINA_OPTS.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/hibernate.properties.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-Restore.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-Query-running.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-file.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-open.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-run.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin_FindBackup.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/postgres.png
src/docbkx/en/resources/images/dhis2_ubuntu_installation/tab_key.jpg
modified:
src/docbkx/en/dhis2_implementation_guide_en.xml
src/docbkx/en/dhis2_implementation_guide_installation.xml
--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs
Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_implementation_guide_en.xml'
--- src/docbkx/en/dhis2_implementation_guide_en.xml 2012-02-18 07:50:49 +0000
+++ src/docbkx/en/dhis2_implementation_guide_en.xml 2012-03-13 12:38:06 +0000
@@ -15,7 +15,6 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_integration.xml" encoding="UTF-8"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_installation.xml" encoding="UTF-8"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_support.xml" encoding="UTF-8"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_installation_detailed.xml" encoding="UTF-8"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_organisation_units.xml" encoding="UTF-8"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_data_elements_and_custom_dimensions.xml" encoding="UTF-8"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhis2_implementation_guide_data_sets_and_forms.xml" encoding="UTF-8"/>
=== modified file 'src/docbkx/en/dhis2_implementation_guide_installation.xml'
--- src/docbkx/en/dhis2_implementation_guide_installation.xml 2012-03-13 11:05:21 +0000
+++ src/docbkx/en/dhis2_implementation_guide_installation.xml 2012-03-13 12:38:06 +0000
@@ -57,7 +57,7 @@
<para>Make the startup script executable by invoking <code>chmod 755 bin/*</code> DHIS 2 can now be started by invoking <code>bin/startup.sh</code> The log can be monitored by invoking <code>tail -f logs/catalina.out</code> DHIS 2 can be stopped by invoking <code>bin/shutdown.sh</code> Assuming that the WAR file is called dhis.war, you can now access your DHIS instance at <emphasis role="italic">http://localhost:8080/dhis</emphasis></para>
</section>
<section>
- <title>Reverse proxy (optional)</title>
+ <title>Reverse proxy with nginx (optional)</title>
<para>A reverse proxy is a proxy server that acts on behalf of a server. Using a reverse proxy in combination with a servlet container is optional but has many advantages:</para>
<itemizedlist>
<listitem>
@@ -138,6 +138,55 @@
}]]></screen>
</section>
<section>
+ <title>Reverse proxy with Apache (optional)</title>
+ <para><emphasis role="italic">Using nginx is the preferred option as reverse proxy and you should not attempt to install both nginx and apache. If you have installed nginx please ignore this section.</emphasis></para>
+ <para>First we need to install a few necessary programs. </para>
+ <para><screen>sudo apt-get install apache2 libapache2-mod-proxy-html libapache2-mod-jk a2enmod proxy proxy_ajp proxy_connect</screen></para>
+ <para>Lets define an AJP connector which Apache HTTP server will use to connect to Tomcat with. The Tomcat server.xml file should be located in the /usr/local/apache-tomcat-7.0.8/conf/ directory. Be sure this line is uncommented.You can set the port to anything you like which is unused.</para>
+ <para><screen><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
+</screen>Now, we need to make the adjustments to the Apache HTTP server which will answer requests on port 80 and pass them to the Tomcat server through an AJP connector. Edit the file /etc/apache2/mods-enabled/proxy.conf so that it looks like the example below. Be sure that the port defined in the configuration file matches the one from Tomcat.</para>
+ <para><screen><IfModule mod_proxy.c>
+ProxyPreserveHost On
+ProxyRequests Off
+ProxyPass /dhis ajp://localhost:8009/dhis
+ProxyPassReverse /dhis ajp://localhost:8009/dhis
+ProxyVia On
+<Location "/dhis">
+ Order allow,deny
+ Allow from all
+</Location>
+</IfModule>
+</screen></para>
+ <para>You now can restart Tomcat and the Apache HTTPD server and your DHIS 2 instance should not be available on http://localhost/dhis. </para>
+ <para><emphasis role="bold">Implementing SSL encryption</emphasis></para>
+ <para>Using Apache and the reverse proxy setup described in the previous section, we can easily implement encrypted transfer of data between clients and the server over HTTPS. This section will describe how to use self-signed certificates, although the same procedure could be used if you have fully-signed certificates as well. </para>
+ <para>First (as root), generate the necessary private key files and CSR (Certificate Signing Request) </para>
+ <screen>mkdir /etc/apache2/ssl
+cd /etc/apache2/ssl
+openssl genrsa -des3 -out server.key 1024
+openssl req -new -key server.key -out server.csr</screen>
+ <para>We need to remove the password from the key, otherwise Apache will not be able to use it. </para>
+ <para><screen>cp server.key server.key.org
+openssl rsa -in server.key.org -out server.key</screen></para>
+ <para>Next, generate a self-signed certificate which will be valid for one year.</para>
+ <screen>openssl x509 -req -days 365 -in server.csr -signkey \ server.key -out server.crt</screen>
+ <para>Now, lets configure Apache by enabling the SSL modules and creating a default site.</para>
+ <screen>a2enmod ssl
+a2ensite default-ssl</screen>
+ <para>Now, we need to edit the default-ssl (located at <filename>/etc/apache2/sites-enabled/default-ssl</filename>) file in order to enable the SSL transfer functionality of Apache. </para>
+ <para><screen><VirtualHost *:443>
+ ServerAdmin wemaster@xxxxxxxxxxxx
+ SSLEngine On
+ SSLCertificateFile /etc/apache2/ssl/server.crt
+ SSLCertificateKeyFile /etc/apache2/ssl/server.key
+...</screen></para>
+ <para>Be sure that the *:80 section of this file is changed to port *:443, which is the default SSL port. Also, be sure to change the ServerAdmin to the webmaster's email. Lastly, we need to be sure that the hostname is setup properly in /etc/hosts. Just under the "localhost" line, be sure to add the server's IP address and domain name. </para>
+ <para><screen>127.0.0.1 localhost
+XXX.XX.XXX.XXX foo.mydomain.org</screen></para>
+ <para>Now, just restart Apache and you should be able to view https://foo.mydomain.org/dhis. </para>
+ <screen>/etc/init.d/apache2 restart</screen>
+ </section>
+ <section>
<title>DHIS 2 Live setup</title>
<para>The DHIS 2 Live package is extremely convenient to install and run. It is intended for demonstrations, for users who want to explore the system and for small, offline installations typically at districts or facilities. It only requires a Java Runtime Environment and runs on all browsers except Internet Explorer 7 and lower.</para>
<para>To install start by downloading DHIS 2 Live from <emphasis role="italic">http://dhis2.org</emphasis> and extract the archive to any location. On Windows click the executable archive. On Linux invoke the startup.sh script. After the startup process is done your default web browser will automtically be pointed to <emphasis role="italic">http://localhost:8082</emphasis> where the application is accessible. A system tray menu is accessible on most operating systems where you can start and stop the server and start new browser sesssions. Please note that if you have the server running there is no need to start it again, simply open the application from the tray menu.</para>
=== removed file 'src/docbkx/en/dhis2_implementation_guide_installation_detailed.xml'
--- src/docbkx/en/dhis2_implementation_guide_installation_detailed.xml 2012-02-14 08:15:15 +0000
+++ src/docbkx/en/dhis2_implementation_guide_installation_detailed.xml 1970-01-01 00:00:00 +0000
@@ -1,751 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- This document was created with Syntext Serna Free. --><!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" []>
-<chapter>
- <title>Installation on Ubuntu 10.10 - Detailed guide</title>
- <para>This guide is a more detailed walk-through installation guide on how to install DHIS 2 on Ubuntu 10.10. DHIS2 requires Java, a relational database system and a Java servlet container to run. This guide will guide you through the installation of Java, PostgreSQL (a relational database system) , pgAdmin (the graphical userinterface for PostgreSQL) and Apache Tomcat (a Java servlet container).</para>
- <section>
- <title>Installing Java</title>
- <para>To install Java, the repository where Java resides needs to be added to Ubuntu's repositories. Invoke the following command to do that <emphasis role="italic">(Note: it's <emphasis role="underline">one</emphasis> command, not two!</emphasis>):</para>
- <screen>sudo add-apt-repository ppa:sun-java-community-team/sun-java6</screen>
- <para>Then the package list needs to be updated, before continuing to installing java. Invike the following command to do that:</para>
- <screen>sudo apt-get update</screen>
- <screen>sudo apt-get install sun-java6</screen>
- <para>When installation is finished, a blue screen appears:</para>
- <screenshot>
- <screeninfo>Java license agreement</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="67%" fileref="resources/images/dhis2_ubuntu_installation/Java-agreement.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Press the <emphasis role="underline">TAB key</emphasis> on your keyboard so that <code><OK></code> is marked red, and then press ENTER. In the next window, when you're asked whether you agree, use the <emphasis role="underline">arrow keys</emphasis> to mark <code><Yes></code> red, and then press ENTER. The <emphasis role="underline">TAB key</emphasis> looks like this:</para>
- </section>
- <section id="sec.install_postgres">
- <title>Instaling PostgreSQL</title>
- <para>In the terminal, invoke the following command to install PostgreSQL:</para>
- <screen>sudo apt-get install postgresql-8.4</screen>
- <para>Type <code>Y</code> and press ENTER if you're asked if you want to continue:</para>
- <screenshot>
- <screeninfo>Type Y when you're asked if you want to continue</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/Continue-Yes.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <section>
- <title>Set password for the system user></title>
- <para>To set the password for the postgres system user, invoke the following command and then follow the instructions:</para>
- <screen>sudo passwd postgres</screen>
- <screenshot>
- <screeninfo>Set password for the system user</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="50%" fileref="resources/images/dhis2_ubuntu_installation/edit_password-unix.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </section>
- <section>
- <title>Edit database users and create a database</title>
- <para>To modify the databases and the database users, we need to log in as the postgres system user. We use the <emphasis role="italic">switch user</emphasis> command <code>su</code> as shown below. When the screen reads: <code>Password:</code>, type the password you created for the postgres system user in the previous step. Invoke the following command (from terminal):</para>
- <screen>su postgres</screen>
- <para>Now your terminal should start with <code>postgres=#</code></para>
- <para/>
- <para><emphasis role="italic">
- <emphasis role="underline"><emphasis role="bold">NB!!</emphasis>For the following three commands, please note:</emphasis>
- </emphasis></para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="italic">Remember the semi colons (<code>;</code>) at the end of the lines!</emphasis></para>
- </listitem>
- <listitem>
- <para><emphasis role="italic">Also remember to use the apostrophes (<code>'</code>) where specified!</emphasis></para>
- </listitem>
- </itemizedlist>
- <para><emphasis role="italic">If something is unclear, consult the screen shot just below the commands.</emphasis></para>
- <para/>
- <para>To edit the password for the postgres <emphasis role="underline">database</emphasis> user, invoke the following command:</para>
- <screen>ALTER USER postgres WITH password '<a password of your choice>';</screen>
- <para>To create a new user, invoke:</para>
- <screen>CREATE USER <a user name> WITH PASSWORD '<a password of your choice>';</screen>
- <para>To create a new database, invoke:</para>
- <screen>CREATE DATABASE <a database name> WITH OWNER <a user name> ENCODING 'utf8';</screen>
- <para>To quit, type:</para>
- <screen>\q</screen>
- <screenshot>
- <screeninfo>Create a new database user and database</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="50%" fileref="resources/images/dhis2_ubuntu_installation/postgres.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>In the terminal again, to log off the postgres system user, simply invoke:</para>
- <screen>exit</screen>
- </section>
- <section>
- <title>Open the server for connections</title>
- <para>If the server is going to be open for connections, we need to modify the <emphasis role="italic">postgresql.conf</emphasis> file:</para>
- <screen>sudo gedit /etc/postgresql/8.4/main/postgresql.conf</screen>
- <para>In the window that appears, scroll down to</para>
- <screen>#-------------------------------
-CONNECTIONS AND AUTHENTICATION
-#-------------------------------</screen>
- <para> and change the line</para>
- <screen>#listen_addresses = 'localhost' # what IP address(es) to listen on;</screen>
- <para>into:</para>
- <screen>listen_addresses = '*' # what IP address(es) to listen on;</screen>
- <screenshot>
- <screeninfo>Modify the postgresql.conf file to open the server for connections</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/Postgresql.conf.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Then save and exit.</para>
- </section>
- <section>
- <title>Define authorizations for the databases</title>
- <para>To define authorizations for the databases, we need to modify the <emphasis role="italic">pg_hba.conf</emphasis> file:</para>
- <screen>sudo gedit /etc/postgresql/8.4/main/pg_hba.conf</screen>
- <para>In the window that opens, scroll down to the bottom of the file and change <code>ident</code> into <code>md5</code> for the bottom line of the following lines:</para>
- <screen># TYPE DATABASE USER CIDR-ADDRESS METHOD
-
-# "local" is for Unix domain socket connections only
-local all all ident</screen>
- <para>When you're done, it should look like this (the edited line is highlighted):</para>
- <screenshot>
- <screeninfo>Edit the pg_hba.conf file to define authorizations</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/Pg_hba.conf.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Save and exit.</para>
- </section>
- <section>
- <title>Setting up ODBC Connections to the Postgresql server</title>
- <para>Some implementations may require users to connect directly to the database with external software such as Excel, Stata, R or other analysis software. Using ODBC, a connection to the server can be established over the Internet or LAN, between the server and the clients computer. </para>
- <section>
- <title>Setting up a Windows 7 (32 bit) ODBC connection</title>
- <orderedlist>
- <listitem>
- <para>Download and install the current ODBC driver from this <ulink url="http://www.postgresql.org/ftp/odbc/versions/msi/">location</ulink>.</para>
- </listitem>
- <listitem>
- <para>Execute from Start->Run this command to open the ODBC Data Source Administrator</para>
- <screen>%windir%\system32\odbcad32.exe</screen>
- </listitem>
- <listitem>
- <para>Click "Add" and choose the "Postgresql UNICODE" driver type and click "Finish".</para>
- </listitem>
- <listitem>
- <para>Fill in the values in this dialog box.</para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="30%" align="center" fileref="resources/images/odbc/odbc_screen_1.PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <itemizedlist>
- <listitem>
- <para>Data Source: The name of the ODBC data source.</para>
- </listitem>
- <listitem>
- <para>Database: The name of the database to connect to.This should be the name of the DHIS 2 database in most cases.</para>
- </listitem>
- <listitem>
- <para>Server: This should be the fully qualified domain name or the IP address of the server.</para>
- </listitem>
- <listitem>
- <para>User Name: The user name which has properly configured permissions to connect to the database. The user will need to have the correct security settings (at least SELECT privileges) on the required tables.</para>
- </listitem>
- <listitem>
- <para>Description: You can include a description of the ODBC connection here.</para>
- </listitem>
- <listitem>
- <para>SSL mode: Determines whether to use an encrypted connection or not.</para>
- </listitem>
- <listitem>
- <para>Port: The connection port for the database server.</para>
- </listitem>
- <listitem>
- <para>Password: The password for the user which will be used to connec to the database.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>Click the "Datasource" button, and be sure that the "Use Declare/Fech" option is enabled. </para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="30%" align="center" fileref="resources/images/odbc/odbc_screen_2.PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </listitem>
- <listitem>
- <para>ClickOK to exit this dialog box, and the click "Test" to see if the connection works.</para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="20%" align="center" fileref="resources/images/odbc/odbc_screen_3.PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </listitem>
- <listitem>
- <para>Click save to save the ODBC connection. The connection should be available to client applications such as Excel now. </para>
- </listitem>
- </orderedlist>
- </section>
- </section>
- <section>
- <title>Performance tuning</title>
- <para>If you want to increase the performance of PostgreSQL, you can do some changes in some configuration files.</para>
- <section>
- <title>Increase shared memory</title>
- <para>The operating system has something that is called <emphasis role="italic">shared memory</emphasis>. By increasing this, applications can perform better. Invoke the following to open the <emphasis role="italic">sysctl.conf</emphasis> file:</para>
- <screen>sudo gedit /etc/sysctl.conf</screen>
- <para>At the <emphasis role="italic">
- <emphasis role="underline">bottom</emphasis>
- </emphasis> of the file, add the following line:</para>
- <itemizedlist>
- <listitem>
- <para>If your computer has 12 GB of RAM, add</para>
- <screen>kernel.shmmax = 1073741824</screen>
- </listitem>
- <listitem>
- <para>If your computer has less RAM installed, adjust the value accordingly;</para>
- <para>For example, for 4 GB of RAM, add</para>
- <screen>kernel.shmmax = 352321536</screen>
- </listitem>
- </itemizedlist>
- <para>Save the file and exit.</para>
- <para>For the changes to take effect, you need to invoke the following in the terminal:</para>
- <screen>sudo sysctl -p</screen>
- </section>
- <section>
- <title>Adjust PostgreSQL configurations</title>
- <para>By adjusting some PostgreSQL settings, the system can perform even better. We can do this by editing the <emphasis role="italic">postgresql.conf</emphasis> file. Invoke the following command to open the file:</para>
- <screen>sudo gedit /etc/postgresql/8.4/main/postgresql.conf</screen>
- <para>Now you need to locate some lines and edit them. Follow these steps:</para>
- <itemizedlist>
- <listitem>
- <para>Locate the following line:</para>
- <screen>shared_buffers = 24MB # min 128kB</screen>
- <para>Change it so it reads (this assumes that your computer has 12 GB of RAM, if not, adjust the value accordingly):</para>
- <screen>shared_buffers = 512MB # min 128kB</screen>
- </listitem>
- <listitem>
- <para>Then locate the following line:</para>
- <screen>#synchronous_commit = on # immediate fsync at commit</screen>
- <para>Change it so it reads:</para>
- <para><screen>synchronous_commit = off</screen></para>
- </listitem>
- <listitem>
- <para>Now, locate the following line:</para>
- <screen>#wal_writer_delay = 200ms # 1-10000 milliseconds</screen>
- <para>Change it so it reads (your computer's RAM does not matter here):</para>
- <screen>wal_writer_delay = 10000ms # 1-10000 milliseconds</screen>
- <para>i.e. remove <emphasis role="underline">the first</emphasis> <code>#</code> and set the value to <code>10000ms</code> (ten thousand)</para>
- </listitem>
- <listitem>
- <para>Finally, locate the following line:</para>
- <screen>#effective_cache_size = 128MB</screen>
- <para>Change it so it reads (for 12 GB of RAM):</para>
- <screen>effective_cache_size = 3750MB</screen>
- <para>i.e. remove <emphasis role="underline">the first</emphasis> <code>#</code> and set the value to <code>3750MB</code></para>
- </listitem>
- </itemizedlist>
- <para>Now, save the file and exit.</para>
- </section>
- <section>
- <title>Restart PostgreSQL</title>
- <para>For the changes made in the previous section to take effect, you need to restart the PostgreSQL server. You can do that by invoking the following command:</para>
- <screen>sudo /etc/init.d/postgresql restart</screen>
- </section>
- </section>
- </section>
- <section>
- <title>Installing pgAdmin</title>
- <section>
- <title>Create dhis2/databases folder</title>
- <para><emphasis role="bold">Tip:</emphasis></para>
- <para>A wise thing to do, might be to create a folder called <emphasis role="italic">dhis2/databases</emphasis> in your local home folder where the database backups can be stored. To do that, in the terminal, invoke the following two commands:</para>
- <screen>mkdir ~/dhis2
-mkdir ~/dhis2/databases</screen>
- <para><emphasis role="italic">Note: <code>~/</code> refers to the current user's home folder, i.e. <code>/home/yourusername/</code></emphasis></para>
- <para>Alternatively, you can navigate to your home folder from Places in the panel. In your home folder you can right-click to create a new folder</para>
- </section>
- <section>
- <title>Create a server connectionin pgAdmin</title>
- <para>Launch PgAdmin from the menu: <emphasis role="italic">Applications -> Programming -> pgAdmin III</emphasis> or from the terminal simply by invoking:</para>
- <screen>pgadmin3</screen>
- <para>To create a server connection, click the button with the plug:</para>
- <screenshot>
- <screeninfo>Click the button with the plug to create a server connection</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/PgAdmin-Add-Server.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Enter the credentials</para>
- <itemizedlist>
- <listitem>
- <para>Give the connection a name of your choice</para>
- </listitem>
- <listitem>
- <para>Host should be the ip address of the server (or localhost if you're running locally)</para>
- </listitem>
- <listitem>
- <para>Port is 5432 by default</para>
- </listitem>
- <listitem>
- <para>Let the Username be postgres, and</para>
- </listitem>
- <listitem>
- <para>provide the correct password</para>
- </listitem>
- <listitem>
- <para>You can choose whether or not to store the password.</para>
- <para><emphasis role="bold">(Note: The password will be saved in plain text. Avoid saving the password for an online server connection!)</emphasis></para>
- </listitem>
- </itemizedlist>
- <screenshot>
- <screeninfo>Enter the credentials for the server connection</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="50%" fileref="resources/images/dhis2_ubuntu_installation/PgAdmin_NewServerRegistration.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>If you have chosen to save your password, you will be prompted with this message:</para>
- <screenshot>
- <screeninfo>The warning message when you choose to save the password</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/PgAdmin-Guru Hint - Saving passwords.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </section>
- <section>
- <title>Restore a database from pgAdmin</title>
- <para>If you have a <emphasis role="italic">
- <emphasis role="underline">compressed</emphasis>
- </emphasis> backup-file created by pgAdmin, you can restore it in the similar way as you do in Microsoft Windows.</para>
- <para>Connect to your database by double-clicking the server and click the '+'-sign next to Databases. Right-click your database and choose Restore:</para>
- <screenshot>
- <screeninfo>The warning message when you choose to save the password</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="33%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-Restore.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>Then browse and find your backup file. When you find it, click Open, and then OK in the next window:</para>
- <screenshot>
- <screeninfo>Open your bakup file</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="33%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin_FindBackup.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Wait for a while until the restoration is finished.</para>
- <para><emphasis role="bold">Note:</emphasis>
-<itemizedlist>
- <listitem>
- <para><emphasis role="italic">
- <emphasis role="bold">PostgreSQL 8.4 CAN NOT restore compressed backup files from PostgreSQL 9!</emphasis>
- </emphasis></para>
- </listitem>
- </itemizedlist>
-</para>
- </section>
- <section>
- <title>Plain text-restoration</title>
- <para>If your backup file is in <emphasis role="italic">
- <emphasis role="underline">plain text</emphasis>
- </emphasis>, you can use either pgAdmin or the terminal to restore your database. With plain text it doesn't matter which version of PostgreSQL the backup file is made with.</para>
- <section>
- <title>Plain text-restoration with pgAdmin</title>
- <para>In pgAdmin, select your database and click the SQL button:</para>
- <screenshot>
- <screeninfo>Select your database and click the SQL button</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="33%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-SQL.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>Then click the open icon:</para>
- <screenshot>
- <screeninfo>SQL open icon</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="5%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-open.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>Now, choose your file and open it:</para>
- <screenshot>
- <screeninfo>Open your plain text backup file</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="75%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-file.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>When it's opened, click the leftmost green arrow to execute the query:</para>
- <screenshot>
- <screeninfo>Click the leftmost green arrow to execute the query</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="10%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-run.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>While the file is being executed, it will say "Query running" in the lower left corner:</para>
- <screenshot>
- <screeninfo>It will say "Query running" while the query is running</screeninfo>
- <mediaobject>
- <imageobject>
- <imagedata width="10%" fileref="resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-Query-running.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para/>
- <para>This might take some minutes, so please be patient. When it's finished, the text will say “OK.”.</para>
- <para>If the <emphasis role="italic"><emphasis role="underline">plain text</emphasis> backup</emphasis> file is somewhat big, pgAdmin might crash. But fear not, the restoration process can always be run from terminal. The next section will show you how.</para>
- </section>
- <section>
- <title>Plain text restoration from terminal</title>
- <para>The command for restoring a plain text backup file, is the following:</para>
- <screen>psql -d <database> -U <user> -f <file></screen>
- <para>For example:</para>
- <screen>psql -d dhis2 -U dhis -f ~/dhis2/databases/dhis2-backup.sql</screen>
- <para>Note that the full path of the backup file must be provided! (<code>~/</code> points to the current user's home folder)</para>
- </section>
- </section>
- </section>
- <section>
- <title>Installing Apache Tomcat</title>
- <para>To download Apache Tomcat, you can either do it from the terminal, or you can use your web browser to download the latest release from http://tomcat.apache.org/download-70.cgi. If you use your web browser, download the <emphasis role="italic">tar.gz</emphasis> file from the Core section. If you want to do it from terminal, invoke the following command <emphasis role="italic">(Note: it's <emphasis role="underline">one</emphasis> command, not two!</emphasis>):</para>
- <screen>wget http://apache.uib.no/tomcat/tomcat-7/v7.0.8/bin/apache-tomcat-7.0.8.tar.gz</screen>
- <para>If you downloaded the file from terminal, extract the file by invoking:</para>
- <screen>tar xvzf apache-tomcat-7.0.8.tar.gz</screen>
- <para>Else, if you used your web browser, and your file is stored in the Downloads folder under your home directory, you need to adjust for that in the previous comment, by adding the full path to the downloaded file:</para>
- <screen>tar xvzf ~/Downloads/apache-tomcat-7.0.8.tar.gz</screen>
- <para><emphasis role="italic">
- <emphasis role="underline">Note that you have to change the version number if you download a version different from 7.0.8!</emphasis>
- </emphasis></para>
- <para>After the files have been extracted, you can move the files to a folder of your choice. I choose <code>/usr/local/apache-tomcat-7.0.8</code>:</para>
- <screen>sudo mv apache-tomcat-7.0.8 /usr/local/apache-tomcat -7.0.8</screen>
- <para>If you want to delete the downloaded file, you can do that by invoking:</para>
- <screen>rm apache-tomcat-7.0.8.tar.gz</screen>
- <section>
- <title>Preparing Tomcat</title>
- <para>To prepare Tomcat for DHIS 2, we need to make some adjustments. Go to the Tomcat root folder by invoking:</para>
- <screen>cd /usr/local/apache-tomcat-7.0.8</screen>
- <para>We don't need anything else running than DHIS 2, so we can remove everything else from Tomcat's webapps folder:</para>
- <screen>rm -rf /webapps/*</screen>
- <para>Next, we want to create some environment variables that is used by Tomcat and DHIS 2. We're going to create a file called <emphasis role="italic">setenv.sh</emphasis>. If that file is placed in Tomcat's bin folder, it will be executed on startup. You can create the file by invoking:</para>
- <screen>gedit bin/setenv.sh</screen>
- <para>In this file, we want to define three environment variables. Add the following three lines to the file:</para>
- <screen>export JAVA_HOME=/usr/lib/jvm/java-6-sun
-export JAVA_OPTS=”-Xmx600m -XX:MaxPermSize=1000m”
-export DHIS2_HOME=/home/your-user-name/dhis2/DHIS2_HOME</screen>
- <para><emphasis role="italic">Note that you must insert the user name for the user that is going to run DHIS 2 in the last name. In the last line above, change <code>your-user-name</code> to the actual user name, for example <code>dhis</code></emphasis>.</para>
- <para><code>JAVA_HOME</code> will set the location of your Java Runtime Environment, <code>JAVA_OPTS</code> allocates memory to Tomcat, and <code>DHIS2_HOME</code> sets the location where the <emphasis role="italic">hibernate.properties</emphasis> file is stored (see section later on how to create this file and the <code>DHIS2_HOME</code> folder).</para>
- </section>
- <section>
- <title>Reverse proxying with Tomcat and Apache</title>
- <para>Tomcat should be run as a non-privileged user and the service will usually run on port 8080. If you want to run the DHIS 2 server on the nomal HTTP port (80), you will need to configure a reverse proxy using the Apache HTTPD server. First we need to install a few necessary programs. </para>
- <para><screen>sudo apt-get install apache2 libapache2-mod-proxy-html libapache2-mod-jk
-a2enmod proxy proxy_ajp proxy_connect</screen></para>
- <para>The first command will install the necessary Tomcat modules and the second command will make them active. </para>
- <para>Lets define an AJP connector which Apache HTTP server will use to connect to Tomcat with. The Tomcat server.xml file should be located in the /usr/local/apache-tomcat-7.0.8/conf/ directory. Be sure this line is uncommented.You can set the port to anything you like which is unused.</para>
- <para><screen><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-</screen>Now, we need to make the adjustments to the Apache HTTP server which will answer requests on port 80 and pass them to the Tomcat server through an AJP connector. Edit the file /etc/apache2/mods-enabled/proxy.conf so that it looks like the example below. Be sure that the port defined in the configuration file matches the one from Tomcat.</para>
- <para><screen><IfModule mod_proxy.c>
-ProxyPreserveHost On
-ProxyRequests Off
-ProxyPass /dhis ajp://localhost:8009/dhis
-ProxyPassReverse /dhis ajp://localhost:8009/dhis
-ProxyVia On
-<Location "/dhis">
- Order allow,deny
- Allow from all
-</Location>
-</IfModule>
-</screen></para>
- <para>You now can restart Tomcat and the Apache HTTPD server and your DHIS 2 instance should not be available on http://localhost/dhis. </para>
- </section>
- <section>
- <title>Implementing SSL encryption</title>
- <para>In certain deployments, data may need to be encrypted between the client and server. Using Apache and the reverse proxy setup described in the previous section, we can easily implement encrypted transfer of data between clients and the server over HTTPS. This section will describe how to use self-signed certificates, although the same procedure could be used if you have fully-signed certificates as well. </para>
- <para>First (as root), generate the necessary private key files and CSR (Certificate Signing Request) </para>
- <screen>mkdir /etc/apache2/ssl
-cd /etc/apache2/ssl
-openssl genrsa -des3 -out server.key 1024
-openssl req -new -key server.key -out server.csr</screen>
- <para>We need to remove the password from the key, otherwise Apache will not be able to use it. </para>
- <para><screen>cp server.key server.key.org
-openssl rsa -in server.key.org -out server.key</screen></para>
- <para>Next, generate a self-signed certificate which will be valid for one year.</para>
- <screen>openssl x509 -req -days 365 -in server.csr -signkey \ server.key -out server.crt</screen>
- <para>Now, lets configure Apache by enabling the SSL modules and creating a default site.</para>
- <screen>a2enmod ssl
-a2ensite default-ssl</screen>
- <para>Now, we need to edit the default-ssl (located at <filename>/etc/apache2/sites-enabled/default-ssl</filename>) file in order to enable the SSL transfer functionality of Apache. </para>
- <para><screen><VirtualHost *:443>
- ServerAdmin wemaster@xxxxxxxxxxxx
- SSLEngine On
- SSLCertificateFile /etc/apache2/ssl/server.crt
- SSLCertificateKeyFile /etc/apache2/ssl/server.key
-...</screen></para>
- <para>Be sure that the *:80 section of this file is changed to port *:443, which is the default SSL port. Also, be sure to change the ServerAdmin to the webmaster's email. </para>
- <para>Lastly, we need to be sure that the hostname is setup properly in /etc/hosts. Just under the "localhost" line, be sure to add the server's IP address and domain name. </para>
- <para><screen>127.0.0.1 localhost
-XXX.XX.XXX.XXX foo.mydomain.org</screen></para>
- <para>Now, just restart Apache and you should be able to view https://foo.mydomain.org/dhis. </para>
- <screen>/etc/init.d/apache2 restart</screen>
- </section>
- <section>
- <title>Reverse proxy with nginx</title>
- <para><ulink url="http://wiki.nginx.org">Nginx</ulink> is a high-performance web server and reverse proxy with built with high concurrency, performance and low-memory usage in mind. For more installations, <application>nginx </application>may be a better alternative than the Apache web server for reverse proxy implementations. </para>
- <para>To get started, simply install nginx on your system with the following command.</para>
- <para><screen>sudo apt-get install nginx</screen></para>
- <para>A sample configuration file is below, and should be placed in <filename>/etc/nginx/sites-available</filename>.</para>
- <para><screen>server {
- listen *:80;
- #This can be adjusted to allow larger upload file
- #sizes, e.g. DXF files.
- client_max_body_size 4M;
- client_body_buffer_size 128k;
- #This should be replaced with your DNS name.
- server_name dhis.foo.org;
-#Direct nginx access with these file types.
-location ~ \.(gif|jpg|png|css|js)$ {
-#This should be adjusted to the location of where the
-#dhis.war file is located.
-root /var/lib/tomcat6/webapps/;
-}
-
-location / {
- proxy_pass http://localhost:8080/;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- }
-}
-</screen></para>
- <para>You will need to adjust the <varname>server_name</varname>, and <varname>proxy_pass</varname> variables to suit your particular setup. The server name must match exactly the name of the server which will be running DHIS. In this particular setup, nginx will serve all static content and then redirect dynamic requests to the application server. Once you have adjusted the configuration file to suit your needs, be sure to activate it by creating a symbolic link in the <filename>/etc/nginx/sites-enabled </filename>directory which points to the file.</para>
- </section>
- <section>
- <title>Performance tuning</title>
- <para>To increase Tomcat's performance, you can install the native APR library by invoking:</para>
- <screen>sudo apt-get install libtcnative-1</screen>
- <para>To make use of this, you need to edit the <emphasis role="italic">setclasspath.sh</emphasis> file in Tomcat's bin folder. Open it by invoking:</para>
- <screen>gedit bin/setclasspath.sh</screen>
- <para>Scroll down to the bottom of the file, and add the following line at the <emphasis role="italic">
- <emphasis role="underline">bottom</emphasis>
- </emphasis>:</para>
- <screen>LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH</screen>
- <para>Then save and exit.</para>
- </section>
- </section>
- <section>
- <title>Prepare for startup</title>
- <para>This section will guide you through the last preparations you need to do before you can start using DHIS 2.</para>
- <section>
- <title>Creating the DHIS2_HOME folder</title>
- <para>If you want to use your own database, DHIS 2 needs an environment variable called <code>DHIS2_HOME</code>. If you have not set this, see the section <emphasis role="italic">Preparing Tomcat</emphasis> to learn how you set this. If you have followed this guide, the <code>DHIS2_HOME</code> environment variable points to the folder <code>/home/your-user-name/dhis2/DHIS2_HOME</code>. However, this folder has not yet been created, so you need to create the folder. From the terminal, invoke the following command to create that folder:</para>
- <screen>mkdir ~/dhis2/DHIS2_HOME</screen>
- </section>
- <section>
- <title>Download and prepare DHIS 2</title>
- <para>Download the latest built DHIS 2 .war file from http://dhis2.org/downloads</para>
- <para>The 'Download' folder (in which the downloaded files probably are store) can be found by navigating to</para>
- <itemizedlist>
- <listitem>
- <para>Places (on the menu bar) -> Downloads.</para>
- </listitem>
- </itemizedlist>
- <para>Copy the <emphasis role="italic">dhis.war</emphasis> file (Right-click on the file, and then click 'Copy'). Then go to the Tomcat webapps folder. The webapps folder can be found by navigating to:</para>
- <itemizedlist>
- <listitem>
- <para>Places (on the menu bar) -> File System -> usr -> local -> apache-tomcat-7.0.8 -> webapps</para>
- </listitem>
- </itemizedlist>
- <para>To paste the file in the folder, right-click on a white space within the folder and click 'Paste'.</para>
- </section>
- <section>
- <title>Create the hibernate.properties file</title>
- <para>To create the <emphasis role="italic">hibernate.properties</emphasis> file, invoke the following command from the terminal:</para>
- <screen>gedit ~/dhis2/DHIS2_HOME/hibernate.properties</screen>
- <para>In the empty file, paste the following lines and adjust database-name, user and password:</para>
- <screen>hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-hibernate.connection.driver_class = org.postgresql.Driver
-hibernate.connection.url = jdbc:postgresql:your-database-name
-hibernate.connection.username = your-database-user
-hibernate.connection.password = your-database-user-password
-hibernate.hbm2ddl.auto = update</screen>
- <para>Then save and exit.</para>
- </section>
- </section>
- <section>
- <title>Run DHIS 2</title>
- <section>
- <title>Start Tomcat</title>
- <para>To start DHIS 2, you first need to start Apache Tomcat. Invoke the following command from the terminal to start Tomcat:</para>
- <screen>sh /usr/local/apache-tomcat7.0.8/bin/startup.sh</screen>
- </section>
- <section>
- <title>Open DHIS 2</title>
- <para>To start using DHIS 2, open a web browser and navigate to http://localhost:8080/dhis</para>
- <para>The DHIS 2 team recommends Google's web browser Google Chrome for best experience with DHIS 2.
-You can download it from <ulink url="http://www.google.com/chrome">http://www.google.com/chrome</ulink> or by invoking the following command from the terminal:</para>
- <screen>sudo apt-get install google-chrome-stable</screen>
- </section>
- <section>
- <title>Stop Tomcat</title>
- <para>To stop Apache Tomcat from running, invoke the following command from the terminal:</para>
- <screen>sh /usr/local/apache-tomcat7.0.8/bin/shutdown.sh</screen>
- </section>
- </section>
- <section>
- <title>Useful scripts</title>
- <para>A script can be considered as a "shortcut" in Linux (or any other opreating systems). In a script file, we can write several commands, and by calling the script file, all these commands will be executed automatically.</para>
- <para>This section will teach you how to create some useful scripts to ease the startup and shutdown process.</para>
- <section>
- <title>DHIS 2 start and stop script</title>
- <para>First of all, it can be wise to create a folder in which we can store all the scripts. I've chosen the folder <code>~/dhis2/scripts</code>. To create this folder, from the terminal, invoke the following command:</para>
- <para><emphasis>Again, note that</emphasis> <code>~/</code><emphasis> points to your local home folder. The full address will be </emphasis><code>/home/your-user-name/dhis2/scripts</code><emphasis>. Ubuntu understands however the </emphasis><code>~/</code><emphasis> shortcut, so it's no problem to use it.</emphasis></para>
- <screen>mkdir ~/dhis2/scripts</screen>
- <para>Now we need to tell the system that we have scripts in this folder. We have to add the folder to the <code>PATH</code> environment variable. This can be done by editing the <emphasis role="italic">.bashrc</emphasis> file. Open it by invoking:</para>
- <screen>gedit .bashrc</screen>
- <para>At the <emphasis role="italic">
- <emphasis role="underline">bottom</emphasis>
- </emphasis> of the file, add the following line:</para>
- <screen>export PATH=~/dhis2/scripts:$PATH</screen>
- <para>Then save and exit.</para>
- <section>
- <title>The dhis script file</title>
- <para>To create the file, invoke:</para>
- <screen>gedit ~/dhis2/scripts/dhis</screen>
- <para>In the file, paste the following lines:</para>
- <screen>if [[ $# > 0 && $1 == 'start' ]]
-then
- sh /usr/local/apache-tomcat-7.0.8/bin/startup.sh
-elif [[ $# > 0 && 1 == 'stop' ]]
-then
- sh /usr/local/apache-tomcat-7.0.8/bin/startup.sh
- echo
- echo Please be patient while DHIS 2 is starting...
- sleep 1
- echo Point your web browser to http://localhost:8080/dhis
- echo
-else
- echo
- echo Wrong usage:
- echo You have to type dhis start or dhis stop
- echo
-fi</screen>
- <para><emphasis><emphasis role="bold">Note:</emphasis> If you have installed Apache Tomcat in a different location from what is given in the example, you will need to change the path both places it say </emphasis><code>/usr/local/apache-tomcat-7.0.8/</code><emphasis> in the example. Also, if your war file is not called </emphasis><code>dhis.war</code><emphasis>, but something different, adjust the URL </emphasis><code>http://localhost:8080/dhis</code><emphasis> correspondingly. Note that </emphasis><code>.war</code><emphasis> is not supposed to be in the URL.</emphasis></para>
- <para/>
- <para>What's left now, is to make the file executable. To do that, invoke the following two commands from the terminal:</para>
- <screen>cd ~/dhis2/scripts
-chmod +x dhis</screen>
- <para/>
- <para>Now your script is ready to being executed. From the terminal, you can invoke the following commands to start or stop DHIS 2:</para>
- <screen>dhis start
-dhis stop</screen>
- </section>
- </section>
- </section>
- <section>
- <title> Using Amazon Web services</title>
- <para>Amazon Web Services (AWS) offers virtual cloud-computing resources which allow developers and implementers to quickly scale an application, both horizontally and vertically, in a cost effective manner. AWS offers multiple operating systems and instance sizes depending on the exact nature of the deployment. This section will describe a basic setup with the AWS Elastic Cloud Compute (EC2) system using the Basic 32 bit Amazon AMI, which is based on the Red Hat Linux distribution. </para>
- <para>Estimating the cost of an AWS instance can be performed using the<ulink url="http://calculator.s3.amazonaws.com/calc5.html"> "Simple Monthly Cal culator"</ulink>. AWS costs are based entirely on usage. As your application usage grows, you can provision new servers. </para>
- <orderedlist>
- <listitem>
- <para>You will need an existing AWS account. If you do not have one, you can create one <ulink url="http://aws.amazon.com/">here</ulink>. Once you have created and enabled your account, login to the<ulink url="https://console.aws.amazon.com/s3/home"> AWS console</ulink>. </para>
- </listitem>
- <listitem>
- <para>Once you have logged in, select the "EC2" tab. You will need to select a region in which to instantiate your instance. Users in Europe and Africa, should probably use the EU West region, while users in Asia should probably use on of the Asia Pacific regions (either Singapore or Tokyo). Selection of the appropriate region will reduce latency between the server and clients.</para>
- </listitem>
- <listitem>
- <para>Click the "Instances" link on the right menu, and then the "Launch Instances" button. </para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="60%" align="center" fileref="resources/images/aws/create_instance.png"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- <para>Select one of the AMIs for your server. Using either of the Basic Amazon AMIs (either 32 or 64 bit) is recommended, but you can use whichever AMI is most appropriate. </para>
- </listitem>
- <listitem>
- <para>Next, you will need to select the size of your instance. The size of the instance selected will depend on the number of anticipated users. Selecting the "Micro" size, will enable you to test DHIS 2 in the AWS environment for a period of one year, at no cost if you use one of the "Free tier eligible" AMIs. </para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="60%" align="center" fileref="resources/images/aws/instance_size.png"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </listitem>
- <listitem>
- <para>Once you have selected the instance size, you can select a specific kernel ID and RAM disk ID. If you do not have a specific reason, just use the defaults and proceed to the next dialog. </para>
- </listitem>
- <listitem>
- <para>Next, you can add key-value pairs to help you to easily identify the instance. This is just metadata for your own usage. </para>
- </listitem>
- <listitem>
- <para>Next, you will need a key pair which will enable you to remotely access your instance. If you have an existing key pair you can use it, otherwise, you can create a new key pair. </para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="60%" align="center" fileref="resources/images/aws/create_key_pairs.png"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </listitem>
- <listitem>
- <para>You will need to assign a security group to the instance. Security groups can be used to expose certain services (SSH, HTTP, Tomcat, etc) to the Internet.With security groups, you can control which ports will be open to specific network ranges. For DHIS 2, you would normally need at least port 22 (SSH) and port 80 (HTTP) open to the internet or specific address ranges. </para>
- <screenshot>
- <mediaobject>
- <imageobject>
- <imagedata width="50%" align="center" fileref="resources/images/aws/security_groups.png"/>
- </imageobject>
- </mediaobject>
- </screenshot>
- </listitem>
- <listitem>
- <para>Finally, you can review and launch your instance. </para>
- </listitem>
- <listitem>
- <para>Once the instance, has been launched, you can connect via PuTTY or any other SSH client to the instance using the instance's Public DNS, which is listed on the EC2 control panel. You will need to install a few packages if you are using the Amazon default AMI.</para>
- <screen>yum install jdk.i586 postgresql-server.i686 apache-tomcat-apis.
-noarch tomcat-native.i686 httpd.i686</screen>
- </listitem>
- <listitem>
- <para>Once you have installed these packages, you can follow the instructions provided in the <link linkend="sec.install_postgres">previous section</link> on setting up a server. </para>
- </listitem>
- </orderedlist>
- </section>
-</chapter>
=== removed directory 'src/docbkx/en/resources/images/dhis2_ubuntu_installation'
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/CRS Comments - Google Chrome.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/CRS Comments - Google Chrome.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/CRS Comments - Google Chrome.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Continue-Yes.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Continue-Yes.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Continue-Yes.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Create-folder.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Create-folder.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Create-folder.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/JAVA_HOME.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/JAVA_HOME.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/JAVA_HOME.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Java-agreement.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Java-agreement.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Java-agreement.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Add-Server.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Add-Server.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Add-Server.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Guru Hint - Saving passwords.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Guru Hint - Saving passwords.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin-Guru Hint - Saving passwords.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin_NewServerRegistration.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin_NewServerRegistration.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/PgAdmin_NewServerRegistration.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Pg_hba.conf.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Pg_hba.conf.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Pg_hba.conf.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Places-Home.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Places-Home.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Places-Home.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/Postgresql.conf.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/Postgresql.conf.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/Postgresql.conf.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid (2).png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid (2).png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid (2).png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/change maverick to lucid.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/download java jdk.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/download java jdk.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/download java jdk.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit password.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit password.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit password.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_password-unix.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_password-unix.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_password-unix.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_sources.list.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_sources.list.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/edit_sources.list.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/export_CATALINA_OPTS.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/export_CATALINA_OPTS.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/export_CATALINA_OPTS.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/hibernate.properties.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/hibernate.properties.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/hibernate.properties.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-Restore.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-Restore.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-Restore.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-Query-running.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-Query-running.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-Query-running.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-file.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-file.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-file.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-open.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-open.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-open.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-run.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-run.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL-run.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin-SQL.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin_FindBackup.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin_FindBackup.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/pgAdmin_FindBackup.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/postgres.png'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/postgres.png 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/postgres.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'src/docbkx/en/resources/images/dhis2_ubuntu_installation/tab_key.jpg'
Binary files src/docbkx/en/resources/images/dhis2_ubuntu_installation/tab_key.jpg 2011-03-01 14:14:36 +0000 and src/docbkx/en/resources/images/dhis2_ubuntu_installation/tab_key.jpg 1970-01-01 00:00:00 +0000 differ