# Login error

**URL:** <https://community.dhis2.org/t/login-error/43769>\
**Category:** Support - Assistance technique\
**Created:** [29 July 2021 06:54 UTC](https://community.dhis2.org/t/login-error/43769 "2021-07-29T06:54:54Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [29 July 2021 06:54 UTC](https://community.dhis2.org/t/login-error/43769/1 "2021-07-29T06:54:54Z")

</div>

Dear All, i have installed DHIS2 instance, in ubuntu version 20.04 lts, dhis2 version 2.34  
after running tomcat i get the login image but i am unable to login

 ![Screenshot from 2021-07-29 09-52-32](https://dhis2.b-cdn.net/uploads/default/original/3X/2/6/269c7e962772a4da2e16221801f1c3f115c21592.png)  
i used the below credentials  
username: admin  
password: district

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [29 July 2021 06:56 UTC](https://community.dhis2.org/t/login-error/43769/2 "2021-07-29T06:56:42Z")

</div>

@Gassim please help

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [29 July 2021 12:40 UTC](https://community.dhis2.org/t/login-error/43769/3 "2021-07-29T12:40:39Z")

</div>

Hi @Janise  
Do you get any error message after entering the login credentials? Thank you!

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [30 July 2021 05:05 UTC](https://community.dhis2.org/t/login-error/43769/4 "2021-07-30T05:05:23Z")

</div>

i dont get any error message

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [30 July 2021 17:38 UTC](https://community.dhis2.org/t/login-error/43769/5 "2021-07-30T17:38:49Z")

</div>

Oh, then you might be facing the same issue as another user in this topic: [Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716)

Instead of merging the two topics, I will keep this topic so that if it’s a different cause, we’ll have a different solution, right? But I’ll ask you the same questions:

> [@Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716/7):
>
> @lordmaul are there any errors in the server log?

> [@Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716/9):
>
> so we asked Morten Svanæs @netroms:
> 
> > Not sure what’s going on here. Maybe he gets redirected back to the login page or something.  
> > A couple of things to try:
> > 
> > 1. After login with user/pass, ask user to try enter another page url in manually and see if the user is able to access it.
> > 2. Try HTTP basic auth on an api url and see if that succeeds.

> [@Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716/7):
>
> @lordmaul are there any errors in the server log?

> [@Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716/9):
>
> so we asked Morten Svanæs @netroms:
> 
> > Not sure what’s going on here. Maybe he gets redirected back to the login page or something.  
> > A couple of things to try:
> > 
> > 1. After login with user/pass, ask user to try enter another page url in manually and see if the user is able to access it.
> > 2. Try HTTP basic auth on an api url and see if that succeeds.

> [@Can't login with no error messages](https://community.dhis2.org/t/cant-login-with-no-error-messages/43716/7):
>
> @lordmaul are there any errors in the server log?

At this moment, @netroms suggests downloading a fresh copy of the versions of the server you are running (2.33.8) from the DHIS2 binary archives, and try to use this new instance against your existing database. Preferably on a “fresh” machine. Please let me know if this works, but do send the error log before trying this just in case if there’s a different approach.

Thank you @Janise!

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [3 August 2021 11:53 UTC](https://community.dhis2.org/t/login-error/43769/9 "2021-08-03T11:53:27Z")

</div>

This is what i get.

 ![post](https://dhis2.b-cdn.net/uploads/default/original/3X/5/7/5709b5cbb2587153d8abccb37cead24fbb2f226d.png)  
 ![mobile](https://dhis2.b-cdn.net/uploads/default/original/3X/d/2/d274bfa6d1471851bbef5636374bf405dfe3172c.png)

 ![lognew2](https://dhis2.b-cdn.net/uploads/default/original/3X/1/3/139619e4e623787747eea36a0ae6a13aea086695.png)  
 ![lognew1](https://dhis2.b-cdn.net/uploads/default/original/3X/8/a/8aa9880cbb5b23187a5e2115c63487ced7976174.png)

nginx/sites-available /default

## 

# You should look at the following URL’s in order to grasp a solid understanding

# of Nginx configuration files in order to fully unleash the power of Nginx.

# [NGINX Documentation](https://www.nginx.com/resources/wiki/start/)

# [NGINX Documentation](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/)

# [Nginx/DirectoryStructure - Debian Wiki](https://wiki.debian.org/Nginx/DirectoryStructure)

# 

# In most cases, administrators will remove this file from sites-enabled/ and

# leave it as reference inside of sites-available where it will continue to be

# updated by the nginx packaging team.

# 

# This file will automatically load configuration files provided by other

# applications, such as Drupal or Wordpress. These applications will be made

# available underneath a path with that package name, such as /drupal8.

# 

# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.

## 

# Default server configuration

# 

server {  
listen 80 default\_server;  
listen [::]:80 default\_server;

root /home/dhis/tomcat-dhis/webapps/ROOT;

# root /var/www/html/dhis;

# Enables compression, incl Web API content-types

gzip on;  
gzip\_types  
“application/json;charset=utf-8” application/json  
“application/javascript;charset=utf-8” application/javascript text/javascript  
“application/xml;charset=utf-8” application/xml text/xml  
“text/css;charset=utf-8” text/css  
“text/plain;charset=utf-8” text/plain;

```
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

```

# root /var/www/html;

```
# Add index.php to the list if you are using PHP

```

# index index.html index.htm index.nginx-debian.html;

# server\_name \_;

#location /dhis {

# proxy\_pass [http://102.223.7.33:8080/dhis](http://102.223.7.33:8080/dhis);

# proxy\_redirect off;

# proxy\_set\_header Host $host;

# proxy\_set\_header X-Real-IP $remote\_addr;

# proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;

# proxy\_set\_header X-Forwarded-Proto http;

# proxy\_buffer\_size 128k;

# proxy\_buffers 8 128k;

# proxy\_busy\_buffers\_size 256k;

# }

#location /dhis {

# proxy\_pass [http://102.223.7.33:8080/dhis](http://102.223.7.33:8080/dhis);

# }

location /dhis {  
proxy\_pass [http://127.0.0.1:8080/dhis](http://127.0.0.1:8080/dhis);  
proxy\_redirect off;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Host $http\_host;  
proxy\_set\_header X-Forwarded-Proto https;

```
}

```

}

# Virtual Host configuration for [example.com](http://example.com)

## You can move that to a different file under sites-available/ and symlink that

# to sites-enabled/ to enable it.

# 

#server {

# listen 80;

# listen [::]:80;

# 

# server\_name [example.com](http://example.com);

# 

# root /var/www/example.com;

# index index.html;

# 

# location / {

# try\_files $uri $uri/ =404;

# }

#}

Now when i log in i get this error

 ![403](https://dhis2.b-cdn.net/uploads/default/original/3X/0/7/07309893dd844e26f53a1e6e0156156cf49d56fe.png)

when i refresh i get this message

 ![welcom nginx](https://dhis2.b-cdn.net/uploads/default/original/3X/c/f/cfa3c0e725367b6a8671b412427abc5a73171d58.png)

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [3 August 2021 16:16 UTC](https://community.dhis2.org/t/login-error/43769/10 "2021-08-03T16:16:06Z")

</div>

> [@Janise](#):
>
> proxy\_set\_header X-Forwarded-Proto http;

I see that you are experiencing an issue another user has experienced before and the solution was by @phil:

> [@Seeking help with identifying possible solution in a bug after installing a fresh instance of 2.35.1](https://community.dhis2.org/t/seeking-help-with-identifying-possible-solution-in-a-bug-after-installing-a-fresh-instance-of-2-35-1/41686/14):
>
> It is actually visible in the nginx config posted above; the problem is the line setting the protocol to `http`:
> 
> ```auto
> proxy_set_header X-Forwarded-Proto http;
> 
> ```
> 
> This needs to be `https`, or the line omitted altogether.
> 
> regards,  
> Phil

If it works please let me know; otherwise, maybe there are other changes that you need to make as well! Thank you! (:

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [4 August 2021 06:54 UTC](https://community.dhis2.org/t/login-error/43769/12 "2021-08-04T06:54:49Z")

</div>

i have done as you have instructed but still the same  
 ![sites-available 1](https://dhis2.b-cdn.net/uploads/default/original/3X/8/7/874621e241b345e3613d3d2181beb588ae333d6d.png)  
NGINX.CONF  
 ![nginx conf2](https://dhis2.b-cdn.net/uploads/default/original/3X/5/1/51a0401e948790ada25e008e4c415d428ac729cb.png)  
 ![nginx conf 1](https://dhis2.b-cdn.net/uploads/default/original/3X/d/9/d98d61066eea0ee506ccd6332b89775bf9cb188c.png)

dhis.conf

![dhis.conf](https://dhis2.b-cdn.net/uploads/default/original/3X/d/8/d8e1576ec197052d189225133cead9b852094dd0.png)

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [4 August 2021 08:10 UTC](https://community.dhis2.org/t/login-error/43769/13 "2021-08-04T08:10:36Z")

</div>

Hey I’m sorry it didn’t work! I will ask for further support. Thanks for all the logs and screenshots! 👍

BTW, I see in your API request:

> [@Janise](#):
>
> ![post](https://dhis2.b-cdn.net/uploads/default/original/3X/5/7/5709b5cbb2587153d8abccb37cead24fbb2f226d.png)

Aren’t you forgetting to add the port number 8080 in the request URI. Isn’t it supposed to be 102.223.7.33:8080/dhis? Additionally, have you tried using a different port number for the instance?

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [4 August 2021 08:36 UTC](https://community.dhis2.org/t/login-error/43769/14 "2021-08-04T08:36:34Z")

</div>

when i use 102.223.7.33:8080/dhis it says site cannot be found but if i use 102.223.7.33/dhis takes me to the login page

---

<div class="post-metadata">

**Author:** ![adam](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/adam/32/35462_2.png) [@adam](https://community.dhis2.org/u/adam)\
**Post date:** [4 August 2021 13:04 UTC](https://community.dhis2.org/t/login-error/43769/15 "2021-08-04T13:04:58Z")

</div>

> [@Janise](#):
>
> 102.223.7.33:8080/dhis

I wonder if that port is blocked. Maybe the ubuntu firewall? with tomcat running on 8080, you should be able to access [http://102.223.7.33:8080/](http://102.223.7.33:8080/) provided that dhis2.war was installed at tomcats root. Logging in without nginx is the first step.

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [5 August 2021 05:42 UTC](https://community.dhis2.org/t/login-error/43769/16 "2021-08-05T05:42:02Z")

</div>

before nginx, site was not available after installing and configure nginx site is available

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [5 August 2021 07:28 UTC](https://community.dhis2.org/t/login-error/43769/17 "2021-08-05T07:28:32Z")

</div>

Hey I have asked for support for your situation and I’d like to quote Morten Svanæs:  
@netroms:

> This case seems a bit deadlocked, it would be much easier if I could get access to the server. I can access the ip he is using [http://102.223.7.33/api](http://102.223.7.33/api)

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [5 August 2021 07:31 UTC](https://community.dhis2.org/t/login-error/43769/18 "2021-08-05T07:31:57Z")

</div>

sure it will be very helpful, i can give him access

---

<div class="post-metadata">

**Author:** ![jthomas](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/jthomas/32/32752_2.png) [@jthomas](https://community.dhis2.org/u/jthomas)\
**Post date:** [6 August 2021 10:00 UTC](https://community.dhis2.org/t/login-error/43769/19 "2021-08-06T10:00:56Z")

</div>

Hi @Janise can you check whether below variable is off in `dhis.conf`

`server.https = off`

If `on` turn it `off` since it looks you are using http and not https

And do restart tomcat.

---

<div class="post-metadata">

**Author:** ![Janise](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/bbce88/32.png) [@Janise](https://community.dhis2.org/u/Janise)\
**Post date:** [9 August 2021 12:59 UTC](https://community.dhis2.org/t/login-error/43769/20 "2021-08-09T12:59:27Z")

</div>

same problem appears

---

<div class="post-metadata">

**Author:** ![jthomas](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/jthomas/32/32752_2.png) [@jthomas](https://community.dhis2.org/u/jthomas)\
**Post date:** [9 August 2021 13:47 UTC](https://community.dhis2.org/t/login-error/43769/21 "2021-08-09T13:47:19Z")

</div>

we did restart tomcat right after modification of dhis.conf? Can you past again the contents of dhis.conf and also tomcat logs after restart

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [10 August 2021 13:48 UTC](https://community.dhis2.org/t/login-error/43769/22 "2021-08-10T13:48:41Z")

</div>

Split this topic on 10 August 2021 13:48 UTC

A post was split to a new topic: [DHIS2 Fundamentals course login issue](https://community.dhis2.org/t/dhis2-fundamentals-course-login-issue/43886)
