Configuring Apache Tomcat 9

Ubuntu (Linux): 20.04 Java (openjdk): 8u282 Apache Tomcat: 9.0.31 MySQL-Server: 8.0.23

Question: I have been configuring Ubuntu (Linux) 20.04 for installation of OpenMRS and unable to get past the point where I would enter http://localhost:8080/manager/html to start the OpenMRS install.

tomcat-users.xml role and users:

Successfully installed Java, Apache Tomcat9 and Mysql-Server. Updated the role and users in the tomcat-users.xml files and saved to: usr/share/tomcat9/etc/tomcat-users.xml

and

etc/tomcat9/tomcat-users.xml

I found two-locations to update and save the tomcat-users.xml file. Are there others?

Create OpenMRS application data directory sudo mkdir /usr/share/tomcat9/.OpenMRS [This command appears successful]

sudo chown -R tomcat9:tomcat9 /usr/share/tomcat9/.OpenMRS [Received an error, user does not exist]

Sudo service tomcat9 restart

From browser:
localhost:8080/ The “It Works” window is displayed.

hlocalhost:8080/manager/html
Logon window opens requesting user and password.
Tried to logon with: admin and tomcat , and received “401 Unauthorized” error for both users


"401 Unauthorized You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.

" ***************************************************

Any ideas how to get past the 401 Unauthorized error.

Thank you.

@william try adding “admin-gui” to your roles:

<user name="tomcat" password="s3cret" roles="admin-gui,standard,manager-gui"/>

Hello Cliff

The problem was a comment symbol. I am new to Linux and learning rapidly as I go. I was adding your suggestion when I noticed the comment symbol. Thank you for pointing me in the right direction.

1 Like

I have similar issue. I tried adding

<user name="tomcat" password="s3cret" roles="admin-gui,standard,manager-gui"/>

It takes to page that says This site can’t be reached.

  1. Verified port 8080 works fine.
  2. When refreshing the page, it says unauthorized

what happens on restarting your machine

I tried restarting the page literally severall times, same result.

which browser are you using

I tried both in Google Chrome and Firefox.

Do you know if there is an updated documentations, that I can use to install on either Ubuntu 20.10 or Mac. I found a lot of documentations, and none of them seems to work.

I noticed the same thing… The documentation covers older versions of Ubuntu, Apache and Tomcat. I could not find any documentation to cover the recent versions.