HTTP 404 - Not Found

I’m new to DHIS2 and trying to install DHIS2 in Windows environments for the first time. I keep getting these error messages: “HTTP 404 – Not Found. Message: The requested resource [/dhis/] is 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.” The software versions I’m using are dhis2-stable-2.34.1.war; apache-tomcat-9.0.37.exe; jdk-8u261-windows-x64.exe; postgresql-12.3-2-windows-x64.exe. I followed these instructions http://dhis-2.blogspot.com/2015/06/dhis2-local-installation-guide-for.html (July 2020) multiple times to make sure it wasn’t user error.

During the Tomcat installation on the Windows 10 system I received the following error messages: “SQL State: 53200; Error Code: 0; Message: ERROR: out of shared memory” multiple times and then at the end “One or more listeners failed to start.” The system is pretty small with only 4 GB memory and an Intel Atom Z8700 CPU. Is my windows 10 system too small?

I also tried to install the same software on a Windows 7 system. Tomcat installed without error messages, but I eventually receive the same HTTP 404 error message when trying to access DHIS2. The only hint I could find was Mohamed Bangura’s request in August 2015, which was solved. However, Mohamed installed DHIS on an ubuntu desktop. How would a solution for Windows 10 or Windows 7 look like? What would I have to do to fix this?

Hi there,

You should look at “logs” folder under your tomcat installation. One of these files will exactly reports any errors that occurred in your installation.

*If you face " ERROR: out of shared memory; HINT: You might need to increase max_locks_per_transaction " error, uncomment #max_locks_per_transaction in …/data/postgresql.conf and set it as max_locks_per_transaction = 1024, restart PostgreSQL service and run Tomcat7.exe again.

1 Like

@Kenyuri is right. This more recent requirement is unfortunately not included in the guide, but is mentioned in a separate topic: http://dhis2trainingland.com/eportal/?tutorial=dhis2-404-not-found-error

And also mentioned in the Ubuntu version of the blog:

as well as in the DHIS2 manual:
https://docs.dhis2.org/2.33/en/dhis2_system_administration_guide/installation.html#postgresql-performance-tuning

1 Like

Thank you so much, Murod, Raphael and Knut. I very much appreciate your support.
I found the error messages to be not always helpful. I went down a rabbit hole based on the message that the dhis.conf file could not be found, even though I checked the file attributes and set the systems variable for it so many times in all variations imaginable, starting with the one in the setup guide. It didn’t make a difference.
I did set the transaction to 1024, Raphael, and followed the further instructions in the link you sent, Knut, but I still get the same 404 not found message when trying to access dhis2. I had high hopes the JRE_HOME setting would do the trick, since this one was new to me, but that didn’t work either. Is there perhaps another setting that might help? Or another help page?

Again, thank you all. I haven’t even started dhis2 yet, but I already love the community.

P.S. Later entries in the log file showed that the dhis.conf file is eventually found.

@JWSchaefer Kindly share your dhis.conf file.

I used the following settings on my dhis2 instance on windows and it worked
Kindly navigate to C:\Program Files\PostgreSQL\12\data\postgresql.conf
Set the max_connections = 1000 , max_lock_per_transaction = 1024 .


If you encounter any problem kindly contact me on skype live:raphaelkenyuri so that I can assist where necessary.

Thank you for your reply, Raphael. I appreciate it.
The content of the file is from the installation guide. I stored it as dhis.conf (NOT .config) in the DHIS2 base folder on c drive.
Content:

connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver
connection.url = jdbc:postgresql:dhis2
connection.username = dhis
connection.password = dhis
connection.schema = update
encryption.password = abcd

Thank you for sharing your postgresql.conf file. I increased the max-connections from 100 to 1000 as suggested. I had already set max_locks_per_transaction to 1024. I also restarted pgAdmin4. The error message when accessing http://localhost:8080/dhis/ is unfortunately still the same.

Kindly try cross checking on everything using the guide on this link http://dhis2trainingland.com/eportal/?tutorial=dhis2-installation-on-windows-local-server

1 Like

Hi Johannes,
For myself (DHIS2 v2.33.5, Win10, Tomcat v9, PostgreSQL v12) I have to leave the command-line window open after executing the ‘startup.bat’ file in the Tomcat …\bin folder (e.g. after it displays the ‘INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [157,311] milliseconds’ message) then it works ok accessing http://localhost:8080/dhis/, otherwise it doesn’t if I close it.
See if this works for you… I had some difficulty finding this out over the many times I’ve tried to install DHIS2 to Windows :slight_smile:

Hi Damien,

Thank you so much for your advise. I tried it on the Windows 7 and the Windows 10 system, and unfortunately, at least in my case, leaving the tomcat9.exe window open doesn’t make a difference. Worth a try though, so thank you again.

Best

Johannes

Hi @JWSchaefer did you ever resolve your issue? I’ve been having the same issue for two. months and a half now and the only way I’ve been able to make progress with a local installation of DHIS is to run an ubuntu vm but windows not yet…

@lillian1n2 Please see if the posts here might help you:

If you couldn’t find the solution, I’d recommend sharing details of what the issue is so that the sypport team can help you.

You could also try this if it’s helpful … it’s definitely working:

Hi! Yes I followed the guides available in many of the posts but wasn’t successful. The main issue was the last step where after I run apache, I get the 404 error when loading on the browser and I’d also notice that the tables wouldn’t appear under pgAdmin.

When running Apache, deployment a first completes without any error, up until the server startup message.

I was running the installation on Windows 10
PostgreSQL 13
JRE 8 and JDK 11
Apache 10.
DHIS 2.35.2 and 3 but also tried .34 and .33 i think

Actually, I tried installation on a different machine this week and was able to get a local instance running after numerous attempts and troubleshooting following the recommended installations guides,

The machine is running Windows 10.
PostgreSQL 12
JRE 8 (32.bit)
JDK 11
Apache 9 (32 bit)
DHIS 2.36.0

So notice that it was only this combination found through trial and error that led to a successful installation.