A question about deploying my own Dhis2 in Mac

Hi everyone.

I met a challenge when I try to deploy my Dhis2 war package on my laptop, but it’s weird that I cannot access the localhost. I changed the dhis.war to root.war, but it doesn’t work, just 404 status. Had anyone met this problem before, looking for your answers.


  1. Can you run mac equivalent of the command ps -aef | grep tomcat and see tomcat running.

  2. Share dhis config file and catalina.out, let’s see what are the error it shows

Hi Jins,
These are my dhis config and catalina out, i used the way provided by this article :dhis2-core/CONTRIBUTING.md at master · dhis2/dhis2-core · GitHub. I changed the DHIS2_HOME in bash_profile in Mac

Hello @BoHou Thanks for the details.

Where have you placed dhis.conf? As per line : 119 in your log , your system is looking for the conf file at /opt/dhis2/dhis.conf

Can you place the dhis.conf at that location and restart tomcat?

Hi Jins,
I confirmed my DHIS_HOME environment and it works well, from this error we can know it cannot set environment variable so that home directory set to /opt/dhis2. In Mac. /opt/dhis2 need permission and its werid that it just contains another dhis2 direcotry (like a Matryoshka :slight_smile:

Great @BoHou so system is working fine for you now?

  1. May be you mistakenly create DHIS_HOME? Actually it should be DHIS2_HOME

  2. Can you change variable to DHIS2_HOME="your dir where conf file exist" and export and restart tomcat

Hi Jins
I checked my configuration and ensure i configure it correctly. But it doesn’t work well. Here is my configuration, from this picture we can see DHIS2_HOME is pointed to the right position.

Can you share the latest catalina.out file for further debugging

Hi Jins
This is my catalina.out file screen cut, and I also get the dhis.log which contains error message. I suppose this error means I need to configure my PostgreSQL. I put these errors too.

Hi @BoHou

Did you execute below command during installation ? It looks postgis configuration missing. Can you try this below command and restart again?

sudo -u postgres psql -c "create extension postgis;" dhis2

Note: Assuming your database name you have chose is dhis2, if not change the command accordingly

Hi Jins
I tried to user H2 database yesterday, now i am working on using postgresql. I will let you know if i meet new challange :slight_smile:

1 Like

Hi Jins
i think i am nearly archieved to deploy my own dhis2 instance. I just meet the error of out of the shared memory. Can you give me some advice, i had changed my max_lockers_per_transaction = 1024. Here are my dhis.log and postgresql.conf

Great going, I cannot tell the problem without looking catalina.out but i have a hint for you.

export JAVA_OPTS='-Xmx7500m -Xms4000m'

Change this variable according to your system configuration. If you have around 8GB ram for your machine, perhaps you can make this around for testing purpose and do a restart of tomcat

export JAVA_OPTS='-Xmx2500m -Xms2000m'

@BoHou for postgres configuration changes you can refer here

Hi Jins
I have finished my deployment and appreciate your help. I will do my research in this system.
Hope we can communicate in the further time.

1 Like

Great going @BoHou

And to answer your question, @Lars has now confirmed here H2 db is no more supported