Installing two dhis2 instances on same server

I did a PR that was accepted so on 2.38 you will be able to define the DHIS2_HOME in the tomcat “context”

Solution inspired from How can I specify system properties in Tomcat configuration on startup? - Stack Overflow

Example of context file to put on TOMCAT_HOME/conf/Catalina/localhost/[warname].xml when using Catalina engine and no specific host configured

<Context>

  <Environment name="dhis2-home" value="/home/dhis/config-2"
         type="java.lang.String" override="false"/>

</Context>

I tested the solution, DHIS2 detect the right value

3 Likes