Multiple instances on a server

Thanks Jason, This will definitely help.


----- Original Message -----
From: "Jason Pickering" <>
To: "Dapo Adejumo" <>
Sent: Wednesday, 22 February, 2012 6:15:55 AM
Subject: Re: [Dhis2-devs] Multiple instances on a server

Hi Dapo,

I know of two ways to do this, and suspect there may be others.

A) This method will utilize a single Tomcat container, with multiple
DHIS2 instances.
0) Create two copies of the dhis.war file...dhis.war and dhis_XX,war
for instance. Unzip the war file into these directories.
1) Using the tool "mc" navigate to
/webapps/dhis_XX/WEB-INF/lib/dhis-support-external.2.X.jar where X is
the version number.
2) Open up the JAR file with mc and navigate to
META-INF/dhis/beans.xml and modify DHIS2_HOME to DHIS2_HOME_XX where
XX can be anything really.
3) You need to setup an environment variable in your system for
DHIS2_HOME_XX (i.e. /usr/local/etc/dhis2_XX/)
4) Create a hibernate properties file in DHIS2_HOME_XX.
5) Start Tomcat. You will now have two separate DHIS instance running
which are controlled by two separate environment variables

The disadvantage here is that you have to modify this file each time
you upgrade DHIS.

B) Two separate Tomcat instances. This is the method I prefer.
0) Create two separate tomcat instances...for instance
/usr/local/tomcat1 and /usr/local/tomcat2
1) You will need to modify the server.xml file of one of the instances
(e.g tomcat2) to startup on a different port that /tomcat1. How you do
this depends a bit on the types of connectors you may be using
(HTTP,AJP, etc) but this is well documented elsewhere about how to
modify the ports Tomcat runs on.
2) Create a file in each /bin directory of the tomcat directories
called (Linux) or setenv.bat (Windows) and define the
DHIS2_HOME directory to point to two separate locations. Create two
separate files.
3) You will now have two separate instance running on the ports which
you have defined in the respective server.xml files.

Hope this helps.

Best regards,

On Tue, Feb 21, 2012 at 5:23 PM, Dapo Adejumo <> wrote:

Please does anyone have any ideas on how to deploy multiple instances on a
single server in an efficient manner which doesn't drain server resources
dramatically.....Thinking of Deploying multiple instances of Tomcat VS
Multiple war files in the same Tomcat.

Thank you.



Adedapo Adejumo.
Mobile : +2348033683677
Skype : dapojorge

Mailing list:
Post to :
Unsubscribe :
More help :