hawtio / hawtio

Hawtio web console helps you manage your JVM stuff and stay cool!
https://hawt.io/
Apache License 2.0
1.41k stars 540 forks source link

Unable to get authentication working on Tomcat 7 #1025

Closed okal closed 10 years ago

okal commented 10 years ago

Hi,

I'm running the sample WAR from https://oss.sonatype.org/content/repositories/public/io/hawt/sample/1.2.2/sample-1.2.2.war on an EC2 instance with Tomcat 7. I added the following lines to WEB-INF/classes/blueprint.properteis:

hawtio.authenticationEnabled=true
hawtio.realm=tomcat

I can load the page without any login prompt. I have a user enabled in tomcat-users.xml. Am I going about this the wrong way? Setting them via CATALINA_OPTS, my first approach, in /etc/init.d/tomcat7 didn't work either. What am I missing?

davsclaus commented 10 years ago

Can you set logging level to TRACE for logger name io.hawt.web That should log some more details what happens when you attempt to login.

okal commented 10 years ago

Thanks for the response :-) Sorry if I'm being a bit thick here (Tomcat noob), but where do I do that? This may be a more "StackOverflow" type of question, and feel free to push me there if it is, but I can see a filter in the UI for TRACE level logging, but that's probably not it. Should I be adding this to log4j.properties in the WEB-INF folder, or the global /etc/tomcat7/logging.properties?

Not seeing anything in the Logs section of the UI related to io.hawt.web at a TRACE level, but I do see entries from io.hawt.git, .maven, etc.

davsclaus commented 10 years ago

Ah yeah that is not so easy.

So in the hawtio.war you need to

  1. remove the log4j.properties file in WEB-INF
  2. modify the other log4j.properties file in WEB-INF/classes

For example I changed the file as this gist https://gist.github.com/davsclaus/8764804

Then the logs go to the where the other logs are in the logs directory.

And then package that as a .war file, and deploy.

davsclaus commented 10 years ago

any luck?

davsclaus commented 10 years ago

closing, you can reopen if still a problem for you.

okal commented 10 years ago

Hi Claus. Really sorry I didn't get back to you sooner. This was left up to whoever happened to be on the support rotation, and it fell by the wayside during the transitions. We did decide not to use hawtio, though. Thanks for all the help. Sorry, again. It was really inconsiderate of me not to follow up.