I am not able to install DHIS2 properly in UBuntu 20.04

As I have followed the process of installing the DHIS2 2.38 in ubuntu 20.04 using the guideline available here Installation - DHIS2 Documentation

But unfortunately, stuck at the stage of http:\localhost:8080

it shows the error 404

HTTP Status 404 – Not Found

Type Status Report

Message Not found

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.31 (Ubuntu)

Kindly help me to solve the problem i am facing.

Welcome to the community!

Did you try http:\localhost:8080/dhis/ ? Please check the dhis.conf file

Okay thanks! What is the JDK version you are using? I think you should be using 11.

Would you share the Catalina.out and dhis.log (without the sensitive info)? Also please share the configuration settings for the dhis.conf file (without the sensitive info)

Thank you for your reply,

Both http://localhost:8080 & http://localhost:8080/dhis not working for me.

JDK version.

openjdk version “11.0.15” 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)

Catalina Log is as below,

<2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
<2> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
<2> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
<2> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
<2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
<6>Pausing ProtocolHandler [“http-nio-8080”]
<6>Stopping service [Catalina]
<6>Stopping ProtocolHandler [“http-nio-8080”]
<6>Destroying ProtocolHandler [“http-nio-8080”]

Config file as below

> # ----------------------------------------------------------------------
> # Database connection
> # ----------------------------------------------------------------------
> # JDBC driver class
> connection.driver_class = org.postgresql.Driver
> # Database connection URL
> connection.url = jdbc:postgresql:dhis2
> # Database username
> connection.username = dhis
> # Database password
> connection.password = password
> # ----------------------------------------------------------------------
> # Server
> # ----------------------------------------------------------------------
> # Enable secure settings if deployed on HTTPS, default 'off', can be 'on'
> # server.https = on
> # Server base URL
> # server.base.url = https://server.com/

Thank you for your patience!

From the log it seems that Tomcat Catalina is not starting properly. It could be that port 8080 is used or that there’s an issue with the Java environment variables.

Have you checked the environment variables? When you use the command set do you see the environment variables: JAVA_HOME, JAVA_OPTS, DHIS2_HOME?

Additionally, would you change the port number in the conf/server.xml to something other than 8080 such as to 8182?

<Connector port="8182" protocol="HTTP/1.1"
  relaxedQueryChars="[]" />

After changing when connecting you will use: http:\localhost:8182.

I hope this works and if it does please mark this post as a solution, if not then we might need to search through the environment and settings to make sure everything is set properly.


Thank you for your response,

I tested in java with the test file created and replaced in the same place as ROOT.war.

It is working properly directly opening the http://localhost:8080

I am also inform you regarding the port change.

1 Like

You’re welcome!

If it’s working then there’s no need to change the port number. :slight_smile:

During initiation following variables were defined.

home/dhis$ sudo -u dhis tomcat-dhis/bin/startup.sh
Using CATALINA_BASE: /home/dhis/tomcat-dhis
Using CATALINA_HOME: /usr/share/tomcat9
Using CATALINA_TMPDIR: /home/dhis/tomcat-dhis/temp
Using JRE_HOME: /usr/lib/jvm/java-11-openjdk-amd64/
Using CLASSPATH: /usr/share/tomcat9/bin/bootstrap.jar:/usr/share/tomcat9/bin/tomcat-juli.jar
Tomcat started.
Tomcat started

Kindly suggest some resolutions for the error we are facing during installation

May I ask what’s working directly? Could you take a screenshot please, thanks!