You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Guild, Jason A (DOT)" <ja...@alaska.gov> on 2019/12/04 22:20:16 UTC

override context path for manager application

Hi all:

The context path of the Tomcat manager application is "/manager" by default [0].
I am trying to change this context path from the default using an override configuration.

I am doing the typical creation of a container using makebase.sh and setting CATALINA_BASE before starting it.

To enable the manager application on these containers, I create a file $CATALINA_BASE/conf/[engine]/[host]/manager.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/manager" docBase="${catalina.home}/webapps/manager" antiResourceLocking="false" privileged="true">
</Context>
In catalina.out I see the following log output:
04-Dec-2019 12:54:07.063 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/home/tomcat/servers/dev9/conf/Catalina/localhost/manager.xml] has finished in [200] ms
The manager application is mapped into my container at "/manager" and is functional in every way.

But if I use a manager.xml to map the manager application into my container with an offset path like the following:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/dev9/manager" docBase="${catalina.home}/webapps/manager" antiResourceLocking="false" privileged="true">
</Context>
I see the following log output in catalina.out instead:
04-Dec-2019 13:08:42.089 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/dev9/manager] in deployment descriptor [/home/tomcat/servers/dev9/conf/Catalina/localhost/manager.xml] has been ignored
04-Dec-2019 13:08:42.333 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/home/tomcat/servers/dev9/conf/Catalina/dotancappdev1/manager.xml] has finished in [245] ms

Why is my override path of "/dev9/manager" ignored?
Can the context path of the manager and host-manager applications be changed?

The documentation implies that "/manager" is only a default, and it seems I should be able to change it but have had no success.
My environment is Tomcat 9.0.29 with OpenJDK 1.8.0_232 on Debian Linux.

Thanks,
Jason

[0] https://tomcat.apache.org/tomcat-9.0-doc/manager-howto.html#Introduction<https://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html#Introduction>


Re: override context path for manager application

Posted by "Guild, Jason A (DOT)" <ja...@alaska.gov>.
Konstantin:

Thank you for your point #1 below!
When I remove "path" attribute entirely from my override configuration 
and save it as "dev9#manager.xml" then I get exactly the result I want.

However, I did not need to move the manager application from the 
"${catalina.home}/webapps" directory as in your point #2.
I am running my container from a completely separate directory structure 
with $CATALINA_BASE != $CATALINA_HOME and $CATALINA_BASE/webapps/ does 
NOT contain the manager application.

I think your point #2 would be correct if I simply decompressed the 
Tomcat distribution and ran it with $CATALINA_BASE == $CATALINA_HOME and 
I was just adding a file to 
$CATALINA_HOME/conf/[engine]/[host]/dev9#manager.xml in an attempt to 
override the context path.

Thanks again for your help,
Jason

On 12/4/2019 1:32 PM, Konstantin Kolinko wrote:
> If you want to rename the application, you must do the following:
>
> 1) first, rename the file itself, e.g. to
>
> $CATALINA_BASE/conf/[engine]/[host]/dev9#manager.xml
>
> $CATALINA_BASE/conf/[engine]/[host]/mymanager.xml
>
> etc.
>
> 2) second, you must move the manager application from
> "${catalina.home}/webapps/" to some other directory.
>
> The applications in "webapps/" directory are auto-deployed when Tomcat
> starts. If you keep the manager app there, it will be deployed twice,
> with the new and with the old name.


Re: override context path for manager application

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Konstantin,

On 12/4/19 17:32, Konstantin Kolinko wrote:
> чт, 5 дек. 2019 г. в 01:20, Guild, Jason A (DOT)
> <ja...@alaska.gov>:
>> 
>> Hi all:
>> 
>> The context path of the Tomcat manager application is "/manager"
>> by default [0]. I am trying to change this context path from the
>> default using an override configuration.
>> 
>> I am doing the typical creation of a container using makebase.sh
>> and setting CATALINA_BASE before starting it.
>> 
>> To enable the manager application on these containers, I create a
>> file $CATALINA_BASE/conf/[engine]/[host]/manager.xml with the
>> following content: <?xml version="1.0" encoding="UTF-8"?> 
>> <Context path="/manager"
>> docBase="${catalina.home}/webapps/manager"
>> antiResourceLocking="false" privileged="true"> </Context>
> 
> The usage of "path" attribute above is invalid. It must never be
> used in a context xml file and it is ignored there, because the
> path is derived from the name of the file.
> 
> See http://tomcat.apache.org/tomcat-9.0-doc/config/context.html
> 
> If you want to rename the application, you must do the following:
> 
> 1) first, rename the file itself, e.g. to
> 
> $CATALINA_BASE/conf/[engine]/[host]/dev9#manager.xml
> 
> $CATALINA_BASE/conf/[engine]/[host]/mymanager.xml
> 
> etc.
> 
> 2) second, you must move the manager application from 
> "${catalina.home}/webapps/" to some other directory.
> 
> The applications in "webapps/" directory are auto-deployed when
> Tomcat starts. If you keep the manager app there, it will be
> deployed twice, with the new and with the old name.

This should not be necessary. The OP is using a split CATALINA_BASE
and so CATALINA_HOME/webapps/manager will not be auto-deployed.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3oOe8ACgkQHPApP6U8
pFjKpg//aYxvnSSIjh/Lj7J8Ro8jITGiM6O2T5jyYARfKHI3pyEwL6QQKivHlwZe
cO77574BH7IPlnvnHNeX0v3HmHmN0i5ArzIfACHpFCPWC/NMiz0WE2lawjgDpYfA
i8g4/LkNwPIHerf/V3UckjidOx+rjzKqJlZ4O6qXPHbv9/COSslk8Z308HU+W7N5
cJLwO0DCn3iD1WY46aCo/Tp7rdD5SymZp5VZUZwWYLDNVwVgfQAZmTsN3J7qCfZR
DQzIgN8M0vFQIhDRjBzVfPPYmZieHFIv7Zb5fc80JME3WqCzEyplsRKCTKz32vO+
LMWVJ53+RD2ljfYdbdpd6qnXLhzyJQW4TGrV+hSfGhVukV5I5DCTGHt4n5eBj0cX
TLnjX29qKpS7f2r8dglbRVXV4trCh7DNwstWOYSzlLy5csOtIdtS5yIOkKyhj6Uv
ywDzQ5gfB79hdN1zufWjQr6x4fpIDlJrcD4AE0Mp2fNAcFGt0j35nLSiqg2qmFir
iORrhrDB8s4OTdRINq1+K5c4Ot1Hb+e/XtdfhW/OfMxQdPNGEvBvPBPXqEmDxGPA
ifhGkYdJEkrov+IiJb4GIkFerzms0uknXOHlESuAv9CsZU9MuyPN1Ebgn0LVjHsK
OW9d83T2MEVCWjq0BaX+pNK1E5uWZeRXxiJg/SVXP+JP0n1N5wg=
=3TDw
-----END PGP SIGNATURE-----

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


Re: override context path for manager application

Posted by Konstantin Kolinko <kn...@gmail.com>.
чт, 5 дек. 2019 г. в 01:20, Guild, Jason A (DOT) <ja...@alaska.gov>:
>
> Hi all:
>
> The context path of the Tomcat manager application is "/manager" by default [0].
> I am trying to change this context path from the default using an override configuration.
>
> I am doing the typical creation of a container using makebase.sh and setting CATALINA_BASE before starting it.
>
> To enable the manager application on these containers, I create a file $CATALINA_BASE/conf/[engine]/[host]/manager.xml with the following content:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/manager" docBase="${catalina.home}/webapps/manager" antiResourceLocking="false" privileged="true">
> </Context>

The usage of "path" attribute above is invalid. It must never be used
in a context xml file and it is ignored there,
because the path is derived from the name of the file.

See
http://tomcat.apache.org/tomcat-9.0-doc/config/context.html

If you want to rename the application, you must do the following:

1) first, rename the file itself, e.g. to

$CATALINA_BASE/conf/[engine]/[host]/dev9#manager.xml

$CATALINA_BASE/conf/[engine]/[host]/mymanager.xml

etc.

2) second, you must move the manager application from
"${catalina.home}/webapps/" to some other directory.

The applications in "webapps/" directory are auto-deployed when Tomcat
starts. If you keep the manager app there, it will be deployed twice,
with the new and with the old name.

> [..]
>
> Why is my override path of "/dev9/manager" ignored?

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