You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tapas Mishra <mi...@gmail.com> on 2010/07/07 11:31:13 UTC

tomcat /manager not working

I downloaded tomcat 5.5.29 and tried to access an application
http://<IP of Tomcat server>:8080/manager
which the doc says
http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html
that it is included and deployed by default it did not showed me any
thing did I miss any thing.

-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by Mark Thomas <ma...@apache.org>.
On 07/07/2010 17:21, André Warnier wrote:
> As far as I know, I am not making any changes to the logic of the
> manager application by doing this.  All I am doing is making the
> HTMLManager servlet be the default servlet.
> So when a user requests any URL starting with "/manager" and not
> specifically matching any of the specific other manager servlets, they
> will get the HTML manager's starting page.
> Is that bad ?

Ahh. Light finally dawns. You added the mapping rather than replaced the
existing one. My bad. Sorry.

That is going to break all the static resources. So that looks like:
- images
- xml format for the status output

Not complete breakage as I originally thought but enough that we
wouldn't want to do it.

Konstantin's idea of an index.jsp that redirects looks like the best
solution and I can't see any reason not to back-port it either. Enough
folks don't appear to read the docs and seem to expect something on
/manager that would make this worth doing.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Konstantin Kolinko wrote:
> 2010/7/7 André Warnier <aw...@ice-sa.com>:
>> I have made the change in the Manager's web.xml, restarted Tomcat, and so
>> far all the manager functions and links seem to be working fine.
>> Namely, I have added this mapping at the end of the existing
>> servlet-mappings of the manager webapp's web.xml :
>>
>> existing :
>> ...
>>  <servlet-mapping>
>>    <servlet-name>HTMLManager</servlet-name>
>>    <url-pattern>/html/*</url-pattern>
>>  </servlet-mapping>
>>
>> added:
>>  <servlet-mapping>
>>    <servlet-name>HTMLManager</servlet-name>
>>    <url-pattern>/*</url-pattern>
>>  </servlet-mapping>
>>
>> In my understanding of the URL-mapping rules,
>> - the "/manager" part determines which URLs get mapped to the Manager
>> application
>> - then, after this "/manager" is stripped, for the remainder, the longest
>> matching mapping "wins".
>> So the "/*" mapping above should win only if none of the others does, no ?
>>
>> Am I missing something ?
>>
> 
> 1) The HTMLManager servlet uses the part of URI after "/html" (aka
> request.getPathInfo()) as the command to be executed.
> 
> Having it mapped to two different addresses creates an ambiguity,  and
> well as may bypass security constraints specified in its web.xml
> 
> 2) I think that adding /index.jsp that will respond to the client with
> a 301 redirect to contextPath + "/html" will work,  but I am not sure
> that this feature is actually needed.
> 
> 
I have now tested the above change also with this version :
C:\apache-tomcat-6.0.24\bin>version
Using CATALINA_BASE:   C:\apache-tomcat-6.0.24
Using CATALINA_HOME:   C:\apache-tomcat-6.0.24
Using CATALINA_TMPDIR: C:\apache-tomcat-6.0.24\temp
Using JRE_HOME:        C:\Java6jdk
Using CLASSPATH:       C:\apache-tomcat-6.0.24\bin\bootstrap.jar
Server version: Apache Tomcat/6.0.24
Server built:   January 19 2010 1439
Server number:  6.0.0.0
OS Name:        Windows XP
OS Version:     5.1
Architecture:   x86
JVM Version:    1.6.0_06-b02
JVM Vendor:     Sun Microsystems Inc.
C:\apache-tomcat-6.0.24\bin>

and I also see no doomsday effects.
My earlier notes about how it behaves with a selection of URLs under Tomcat 5.5 seem also 
valid for this version 6.0 above.
(Granted, apart from the /manager/images path.  That one is broken. But that should easily 
be fixable, no ?).

About remark 1) above :
- as per my understanding, that should still work after the change. Any URL path beginning 
with "/manager/html" will still be mapped the same way, and getPathInfo() will still 
return the same answer, no ?
- on the face of it, I see nothing in the manager's web.xml of the Windows distribution of 
Tomcat 5.5 or 6.0, that would create a security issue with this.  The whole webapp is 
under the same security constraints, so even just "/manager" will ask for authentication.

As far as I know, I am not making any changes to the logic of the manager application by 
doing this.  All I am doing is making the HTMLManager servlet be the default servlet.
So when a user requests any URL starting with "/manager" and not specifically matching any 
of the specific other manager servlets, they will get the HTML manager's starting page.
Is that bad ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/7/7 André Warnier <aw...@ice-sa.com>:
> I have made the change in the Manager's web.xml, restarted Tomcat, and so
> far all the manager functions and links seem to be working fine.
> Namely, I have added this mapping at the end of the existing
> servlet-mappings of the manager webapp's web.xml :
>
> existing :
> ...
>  <servlet-mapping>
>    <servlet-name>HTMLManager</servlet-name>
>    <url-pattern>/html/*</url-pattern>
>  </servlet-mapping>
>
> added:
>  <servlet-mapping>
>    <servlet-name>HTMLManager</servlet-name>
>    <url-pattern>/*</url-pattern>
>  </servlet-mapping>
>
> In my understanding of the URL-mapping rules,
> - the "/manager" part determines which URLs get mapped to the Manager
> application
> - then, after this "/manager" is stripped, for the remainder, the longest
> matching mapping "wins".
> So the "/*" mapping above should win only if none of the others does, no ?
>
> Am I missing something ?
>

1) The HTMLManager servlet uses the part of URI after "/html" (aka
request.getPathInfo()) as the command to be executed.

Having it mapped to two different addresses creates an ambiguity,  and
well as may bypass security constraints specified in its web.xml

2) I think that adding /index.jsp that will respond to the client with
a 301 redirect to contextPath + "/html" will work,  but I am not sure
that this feature is actually needed.



Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Mark Thomas wrote:
> On 07/07/2010 15:35, Caldarale, Charles R wrote:
>>> From: André Warnier [mailto:aw@ice-sa.com]
>>> Subject: Re: tomcat /manager not working
>>>
>>> I am not going to play with /undeploy just to further verify 
>>> my theory, but does that look like I broke something ?
>> No, it looks like it's working.  Things must have changed since the last time I tried playing with the mappings (several years ago).
> 
> Were you testing with 7.0.x?
> 
> So far (with 6.0.x from svn):
> /manager
>   - Images broken
>   - Clicking on list returns unknown command
>   - Ditto start/stop etc
>   - Status is ok (as expected)
> 
> With 7.0.x you will have more success because we have changed the mappings.
> 
> With 6.0.x the HTML interface will be totally broken.
> 
> I suspect the same with 5.5.x
> 
With this :

C:\Tomcat5.5\bin>version.bat
Using CATALINA_BASE:   C:\Tomcat5.5
Using CATALINA_HOME:   C:\Tomcat5.5
Using CATALINA_TMPDIR: C:\Tomcat5.5\temp
Using JRE_HOME:        C:\Java6jdk
Using CLASSPATH:       C:\Tomcat5.5\bin\bootstrap.jar
Server version: Apache Tomcat/5.5.26
Server built:   Jan 28 2008 01:35:23
Server number:  5.5.26.0
OS Name:        Windows XP
OS Version:     5.1
Architecture:   x86
JVM Version:    1.6.0_06-b02
JVM Vendor:     Sun Microsystems Inc.
C:\Tomcat5.5\bin>

.. which is the version that the OP was using, more or less.
So, what did you break in 6.0 and 7.0 ?
:-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by Mark Thomas <ma...@apache.org>.
On 07/07/2010 15:35, Caldarale, Charles R wrote:
>> From: André Warnier [mailto:aw@ice-sa.com]
>> Subject: Re: tomcat /manager not working
>>
>> I am not going to play with /undeploy just to further verify 
>> my theory, but does that look like I broke something ?
> 
> No, it looks like it's working.  Things must have changed since the last time I tried playing with the mappings (several years ago).

Were you testing with 7.0.x?

So far (with 6.0.x from svn):
/manager
  - Images broken
  - Clicking on list returns unknown command
  - Ditto start/stop etc
  - Status is ok (as expected)

With 7.0.x you will have more success because we have changed the mappings.

With 6.0.x the HTML interface will be totally broken.

I suspect the same with 5.5.x

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: tomcat /manager not working

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: tomcat /manager not working
> 
> I am not going to play with /undeploy just to further verify 
> my theory, but does that look like I broke something ?

No, it looks like it's working.  Things must have changed since the last time I tried playing with the mappings (several years ago).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Caldarale, Charles R wrote:
>> From: André Warnier [mailto:aw@ice-sa.com]
>> Subject: Re: tomcat /manager not working
>>
>> So the "/*" mapping above should win only if none of the 
>> others does, no ?
>>
>> Am I missing something ?
> 
> Yup - you've broken the non-HTML usage of the manager, which is what all the scripts use to access the capability.  Don't do that.
> 

Guys, I must be thick, because I still don't see that.
The other "usages" are specifically mapped, like :

   <servlet-mapping>
     <servlet-name>Manager</servlet-name>
       <url-pattern>/roles</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
     <servlet-name>Manager</servlet-name>
       <url-pattern>/resources</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
     <servlet-name>Status</servlet-name>
     <url-pattern>/status/*</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
     <servlet-name>JMXProxy</servlet-name>
       <url-pattern>/jmxproxy/*</url-pattern>
   </servlet-mapping>

On my system, after the change I mentioned,

if request the URL :
http://localhost:8180/manager/resources

I get the response :

OK - Listed global resources of all types
simpleValue:java.lang.Integer
UserDatabase:org.apache.catalina.users.MemoryUserDatabase

If I request the URL
http://localhost:8180/manager/status/x

I get a nice status page.

If I request the URL :
http://localhost:8180/manager/deploy?config=file:C:/tomcat5.5/webapps/jsp-examples/context.xml
(which is wrong, but just for the example)

I get :
FAIL - Invalid context path null was specified

etc..
I am not going to play with /undeploy just to further verify my theory, but does that look 
like I broke something ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: tomcat /manager not working

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: tomcat /manager not working
> 
> So the "/*" mapping above should win only if none of the 
> others does, no ?
> 
> Am I missing something ?

Yup - you've broken the non-HTML usage of the manager, which is what all the scripts use to access the capability.  Don't do that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Mark Thomas wrote:
> On 07/07/2010 13:20, André Warnier wrote:
>> Mark Thomas wrote:
>>> On 07/07/2010 11:50, André Warnier wrote:
>>>> I have no idea if this triggers secondary unwanted effects.
>>> Oddles of them. It breaks large sections of the manager app.
>>>
>>>> If it does not however, then I would respectively suggest to the Tomcat
>>>> developers to incorporate this as a standard servlet-mapping for the
>>>> Manager, since the other one is a bit un-intuitive.
>>> RTFM. Specifically
>>> http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html
>>>
> 
>> Respectfully thus, (re-)reading the above page from top to bottom did
>> not immediately point out to me why it would break oodles of things.  I
>> accept you saying so, but could point me to a specific item or give a
>> small example ?
> 
> The entire HTML manager interface.
> 
> If you want to understand why, consider the manager app's web.xml with
> the proposed modification, look at the servlet mappings and using the
> rules for mapping requests to servlets defined in the servlet spec see
> if you can find any URLs that will be served by the HTMLManager servlet.
> (Hint: Most (all?) will be served by the Manager servlet)
> 
I must be missing something, but that is not what happens on my local system.
I have made the change in the Manager's web.xml, restarted Tomcat, and so far all the 
manager functions and links seem to be working fine.
Namely, I have added this mapping at the end of the existing servlet-mappings of the 
manager webapp's web.xml :

existing :
...
   <servlet-mapping>
     <servlet-name>HTMLManager</servlet-name>
     <url-pattern>/html/*</url-pattern>
   </servlet-mapping>

added:
   <servlet-mapping>
     <servlet-name>HTMLManager</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>

In my understanding of the URL-mapping rules,
- the "/manager" part determines which URLs get mapped to the Manager application
- then, after this "/manager" is stripped, for the remainder, the longest matching mapping 
"wins".
So the "/*" mapping above should win only if none of the others does, no ?

Am I missing something ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by Mark Thomas <ma...@apache.org>.
On 07/07/2010 13:20, André Warnier wrote:
> Mark Thomas wrote:
>> On 07/07/2010 11:50, André Warnier wrote:
>>> I have no idea if this triggers secondary unwanted effects.
>>
>> Oddles of them. It breaks large sections of the manager app.
>>
>>> If it does not however, then I would respectively suggest to the Tomcat
>>> developers to incorporate this as a standard servlet-mapping for the
>>> Manager, since the other one is a bit un-intuitive.
>>
>> RTFM. Specifically
>> http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html
>>

> Respectfully thus, (re-)reading the above page from top to bottom did
> not immediately point out to me why it would break oodles of things.  I
> accept you saying so, but could point me to a specific item or give a
> small example ?

The entire HTML manager interface.

If you want to understand why, consider the manager app's web.xml with
the proposed modification, look at the servlet mappings and using the
rules for mapping requests to servlets defined in the servlet spec see
if you can find any URLs that will be served by the HTMLManager servlet.
(Hint: Most (all?) will be served by the Manager servlet)

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Mark Thomas wrote:
> On 07/07/2010 11:50, André Warnier wrote:
>> I have no idea if this triggers secondary unwanted effects.
> 
> Oddles of them. It breaks large sections of the manager app.
> 
>> If it does not however, then I would respectively suggest to the Tomcat
>> developers to incorporate this as a standard servlet-mapping for the
>> Manager, since the other one is a bit un-intuitive.
> 
> RTFM. Specifically
> http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html
> 
Hi.
(NB: in my previous message, I meant "respectfully" instead of "respectively"..)

Respectfully thus, (re-)reading the above page from top to bottom did not immediately 
point out to me why it would break oodles of things.  I accept you saying so, but could 
point me to a specific item or give a small example ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by Mark Thomas <ma...@apache.org>.
On 07/07/2010 11:50, André Warnier wrote:
> I have no idea if this triggers secondary unwanted effects.

Oddles of them. It breaks large sections of the manager app.

> If it does not however, then I would respectively suggest to the Tomcat
> developers to incorporate this as a standard servlet-mapping for the
> Manager, since the other one is a bit un-intuitive.

RTFM. Specifically
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat /manager not working

Posted by André Warnier <aw...@ice-sa.com>.
Tapas Mishra wrote:
> I downloaded tomcat 5.5.29 and tried to access an application
> http://<IP of Tomcat server>:8080/manager
> which the doc says
> http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html
> that it is included and deployed by default it did not showed me any
> thing did I miss any thing.
> 
When you access http://yourhost:8080
you should get the standard Tomcat homepage.
On the left, there is a link to the Manager application.
It should show that the correct URI for the "manager homepage" is "/manager/html"

That is because :
- navigate to tomcat_dir/server/webapps/manager/WEB-INF
- edit the file web.xml
- in the servlet-mapping paragraphs, you will see one like this :
   <servlet-mapping>
     <servlet-name>HTMLManager</servlet-name>
     <url-pattern>/html/*</url-pattern>
   </servlet-mapping>

If you want to be able to call the Manager homepage with the URL "/manager", then you 
should add one section like this :

   <servlet-mapping>
     <servlet-name>HTMLManager</servlet-name>
     <url-pattern>/*</url-pattern>
   </servlet-mapping>

and restart Tomcat.

This change, in effect, makes HTMLManager be the "default servlet" for the Manager 
application.


I have no idea if this triggers secondary unwanted effects.

If it does not however, then I would respectively suggest to the Tomcat developers to 
incorporate this as a standard servlet-mapping for the Manager, since the other one is a 
bit un-intuitive.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org