Re: Configuring Tomcat manager application upload limit

2015-04-17 Thread Dominic Hargreaves
On Wed, Apr 15, 2015 at 08:33:00AM -0500, Mark Thomas wrote:
 On 15/04/2015 05:28, Dominic Hargreaves wrote:

  I am running the Tomcat manager application via a Debian package
  (tomcat8-admin), which deploys the webapp from
  /usr/share/tomcat8-admin/manager. We ran into a problem hitting th 
  maximum upload size (configured as the multipart-config element in the
  HTMLManager servlet block). This is easy to fix if you're willing to
  edit Debian-packaged files, but this is incorrect: files in /usr/share
  are owned exclusively by dpkg. Is there a way to override this element
  from somewhere in tomcat's conf directory (which is symlinked to
  /etc/tomcat8 in Debian)?
 
 No. The web application setting would take priority.

Okay, thanks for confirming.

  If it's not possible to override this at the moment, then is this a bug
  in Tomcat, or the Debian packaging?
 
 I'd say the bug is in the Debian packaging (but I would say that
 wouldn't I).
 
 Without know how Tomcat is packaged in Debian, I would expect the following:
 - the Manager web application to be a separate, optional package

Yep, it is.

 - the web.xml to be placed in an appropriate location for users to be
 able to edit it.
 
 I took a quick look through the web.xml for the Manager app. There are
 plenty of settings I wouldn't expect to change but there are a handful
 of things that users might want to tweak.
 
 In theory, it should be possible to move those settings to context.xml
 but that would require code changes and would mean do things that were
 contrary to the spirit of the servlet spec so there would likely be
 resistance to such changes from the Tomcat community.
 
 One option would be for Debian to use external entities for the
 configurable elements and place the file that defines those entities
 somewhere where users can edit it.

Okay, that's an interesting idea if it's possible to agree on a sane set :)

Thanks for your feedback!

Cheers,
Dominic.

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



Re: Configuring Tomcat manager application upload limit

2015-04-17 Thread Konstantin Kolinko
2015-04-17 13:52 GMT+03:00 Mark Thomas ma...@apache.org:
 On 17 April 2015 09:37:40 BST, Dominic Hargreaves d...@earth.li wrote:
On Wed, Apr 15, 2015 at 08:33:00AM -0500, Mark Thomas wrote:
 On 15/04/2015 05:28, Dominic Hargreaves wrote:

  I am running the Tomcat manager application via a Debian package
  (tomcat8-admin), which deploys the webapp from
  /usr/share/tomcat8-admin/manager. We ran into a problem hitting th
  maximum upload size (configured as the multipart-config element in
the
  HTMLManager servlet block). This is easy to fix if you're willing
to
  edit Debian-packaged files, but this is incorrect: files in
/usr/share
  are owned exclusively by dpkg. Is there a way to override this
element
  from somewhere in tomcat's conf directory (which is symlinked to
  /etc/tomcat8 in Debian)?

 No. The web application setting would take priority.

Okay, thanks for confirming.

  If it's not possible to override this at the moment, then is this a
bug
  in Tomcat, or the Debian packaging?

 I'd say the bug is in the Debian packaging (but I would say that
 wouldn't I).

 Without know how Tomcat is packaged in Debian, I would expect the
following:
 - the Manager web application to be a separate, optional package

Yep, it is.

 - the web.xml to be placed in an appropriate location for users to be
 able to edit it.

 I took a quick look through the web.xml for the Manager app. There
are
 plenty of settings I wouldn't expect to change but there are a
handful
 of things that users might want to tweak.

 In theory, it should be possible to move those settings to
context.xml
 but that would require code changes and would mean do things that
were
 contrary to the spirit of the servlet spec so there would likely be
 resistance to such changes from the Tomcat community.

 One option would be for Debian to use external entities for the
 configurable elements and place the file that defines those entities
 somewhere where users can edit it.

Okay, that's an interesting idea if it's possible to agree on a sane
set :)

Thanks for your feedback!

 Another option (I think) is to use the property replacement feature. I.e. 
 ${property.name} in web.xml and property.name=foo in catalina.properties

 The only question is if this works in web.xml which I don't recall and I 
 don't have easy access to the source to check. If it doesn't work we should 
 be able to fix that easily.

+1. I am sure that it works in web.xml.

Also things to note:

1) It is recommended to configure an IP filter (RemoteAddrValve) for
manager web application in its context file.

http://tomcat.apache.org/tomcat-8.0-doc/security-howto.html#Securing_Management_Applications

2) It should be possible to shadow (override) WEB-INF/web.xml of an
application by configuring a PreResources element in its context
file,

http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

3) You can rename the application, configure it, pack into a war and
upload via the default manager app.

The name of the manager application does not matter. It can be renamed.

(If you are running with java SecurityManager enabled, it will require
additional configuration in policy file, and to configure context file
for the application).

Best regards,
Konstantin Kolinko

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



Re: Configuring Tomcat manager application upload limit

2015-04-17 Thread Mark Thomas
On 17 April 2015 09:37:40 BST, Dominic Hargreaves d...@earth.li wrote:
On Wed, Apr 15, 2015 at 08:33:00AM -0500, Mark Thomas wrote:
 On 15/04/2015 05:28, Dominic Hargreaves wrote:

  I am running the Tomcat manager application via a Debian package
  (tomcat8-admin), which deploys the webapp from
  /usr/share/tomcat8-admin/manager. We ran into a problem hitting th 
  maximum upload size (configured as the multipart-config element in
the
  HTMLManager servlet block). This is easy to fix if you're willing
to
  edit Debian-packaged files, but this is incorrect: files in
/usr/share
  are owned exclusively by dpkg. Is there a way to override this
element
  from somewhere in tomcat's conf directory (which is symlinked to
  /etc/tomcat8 in Debian)?
 
 No. The web application setting would take priority.

Okay, thanks for confirming.

  If it's not possible to override this at the moment, then is this a
bug
  in Tomcat, or the Debian packaging?
 
 I'd say the bug is in the Debian packaging (but I would say that
 wouldn't I).
 
 Without know how Tomcat is packaged in Debian, I would expect the
following:
 - the Manager web application to be a separate, optional package

Yep, it is.

 - the web.xml to be placed in an appropriate location for users to be
 able to edit it.
 
 I took a quick look through the web.xml for the Manager app. There
are
 plenty of settings I wouldn't expect to change but there are a
handful
 of things that users might want to tweak.
 
 In theory, it should be possible to move those settings to
context.xml
 but that would require code changes and would mean do things that
were
 contrary to the spirit of the servlet spec so there would likely be
 resistance to such changes from the Tomcat community.
 
 One option would be for Debian to use external entities for the
 configurable elements and place the file that defines those entities
 somewhere where users can edit it.

Okay, that's an interesting idea if it's possible to agree on a sane
set :)

Thanks for your feedback!

Another option (I think) is to use the property replacement feature. I.e. 
${property.name} in web.xml and property.name=foo in catalina.properties

The only question is if this works in web.xml which I don't recall and I don't 
have easy access to the source to check. If it doesn't work we should be able 
to fix that easily. 


Mark



Cheers,
Dominic.

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



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



Re: Configuring Tomcat manager application upload limit

2015-04-15 Thread Mark Thomas
On 15/04/2015 05:28, Dominic Hargreaves wrote:
 Hello,
 
 This is reposted from [1] and [2]; the Debian maintainers of the package
 suggested I ask for advice here.
 
 I am running the Tomcat manager application via a Debian package
 (tomcat8-admin), which deploys the webapp from
 /usr/share/tomcat8-admin/manager. We ran into a problem hitting th 
 maximum upload size (configured as the multipart-config element in the
 HTMLManager servlet block). This is easy to fix if you're willing to
 edit Debian-packaged files, but this is incorrect: files in /usr/share
 are owned exclusively by dpkg. Is there a way to override this element
 from somewhere in tomcat's conf directory (which is symlinked to
 /etc/tomcat8 in Debian)?

No. The web application setting would take priority.

 Searching for this problem on the web only results in suggestions about
 editing web.xml directly (eg http://www.giantgeek.com/blog/?p=1000) or
 about different programming approaches using context parameters (if I
 understand correctly; I'm not especially familiar with the jargon).
 
 If it's not possible to override this at the moment, then is this a bug
 in Tomcat, or the Debian packaging?

I'd say the bug is in the Debian packaging (but I would say that
wouldn't I).

Without know how Tomcat is packaged in Debian, I would expect the following:
- the Manager web application to be a separate, optional package
- the web.xml to be placed in an appropriate location for users to be
able to edit it.

I took a quick look through the web.xml for the Manager app. There are
plenty of settings I wouldn't expect to change but there are a handful
of things that users might want to tweak.

In theory, it should be possible to move those settings to context.xml
but that would require code changes and would mean do things that were
contrary to the spirit of the servlet spec so there would likely be
resistance to such changes from the Tomcat community.

One option would be for Debian to use external entities for the
configurable elements and place the file that defines those entities
somewhere where users can edit it.

 Of course I could maintain a local version of the Debian package with
 this overriden, but for such an apparently-obvious piece of configuration
 that seems wrong too.

Agreed.

Mark


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



Configuring Tomcat manager application upload limit

2015-04-15 Thread Dominic Hargreaves
Hello,

This is reposted from [1] and [2]; the Debian maintainers of the package
suggested I ask for advice here.

I am running the Tomcat manager application via a Debian package
(tomcat8-admin), which deploys the webapp from
/usr/share/tomcat8-admin/manager. We ran into a problem hitting th 
maximum upload size (configured as the multipart-config element in the
HTMLManager servlet block). This is easy to fix if you're willing to
edit Debian-packaged files, but this is incorrect: files in /usr/share
are owned exclusively by dpkg. Is there a way to override this element
from somewhere in tomcat's conf directory (which is symlinked to
/etc/tomcat8 in Debian)?

Searching for this problem on the web only results in suggestions about
editing web.xml directly (eg http://www.giantgeek.com/blog/?p=1000) or
about different programming approaches using context parameters (if I
understand correctly; I'm not especially familiar with the jargon).

If it's not possible to override this at the moment, then is this a bug
in Tomcat, or the Debian packaging?

Of course I could maintain a local version of the Debian package with
this overriden, but for such an apparently-obvious piece of configuration
that seems wrong too.

Thanks,
Dominic.

[1] 
http://serverfault.com/questions/681211/overriding-parts-of-a-webapps-web-xml-in-tomcat-eg-manager-application-max-fil
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782635

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