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



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.

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