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
Blockquote
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)
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)
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)
<2>
<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/
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?
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.
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
I have the same problem and I was wondering if you could share what is the solution?
Below was the response when Tomcat started:
sopheary@dhis2:/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