# Unable to see DHIS2 login page from AWS EC2 Instance

**URL:** <https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169>\
**Category:** Support - Assistance technique\
**Tags:** tomcat, dhis2, postgres\
**Created:** [27 July 2023 11:14 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169 "2023-07-27T11:14:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [27 July 2023 11:14 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/1 "2023-07-27T11:14:10Z")

</div>

Hello All,

I’m trying to deploy DHIS2 in a AWS EC2 instance. I have completed each and every step mentioned in the official documentation. But when go to [http://mypublicip:8080](http://mypublicip:8080), I’m getting the 404 error. I have given all of my configuration files below. Any help is highly appreciated!

 ![Screenshot 2023-07-27 164519](https://dhis2.b-cdn.net/uploads/default/original/3X/2/c/2c2bf8b4b6a0d83461d93c70c262e04674e7bcc1.png)

My environment:  
OS: Ubuntu 22.04 LTS  
PostgreSQL 15  
Tomcat9  
Java: OpenJDK 11  
DHIS2 Version: 2.36

config files:

1. dhis.conf (/home/dhis/config/)

# Hibernate SQL dialect

connection.dialect = org.hibernate.dialect.PostgreSQLDialect

# 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 = xxxx

# Database schema behavior, can be validate, update, create, create-drop

connection.schema = update

# Encryption password (sensitive)

encryption.password = xxxx

1. Startup file: (/home/dhis/tomcat-dhis/bin)  
#!/bin/sh  
set -e  
if [“$(id -u)” -eq “0”]; then  
echo “This script must NOT be run as root” 1\>&2  
exit 1  
fi  
export CATALINA\_BASE=“/home/dhis/tomcat-dhis”  
/usr/share/tomcat9/bin/startup.sh  
echo “yes, Tomcat started”

2. Setenv.sh (/home/dhis/tomcat-dhis/bin)  
#!/bin/sh

# 

CATALINA\_HOME=/usr/share/tomcat9

# Find the Java runtime and set JAVA\_HOME

. /usr/libexec/tomcat9/tomcat-locate-java.sh

# Default Java options

if [-z “$JAVA\_OPTS”]; then  
JAVA\_OPTS=“-Djava.awt.headless=true”  
fi  
JAVA\_HOME=‘/usr/lib/jvm/java-11-openjdk-amd64/’  
JAVA\_OPTS=‘-Xms4000m -Xmx7000m’  
DHIS2\_HOME=‘/home/dhis/config’

This is what i get when i start tomcat:

 ![image](https://dhis2.b-cdn.net/uploads/default/original/3X/6/2/62ca5fcac1e4ed5d6334a3804493268e7e6c9005.png)

I am happy to provide any more information that is required here 🙂

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [28 July 2023 03:46 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/2 "2023-07-28T03:46:57Z")

</div>

@Gassim : Please see if you can help me here.

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [28 July 2023 06:55 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/3 "2023-07-28T06:55:49Z")

</div>

![Screenshot 2023-07-28 122253](https://dhis2.b-cdn.net/uploads/default/original/3X/b/2/b2d5c5ee73f33119bc940d8df285008811314e44.png)  
I can see my ROOT.war file got deployed without any errors. Someone please help here.  
@julhas : I see you are an expert in this. I went through your blogs as well. Please see if you can help me here.

---

<div class="post-metadata">

**Author:** ![e4eDHIS2](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/e/bc79bd/32.png) [@e4eDHIS2](https://community.dhis2.org/u/e4eDHIS2)\
**Post date:** [28 July 2023 09:39 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/4 "2023-07-28T09:39:27Z")

</div>

Hi @amalg  
Can you use the cat command to show the full logs or at least 500 lines above this

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [28 July 2023 09:47 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/5 "2023-07-28T09:47:56Z")

</div>

Hello @e4eDHIS2 , thanks for the response. Please find the catalina.out below:

```auto
gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
<6>Initializing ProtocolHandler ["http-nio-8080"]
<6>Server initialization in [540] milliseconds
<6>Starting service [Catalina]
<6>Starting Servlet engine: [Apache Tomcat/9.0.58 (Ubuntu)]
<6>Deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
<6>An expanded directory [/home/dhis/tomcat-dhis/webapps/ROOT] was found with a last modified time that did not match the associated WAR. It will be deleted.
<6>At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
* INFO 2023-07-28T12:47:33,593 System property dhis2.home not set (LogOnceLogger.java [main])
* INFO 2023-07-28T12:47:33,603 Environment variable DHIS2_HOME not set (LogOnceLogger.java [main])
* INFO 2023-07-28T12:47:33,604 Directory /opt/dhis2 cannot be created (LogOnceLogger.java [main])
<2>Error deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
<2>java.lang.IllegalStateException: Error starting child
<2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
<2> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
<2> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
<2> at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
<2> at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
<2> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
<2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
<2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
<2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
<2> at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
<2> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
<2> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
<2> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
<2> at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
<2> at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
<2> at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
<2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
<2> at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
<2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
<2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
<2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
<2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
<2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
<2> at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
<2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<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:345)
<2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
<2>Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
<2> at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
<2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
<2> ... 37 more
<2>Caused by: java.lang.IllegalStateException: Properties could not be loaded
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:322)
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.init(DefaultDhisConfigurationProvider.java:110)
<2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.getConfig(DhisWebApiWebAppInitializer.java:121)
<2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.onStartup(DhisWebApiWebAppInitializer.java:63)
<2> at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
<2> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> ... 38 more
<2>Caused by: org.hisp.dhis.external.location.LocationManagerException: External directory not set
<2> at org.hisp.dhis.external.location.DefaultLocationManager.buildDirectory(DefaultLocationManager.java:243)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getFileForReading(DefaultLocationManager.java:173)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:146)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:139)
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:311)
<2> ... 44 more
<2>
<6>Deployment of web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war] has finished in [19,608] ms
<6>Starting ProtocolHandler ["http-nio-8080"]
<6>Server startup in [19723] milliseconds
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
<6>Server version name: Apache Tomcat/9.0.58 (Ubuntu)
<6>Server built: Jan 6 1970 15:09:28 UTC
<6>Server version number: 9.0.58.0
<6>OS Name: Linux
<6>OS Version: 5.19.0-1029-aws
<6>Architecture: amd64
<6>Java Home: /usr/lib/jvm/java-11-openjdk-amd64
<6>JVM Version: 11.0.19+7-post-Ubuntu-0ubuntu122.04.1
<6>JVM Vendor: Ubuntu
<6>CATALINA_BASE: /home/dhis/tomcat-dhis
<6>CATALINA_HOME: /usr/share/tomcat9
<6>Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
<6>Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
<6>Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
<6>Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
<6>Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
<6>Command line argument: -Djava.util.logging.config.file=/home/dhis/tomcat-dhis/conf/logging.properties
<6>Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
<6>Command line argument: -Xms4000m
<6>Command line argument: -Xmx7000m
<6>Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
<6>Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
<6>Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
<6>Command line argument: -Dignore.endorsed.dirs=
<6>Command line argument: -Dcatalina.base=/home/dhis/tomcat-dhis
<6>Command line argument: -Dcatalina.home=/usr/share/tomcat9
<6>Command line argument: -Djava.io.tmpdir=/home/dhis/tomcat-dhis/temp
<6>The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
<6>Initializing ProtocolHandler ["http-nio-8080"]
<2>Failed to initialize component [Connector[HTTP/1.1-8080]]
<2>org.apache.catalina.LifecycleException: Protocol handler initialization failed
<2> at org.apache.catalina.connector.Connector.initInternal(Connector.java:1049)
<2> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
<2> at org.apache.catalina.core.StandardService.initInternal(StandardService.java:556)
<2> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
<2> at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1042)
<2> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
<2> at org.apache.catalina.startup.Catalina.load(Catalina.java:724)
<2> at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
<2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<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.load(Bootstrap.java:305)
<2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
<2>Caused by: java.net.BindException: Address already in use
<2> at java.base/sun.nio.ch.Net.bind0(Native Method)
<2> at java.base/sun.nio.ch.Net.bind(Net.java:459)
<2> at java.base/sun.nio.ch.Net.bind(Net.java:448)
<2> at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
<2> at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:273)
<2> at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:228)
<2> at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1213)
<2> at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1226)
<2> at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
<2> at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
<2> at org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
<2> ... 13 more
<2>
<6>Server initialization in [535] milliseconds
<6>Starting service [Catalina]
<6>Starting Servlet engine: [Apache Tomcat/9.0.58 (Ubuntu)]
<6>Deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
<6>At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
* INFO 2023-07-28T13:37:03,360 System property dhis2.home not set (LogOnceLogger.java [main])
* INFO 2023-07-28T13:37:03,370 Environment variable DHIS2_HOME not set (LogOnceLogger.java [main])
* INFO 2023-07-28T13:37:03,371 Directory /opt/dhis2 cannot be created (LogOnceLogger.java [main])
<2>Error deploying web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war]
<2>java.lang.IllegalStateException: Error starting child
<2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
<2> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
<2> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
<2> at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
<2> at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
<2> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
<2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
<2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
<2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
<2> at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
<2> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
<2> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
<2> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
<2> at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
<2> at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
<2> at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
<2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
<2> at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
<2> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
<2> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
<2> at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
<2> at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
<2> at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
<2> at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
<2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<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:345)
<2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
<2>Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
<2> at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
<2> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
<2> ... 37 more
<2>Caused by: java.lang.IllegalStateException: Properties could not be loaded
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:322)
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.init(DefaultDhisConfigurationProvider.java:110)
<2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.getConfig(DhisWebApiWebAppInitializer.java:121)
<2> at org.hisp.dhis.webapi.servlet.DhisWebApiWebAppInitializer.onStartup(DhisWebApiWebAppInitializer.java:63)
<2> at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
<2> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
<2> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
<2> ... 38 more
<2>Caused by: org.hisp.dhis.external.location.LocationManagerException: External directory not set
<2> at org.hisp.dhis.external.location.DefaultLocationManager.buildDirectory(DefaultLocationManager.java:243)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getFileForReading(DefaultLocationManager.java:173)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:146)
<2> at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:139)
<2> at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:311)
<2> ... 44 more
<2>
<6>Deployment of web application archive [/home/dhis/tomcat-dhis/webapps/ROOT.war] has finished in [13,657] ms
<6>Server startup in [13748] milliseconds
<2>Failed to create server shutdown socket on address [localhost] and port [8005] (base port [8005] and offset [0])
<2>java.net.BindException: Address already in use (Bind failed)
<2> at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
<2> at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:452)
<2> at java.base/java.net.ServerSocket.bind(ServerSocket.java:395)
<2> at java.base/java.net.ServerSocket.<init>(ServerSocket.java:257)
<2> at org.apache.catalina.core.StandardServer.await(StandardServer.java:577)
<2> at org.apache.catalina.startup.Catalina.await(Catalina.java:864)
<2> at org.apache.catalina.startup.Catalina.start(Catalina.java:810)
<2> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<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:345)
<2> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
<2>
<6>Pausing ProtocolHandler ["http-nio-8080"]
<6>Stopping service [Catalina]
<6>Stopping ProtocolHandler ["http-nio-8080"]
<6>Destroying ProtocolHandler ["http-nio-8080"]
<4>Failed to clear soft references from ObjectStreamClass$Caches for web application [ROOT]
<4>java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader 'bootstrap')
<4> at org.apache.catalina.loader.WebappClassLoaderBase.clearCache(WebappClassLoaderBase.java:2325)
<4> at org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches(WebappClassLoaderBase.java:2300)
<4> at org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:1669)
<4> at org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:1597)
<4> at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:463)
<4> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
<4> at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5515)
<4> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
<4> at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:293)
<4> at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:826)
<4> at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1033)
<4> at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:321)
<4> at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:826)
<4> at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1033)
<4> at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:321)
<4> at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:579)
<4> at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:321)
<4> at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:1050)
<4> at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:321)
<4> at org.apache.catalina.startup.Catalina.stop(Catalina.java:850)
<4> at org.apache.catalina.startup.Catalina.start(Catalina.java:811)
<4> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<4> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
<4> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
<4> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
<4> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
<4> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:480)
<4>
<6>Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
<6>java.lang.IllegalArgumentException: Invalid character found in method name [h+/tmp/gpon8080&ipv=0...]. HTTP method names must be tokens
<6> at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:419)
<6> at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271)
<6> at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
<6> at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
<6> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1735)
<6> at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
<6> at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
<6> at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
<6> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
<6> at java.base/java.lang.Thread.run(Thread.java:829)
<6>

```

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [28 July 2023 09:50 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/6 "2023-07-28T09:50:15Z")

</div>

@e4eDHIS2 :Please not that recently I was trying out with multiple versions of DHIS2 to see which one works. So some of the error can be because of that.

---

<div class="post-metadata">

**Author:** ![e4eDHIS2](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/e/bc79bd/32.png) [@e4eDHIS2](https://community.dhis2.org/u/e4eDHIS2)\
**Post date:** [28 July 2023 09:53 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/7 "2023-07-28T09:53:41Z")

</div>

@amalg what’s your database name (not username)? Also, did you drop the database before deploying the new versions?

---

<div class="post-metadata">

**Author:** ![julhas](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/julhas/32/49845_2.png) [@julhas](https://community.dhis2.org/u/julhas)\
**Post date:** [30 July 2023 01:18 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/8 "2023-07-30T01:18:28Z")

</div>

Hi @amalg,

Can you go through the steps again from here?

> **[DHIS2 installation on Ubuntu 20.04 LTS – AWS](https://jaetech.co/dhis2-installation-on-ubuntu-20-04-aws/)**
>
> We create new and innovative solutions and engage in investigative research.

Thank you  
Julhas

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [31 July 2023 07:20 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/9 "2023-07-31T07:20:08Z")

</div>

Hello @julhas ,

Thank you so much for your help. It did worked out at the end. Just out of my curiosity, what changes do you think worked out for me? I’m only able to see these changes from my previous installations:

1.Ubuntu 20.04 LTS instead of 22.04 LTS  
2.Tomcat instance was in /var/www instead of /home/dhis  
3. Tomcat: 9, PostgreSQL 12, Java 11 (OpenJDK 11) and DHIS 2.37

---

<div class="post-metadata">

**Author:** ![julhas](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/julhas/32/49845_2.png) [@julhas](https://community.dhis2.org/u/julhas)\
**Post date:** [31 July 2023 07:56 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/10 "2023-07-31T07:56:29Z")

</div>

Hello @amalg,

I’m happy to hear that it went smoothly. I believe there was a problem with the DHIS2 version.

Please contact me at [info@jaetech.co](mailto:info@jaetech.co) if you require any assistance with the implementation of your project, including any external dashboard visualizations or DHIS2 custom web application development.

Julhas

---

<div class="post-metadata">

**Author:** ![amalg](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/ed655f/32.png) [@amalg](https://community.dhis2.org/u/amalg)\
**Post date:** [31 July 2023 10:12 UTC](https://community.dhis2.org/t/unable-to-see-dhis2-login-page-from-aws-ec2-instance/54169/11 "2023-07-31T10:12:46Z")

</div>

Hello @julhas,

Thanks for your support. I’ll definitely get in touch with you for any support. I have sent a LinkedIn invitation to you. If you are okay with it, we can connect over there.
