0

I'm facing an apparently common issue: I can't manage to login in a recently installed Apache Tomcat 8.

The Tomcat installation is part of a large system comprised of a database and other apps and it's not the first time I've installed it just as it isn't the first time I faced this problem. Being so, I did all the steps that helped me fix the problem the other times based on countless pages I found on the web and here on SO about this problem:

  1. Accessed the user XML file and gave all permissions, especially manager-gui, to my created login with no empty spaces between commas
  2. Changes in the XML file were proceeded by closing it in Notepad++ to avoid app locking the file
  3. Changes in the user XML file were preceded by shutting down the service in Windows Services and turning it up again after changes were made
  4. Login and password were set and changed multiple times to be sure it wasn't any kind of mistyped information
  5. The access port in server.xml was changed to more than one different option to be sure there wasn't any port conflict with another app (unlikely since the Windows Server running the app is practically clean)
  6. The read permissions of the user XML file were checked and are in place.
  7. And of course, I reinstalled it at least once.

And maybe more troubleshooting steps I can't remember right now. And none of this worked.

So I'm asking: which other steps could I do to try to access the Tomcat Manager (localhost:port/manager) from a web browser (Chrome/Firefox) from within the same machine it is installed? (no NetBeans involved) I can't think of any other solution.

Momergil
  • 2,213
  • 5
  • 29
  • 59
  • Make sure you access the manager via `http://localhost:[port]/manager` or `http://127.0.0.1:[port]/manager` - don't use your external IP or computer name. Requests will be rejected by default as configured in `\webapps\manager\META-INF\context.xml` - What exact error page or message does your browser present to you? – Selaron Nov 06 '18 at 07:30
  • Add a line to your `conf/logging.properties` : `org.apache.level = FINE` and after Tomcat restart, make sure the catalina-[today].log is containing lines like `org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans Database=MemoryUserDatabase[id=UserDatabase,pathname=conf/tomcat-users.xml` and `org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister MemoryUserDatabase[id=UserDatabase,pathname=conf/tomcat-users.xml` and `Creating User MBean for user User username="YOUR_MANAGER_USER"` – Selaron Nov 06 '18 at 07:44
  • @Selaron Yes, I'm acessing the manager with the way you described as I noted in the last paragraph. The error I get is, after filling the login dialog with the correct information and clicking OK, it dissapears only to reapper ms later with empty spaces. If I press Cancel, the page "401 Unauthorized" is shown with tips on how to login to the manager. – Momergil Nov 06 '18 at 10:08
  • 1
    401 is a lot better than 403. It means you are not blocked by RemoteAddrValve. – Konstantin Kolinko Nov 06 '18 at 12:11
  • If you do not have an IDE, open tomcat-users.xml in Firefox (it has an XML viewer, some errors/syntax typos might become visible). – Konstantin Kolinko Nov 06 '18 at 12:16
  • Full version number of your Tomcat =? (x.y.z.) – Konstantin Kolinko Nov 06 '18 at 12:18
  • 1
    Also check your Realm configuration. Realm and nested CredentialHandler element are responsible for password handling. (tomcat-users.xml UserDatabase is just a database providing data to a Realm). – Konstantin Kolinko Nov 06 '18 at 12:27
  • @KonstantinKolinko Apache Tomcat 8.5.24 – Momergil Nov 06 '18 at 18:34

1 Answers1

0

Well I finally managed to access the manager after appealing to the last resort I had forgot to do: copy and paste of the entire conf folder from a Tomcat which was working to the one having the problem and even so it didn't work by itself, since I still had to change the port from 8080 to 8088 for it to finally work. It seems, therefore, it was a "binary problem": the port wasn't adequate plus differneces in configuration. Comparing the files, I managed to find small differences for example in the web.xml files:

*Current, working*
<mime-mapping>
    <extension>woff</extension>
    <mime-type>application/x-font-woff</mime-type>
</mime-mapping>

*Previously, not working*
<mime-mapping>
    <extension>woff</extension>
    <mime-type>font/woff</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>woff2</extension>
    <mime-type>font/woff2</mime-type>
</mime-mapping>

I can't understand why changes such as this one made any difference, but at least it's working. Thanks for the help.

Momergil
  • 2,213
  • 5
  • 29
  • 59