You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Clough, Don" <dc...@naswa.org> on 2020/04/21 13:20:22 UTC

Removing Tomcat ROOT directory causes the server to hang on startup

Good Morning,

Tomcat version 8.5.15


Is it possible to remove the tomcat ROOT directory? We have several applications running on a tomcat instance. I was asked to clean the webapps directory up and remove any unused folders. I removed manager host-manager docs examples Everything is fine, as I expected. I looked at the ROOT folder an there are images, a couple of jsp pages and a WEB-INF directory. None of these are used by our applications, so I removed the ROOT directory. Now the server hangs on startup and my applications don't start. Can the ROOT directory be removed? It appears that according to the Apache docs it is optional:

"The ROOT web application presents a very low security risk but it does include the version of Tomcat that is being used. The ROOT web application should normally be removed from a publicly accessible Tomcat instance, not for security reasons, but so that a more appropriate default page is shown to users."

I tried leaving just an empty ROOT directory, but it still hangs. Is there a configuration that I'm missing somewhere that could be looking for the ROOT directory?


Thanks,

Don


Don Clough | Java Developer
National Association of State Workforce Agencies
444 North Capitol St., NW | Suite 142 | Washington, DC 20001
E dclough@naswa.org<ma...@naswa.org>| W naswa.org<http://www.naswa.org/>

[naswa]
[naswa2]<https://twitter.com/NASWAORG>  [naswa3] <https://www.linkedin.com/company/national-asociation-of-state-workforce-agencies>   [naswa4] <https://www.facebook.com/NASWAorg/>

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.

Re: Removing Tomcat ROOT directory causes the server to hang on startup

Posted by calder <ca...@gmail.com>.
On Tue, Apr 21, 2020, 08:20 Clough, Don <dc...@naswa.org> wrote:

> Good Morning,
>
> Tomcat version 8.5.15
>
> Is it possible to remove the tomcat ROOT directory?
>

Yes - not required ... unless you want the functionality provided therein.

Re: [OT] Removing Tomcat ROOT directory causes the server to hang on startup

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

Don,

On 4/22/20 09:12, Clough, Don wrote:
> Thanks for all the feedback! I will continue to debug why our
> particular installation hangs when I remove the ROOT. I was able to
> do this on a fresh installation on my local machine.

Take some thread dumps to find out what's happening.

Wild guess without any other information: you are out of entropy, and
you'll find that either TLS initialization or session-manager
initialization is where things hang-up. (This will have nothing to do
with the presence of the ROOT web app).

- -chris

> -----Original Message----- From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Tuesday, April 21, 2020 6:33
> PM To: users@tomcat.apache.org Subject: Re: [OT] Removing Tomcat
> ROOT directory causes the server
to hang on startup
>
> Don,
>
> On 4/21/20 09:20, Clough, Don wrote:
>> Is it possible to remove the tomcat ROOT directory? We have
>> several applications running on a tomcat instance. I was asked to
>> clean the webapps directory up and remove any unused folders.
> This is a good idea. But it's also a good idea to have a ROOT web
> application. It just doesn't have to be (and shouldn't be!) the
> default Tomcat root web application.
>
> Why?
>
> Well, if you navigate to /doesnotexist.html or
> /does/not/exist.html, unless your application is ROOT or happens to
> be mounted on "/does", Tomcat has no application to "assign" the
> request to, so it MUST generate a generic error message.
>
> If you want to be able to handle all possible 404 responses with a
> nice, application-branded "not found" page, you'll need to roll a
> ROOT web application which has just some basic configuration for
> things like errors, and the pages which will be returned when you
> get those errors.
>
> -chris
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> Disclaimer
>
> The information contained in this communication from the sender is
confidential. It is intended solely for use by the recipient and
others authorized to receive it. If you are not the recipient, you are
hereby notified that any disclosure, copying, distribution or taking
action in relation of the contents of this information is strictly
prohibited and may be unlawful.
>
> This email has been scanned for viruses and malware, and may have
been automatically archived by Mimecast Ltd, an innovator in Software
as a Service (SaaS) for business. Providing a safer and more useful
place for your human generated data. Specializing in; Security,
archiving and compliance. To find out more visit the Mimecast website.
>
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6gWkoACgkQHPApP6U8
pFjuHQ/8DMMu5QK9+RuOzxfTV8mTEltNjwC30HoK+jlWWUTMevPDEoa8h5NNZVUK
FdIPaI5eSYqpkdv9WEFZoY9ANhclClfTSHoGSl823qCjrR/D0lHi9p6hVPgWTN3a
F2FjgkkO/d7rFexZCJO0poE5BXyPKfMUePP6KPE99MB+GFJ+oPFBA7UDbyv2L0Ev
4PShWSVpps5eTLB05DZoOdM3qIhXgoqwn4a5cG8DixE3jPQsTVtyYF91b3YgH34g
YkY0j7F80EiCdYRM4QggxOvpqwrMGsNdtlT6kyU+mixZvD2PV5Yblex1yG0cHim4
uoa2/Jo//I5nVQupAuImjnDZ4476131l7yY4HvgcmG4VqheUn4FwxhdrK4b+019K
xYk6QcpUuY+e4MFhB3xe0Qa227C8Qk2rlZGGYpwrO/P2BAuSJcjwoqUOJ/WAsIqZ
Sqh8aNsCvZO8z+aGdvawTwnLWez/zgBI0FlIvJpj16csNpc+pgYwiz0FQE5gIpo6
1NdKE03DkgaffcI2gAm2/Ofzh4jl2ce/BDWf+ENm9YP8zNJoZLbZC8ITPfISX/pw
Cl5UxtMKF9lcxEiZKxYfcHKjryPlTyQLejP1qRbfbnqBx9+OPd6esFYeH5UgwqwF
qBTh/urA6j6hgUWRXqKkKx0G/kZ9G9TZV3jUAPMYzZUol9kF+Vo=
=8hg5
-----END PGP SIGNATURE-----

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


RE: [OT] Removing Tomcat ROOT directory causes the server to hang on startup

Posted by "Clough, Don" <dc...@naswa.org>.
Thanks for all the feedback! I will continue to debug why our particular installation hangs when I remove the ROOT. I was able to do this on a fresh installation on my local machine. 

-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net> 
Sent: Tuesday, April 21, 2020 6:33 PM
To: users@tomcat.apache.org
Subject: Re: [OT] Removing Tomcat ROOT directory causes the server to hang on startup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Don,

On 4/21/20 09:20, Clough, Don wrote:
> Is it possible to remove the tomcat ROOT directory? We have several 
> applications running on a tomcat instance. I was asked to clean the 
> webapps directory up and remove any unused folders.
This is a good idea. But it's also a good idea to have a ROOT web application. It just doesn't have to be (and shouldn't be!) the default Tomcat root web application.

Why?

Well, if you navigate to /doesnotexist.html or /does/not/exist.html, unless your application is ROOT or happens to be mounted on "/does", Tomcat has no application to "assign" the request to, so it MUST generate a generic error message.

If you want to be able to handle all possible 404 responses with a nice, application-branded "not found" page, you'll need to roll a ROOT web application which has just some basic configuration for things like errors, and the pages which will be returned when you get those errors.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6fdIgACgkQHPApP6U8
pFjbmhAAqcqiusrD++bvPNY2BuQmd3eLV8P7Hyis9s9US+E55hPM0WyiZGjfSohQ
Cb1FOpyUvt1WMx/irY8RY+o3aBAYYV8iHR7ydabFRyMhoFQYPislwvW9XnGHKIvE
fQx8p+Z4Vr32GywvrbhFGA7eeQrN+j5jfv/pt8fCTDTSpchTgmfOEIbfKi+BcoMg
ljvJmww+0XDY+z0SgZo47Nczw18WP9pOa0Q8xxHHw1tVLJRLG1RW6Z/B7+BE6UdH
r6ly1A3I59duBHiummwiMOBBGivXaP090lM9GHCWHhkrP32YjXpb34HPt3QcoV5K
ZRep0g06EyyUt1TR2aCzLDAN8zsCq6nJJsXrovXrsm60fJ+aLir3PAfyEsTYEPR7
r5HsJO3T+gpIwqb/lpxSAaML5VbmVNf8dpih5Q2iS2dELGN9WddiEZOO60ztXWfQ
KofJbuqIsnmD2XcZTexdCoJmKb+3huOmW6LWtZ+6hrq/9EgvI4ZfV3DvdRELC/JL
f7u/3AbuPo8vg/H81KEaqZja6RxhuDjoSV+w08zyaaXupNPi5rG3zoNajgmatfpf
GCZNSVnu7++Rk0HDwuFgbNyqDa0Po7Ah33HNUe7K3fpFIHEC7+vDN9A3kXjPjNaA
F45M3l8Z1BKsW0GK+kFcL0/Cn514CrcioQae62nyvZw9U4wm9rI=
=B8Ar
-----END PGP SIGNATURE-----

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

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.

Re: [OT] Removing Tomcat ROOT directory causes the server to hang on startup

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

Don,

On 4/21/20 09:20, Clough, Don wrote:
> Is it possible to remove the tomcat ROOT directory? We have
> several applications running on a tomcat instance. I was asked to
> clean the webapps directory up and remove any unused folders.
This is a good idea. But it's also a good idea to have a ROOT web
application. It just doesn't have to be (and shouldn't be!) the
default Tomcat root web application.

Why?

Well, if you navigate to /doesnotexist.html or /does/not/exist.html,
unless your application is ROOT or happens to be mounted on "/does",
Tomcat has no application to "assign" the request to, so it MUST
generate a generic error message.

If you want to be able to handle all possible 404 responses with a
nice, application-branded "not found" page, you'll need to roll a ROOT
web application which has just some basic configuration for things
like errors, and the pages which will be returned when you get those
errors.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6fdIgACgkQHPApP6U8
pFjbmhAAqcqiusrD++bvPNY2BuQmd3eLV8P7Hyis9s9US+E55hPM0WyiZGjfSohQ
Cb1FOpyUvt1WMx/irY8RY+o3aBAYYV8iHR7ydabFRyMhoFQYPislwvW9XnGHKIvE
fQx8p+Z4Vr32GywvrbhFGA7eeQrN+j5jfv/pt8fCTDTSpchTgmfOEIbfKi+BcoMg
ljvJmww+0XDY+z0SgZo47Nczw18WP9pOa0Q8xxHHw1tVLJRLG1RW6Z/B7+BE6UdH
r6ly1A3I59duBHiummwiMOBBGivXaP090lM9GHCWHhkrP32YjXpb34HPt3QcoV5K
ZRep0g06EyyUt1TR2aCzLDAN8zsCq6nJJsXrovXrsm60fJ+aLir3PAfyEsTYEPR7
r5HsJO3T+gpIwqb/lpxSAaML5VbmVNf8dpih5Q2iS2dELGN9WddiEZOO60ztXWfQ
KofJbuqIsnmD2XcZTexdCoJmKb+3huOmW6LWtZ+6hrq/9EgvI4ZfV3DvdRELC/JL
f7u/3AbuPo8vg/H81KEaqZja6RxhuDjoSV+w08zyaaXupNPi5rG3zoNajgmatfpf
GCZNSVnu7++Rk0HDwuFgbNyqDa0Po7Ah33HNUe7K3fpFIHEC7+vDN9A3kXjPjNaA
F45M3l8Z1BKsW0GK+kFcL0/Cn514CrcioQae62nyvZw9U4wm9rI=
=B8Ar
-----END PGP SIGNATURE-----

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


Re: Removing Tomcat ROOT directory causes the server to hang on startup

Posted by Mark Thomas <ma...@apache.org>.
On 21/04/2020 14:20, Clough, Don wrote:
> Good Morning,
> 
> Tomcat version 8.5.15
> 
> Is it possible to remove the tomcat ROOT directory? We have several
> applications running on a tomcat instance. I was asked to clean the
> webapps directory up and remove any unused folders. I removed manager
> host-manager docs examples Everything is fine, as I expected. I looked
> at the ROOT folder an there are images, a couple of jsp pages and a
> WEB-INF directory. None of these are used by our applications, so I
> removed the ROOT directory. Now the server hangs on startup and my
> applications don't start. Can the ROOT directory be removed? It appears
> that according to the Apache docs it is optional:
> 
> "The ROOT web application presents a very low security risk but it does
> include the version of Tomcat that is being used. The ROOT web
> application should normally be removed from a publicly accessible Tomcat
> instance, not for security reasons, but so that a more appropriate
> default page is shown to users."
> 
> I tried leaving just an empty ROOT directory, but it still hangs. Is
> there a configuration that I'm missing somewhere that could be looking
> for the ROOT directory?

Not in Tomcat. Possibly in one of the additional applications that has
been deployed.

Tomcat 8.5.x starts quite happily with the ROOT web application removed.

Mark

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


Re: Removing Tomcat ROOT directory causes the server to hang on startup

Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 4/21/20 6:20 AM, Clough, Don wrote:
> Is it possible to remove the tomcat ROOT directory? We have several
> applications running on a tomcat instance. I was asked to clean the
> webapps directory up and remove any unused folders.
Of course it is. The ROOT that comes with Tomcat is simply a 
demonstration webapp, and can be removed and/or replaced like any other 
webapp. Our normal "new installation" procedure, for example, is to 
remove everything but manager and host-manager, and plug our own webapp 
in as the ROOT context.

--
James H. H. Lampert
Touchtone Corporation

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