aspose file tools*
The moose likes Tomcat and the fly likes unable to login in tomcat manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "unable to login in tomcat manager" Watch "unable to login in tomcat manager" New topic
Author

unable to login in tomcat manager

Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
hi,
I have installed Tomcat 5.0.28. in the port no. 9090
after typeing
, I am getting the index page.
From here, I want to log in Tomcat Manager to deploy my web application .
I checked with user name / password from tomcat-users.xml. But the dialog box "Tomcat Manager Application " is not accepting the user/password.
I am getting following error message in the browser
HTTP Status 403 - Access to the requested resource has been denied


type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.


but I can run the sample applications and my own applications that saved in the default folders in the development directories.
I can not run application stored in my own folder in the /webapps directory.


thanks
Abhijit



:shocked: :shocked:


Abhijit Das
SCJP 5.0 | SCWCD 1.5
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
The basic Tomcat installation does not automatically give you a tomcat-users.xml configured to permit the manager or admin roles - just a basic security measure. How did you change the users xml?

Bill
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by William Brogden:
The basic Tomcat installation does not automatically give you a tomcat-users.xml configured to permit the manager or admin roles - just a basic security measure. How did you change the users xml?

Bill



If you install with the .exe version on a Windows box, the install wizard walks you through a screen that allows you to enter your admin username and password.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
hello,

Ben & will
I just unzip the file and store in the E:/jakarta-tomcat-5.0.28
Next , I change the file E:\jakarta-tomcat-5.0.28\conf\tomcat-users.xml


These are the your doubts .

Now, if i did not change, then how to log into the Tomcat mamager to deploy my web-applications???
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You need to add a manager role and make sure that your user is in that role.


[ March 06, 2008: Message edited by: Ben Souther ]
Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
Hi
Ben, now I am getting the "Tomcat Web Application Manager " window after adding your lines in the file.

Thanks a lot.

:thumb: :thumb:
Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
hello Friends,
Now I am able to open the Manager Window. But after deploy the war file , I am not able to start it i.e. Running remains flase for that application.

As it is deployed successsfully , the floder and war is placed in the /webapps folder.
Following is the error message in server console...
Mar 7, 2008 2:43:39 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3079 ms
Mar 7, 2008 2:44:10 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /abhi from URL jar:file:/E:/jak
arta-tomcat-5.0.28/webapps/abhi.war!/
Mar 7, 2008 2:44:11 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 7, 2008 2:44:11 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 7, 2008 2:44:11 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Mar 7, 2008 2:46:51 PM org.apache.catalina.core.StandardHostDeployer start
INFO: standardHost.start /abhi
Mar 7, 2008 2:46:51 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 7, 2008 2:46:51 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 7, 2008 2:46:51 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Mar 7, 2008 2:46:53 PM org.apache.catalina.core.StandardHostDeployer start
INFO: standardHost.start /abhi
Mar 7, 2008 2:46:53 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 7, 2008 2:46:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 7, 2008 2:46:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Mar 7, 2008 2:46:56 PM org.apache.catalina.core.ContainerBase log
INFO: Removing web application at context path /abhi
Mar 7, 2008 2:46:59 PM org.apache.catalina.core.StandardHostDeployer stop
INFO: standardHost.stop /admin
Mar 7, 2008 2:46:59 PM org.apache.catalina.logger.LoggerBase stop
INFO: unregistering logger Catalina:type=Logger,path=/admin,host=localhost

[ March 07, 2008: Message edited by: Abhijit Das ]
Pat Garner
Greenhorn

Joined: Mar 05, 2004
Posts: 9
In Tomcat 7 the roles have changed. The new roles are as follows:

* manager-gui: allows access to the HTML GUI and the status pages

* manager-script: allows access to the text interface and the status pages

* manager-jmx: allows access to the JMX proxy and the status pages

* manager-status: allows access to the status pages only

These roles are predefined, so you do NOT need to add them via role tags. So, to access the manager application via a web browser you must give the role "manager-gui" to whatever user you want to be able to login to the manager application i.e.



If you want to use a script to deploy automatically i.e. using Ant you need to set up a user for the "manager-script" role i.e.



The documentation at http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html leave a lot to be desired! I had to search the web to get decent instructions. One warning to heed in the Tomcat 7 documentation applies to a production scenario:

The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:

* Users with the manager-gui role should NOT be granted either the manager-script or manager-jmx roles.

* If the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.

Hope this saves others from the frustration that I went through...
JosephBeatricSelvam Jn
Greenhorn

Joined: Nov 18, 2011
Posts: 2
-Joseph
Robert Patzke
Greenhorn

Joined: Jan 01, 2012
Posts: 2
@ Pat Garner

Your contribution was the reason for me to register at this forum, because I lost many hours till now by searching for the reason of this problem.
The mess is, that with the starting page you get the NOTE: For security reasons .... role "manager" .... role "admin".
No hint to the necessary role "manager-gui" for using the browser to log in as manager.
(Probably it will be written somewhere in the documentation, but it shuld be mentioned on the start page.)
The documentation has the hint to necessary role "manager-script", but if you do not know, that this is not the door for using the browser, the research is in a cul-de-sac.

So thank You very much.
Robert
Ibne Masood
Greenhorn

Joined: Jan 06, 2012
Posts: 2
It appears as if I am stuck in a similar situation but this time none of the above solutions work. I have tried to add the appropriate role to tomcat-users.xml file without any mistakes of not removing the comment markers. Nothing seems to work. In my case I get a Tomcat Manage Application login form when I try to browse the server from within the Netbeans IDE. I have verfied the properties and I am making changes to the correct tomcat base conf file. Just wondering if someone knows or have a similar problem?
Robert Patzke
Greenhorn

Joined: Jan 01, 2012
Posts: 2
When I started to edit tomcat-users.xml and nothing worked, I combed through all directories looking for some hint. I found, that there are several tomcat-users.xml files in my environment and my hope was, that I edited the wrong one. But it was not the reason for my flops.

Are You really sure to edit the correct tomcat-users.xml file?
And did You restart tomcat after editing the file?

Good luck
Robert
Ibne Masood
Greenhorn

Joined: Jan 06, 2012
Posts: 2
Robert Patzke wrote:When I started to edit tomcat-users.xml and nothing worked, I combed through all directories looking for some hint. I found, that there are several tomcat-users.xml files in my environment and my hope was, that I edited the wrong one. But it was not the reason for my flops.

Are You really sure to edit the correct tomcat-users.xml file?
And did You restart tomcat after editing the file?

Good luck
Robert


Yes I am sure that I have edited the right file. In my system I have tomcat-users.xml file at only two places and I have tried to edit both of them. I have also tried to restart the tomcat and netbeans and this also does not work.
Gauthier Delmee
Greenhorn

Joined: Jan 17, 2012
Posts: 1
Ibne Masood wrote:
Robert Patzke wrote:When I started to edit tomcat-users.xml and nothing worked, I combed through all directories looking for some hint. I found, that there are several tomcat-users.xml files in my environment and my hope was, that I edited the wrong one. But it was not the reason for my flops.

Are You really sure to edit the correct tomcat-users.xml file?
And did You restart tomcat after editing the file?

Good luck
Robert


Yes I am sure that I have edited the right file. In my system I have tomcat-users.xml file at only two places and I have tried to edit both of them. I have also tried to restart the tomcat and netbeans and this also does not work.


I was also not able to get it working initially, then noted in the thread above that you should not create the "manager-gui" and "manager-script" roles in the file. I removed them and now my setup is working.
Monish Patel
Greenhorn

Joined: Apr 29, 2012
Posts: 1
Hi all,

While installing Tomact6, I have not entered anyhting for "Tomcat administrator Login-optional".
Now I see that tomcat has been succesfully installed (chked this by typing teh url http://localhost:8080/)

1) Now, on that Tomcat page, on the left side, I see two links "Status" and "Tomcat Manager".
When I click on these links, they ask me for credentials. From wat I googled, I came to know that I need to change my
tomcat-users.xml file. I see that my users and role were commented. When I try to uncomment, I m not able to edit the
tomcat-users.xml at all. I m an administrator, bt i m still not able to edit the tomcat-users.xml file, donno why???

2) Also. when I go to All progms->Apache Tomcat6.0 Tomcat6->Configure Tomcat or Monitor Tomcat, Apache Tomcat6.0 Tomcat6
properties WINDOW open up,instead of the web app opening?

Could you all please help me out? I jus donno how to proceed from here
birendra singh
Greenhorn

Joined: May 31, 2012
Posts: 1
check whether the role code is commented by -->, if yes, remove it. I was doing very thing correct but the login was not successful, then I found that the code is commented, after removing it the login is working fine.

I added two lines:
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

My tomcat is 7

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to login in tomcat manager