You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@eng.sun.com on 2000/01/09 17:41:45 UTC

Proposal: webapp directory and changes in initialization

Hi,

Right now the only way to add a new context is by editing  server.xml.

In addition, I would like the following behavior:
- create a webapps directory

- all webapps we include will be moved to this directory ( webpages,
examples ).

- at startup, tomcat will scan the directory and automatically add any
application.

Issues:
- directory name ?
- naming convention for the directories - one possibility is to use
an encoded name of "context path" ( URL encoded? ).
- webpages need to have a different name that will be recognized as
a ROOT context.
- Contexts that need specific configuration will need an init
file. It can be placed in webapps directory with the same name and .xml
extension, or as  WEB-INF/tomcat.xml ( my favorite), or in a separate
config directory.

Avantages:
- simpler instalation of contexts ( no editing )
- easy integration with native package systems ( we can have web
applications
packaged as PKG or RPM or in InstallShileds)
- will simplify the deploytool
- server.xml will contain server global parameters and contexts that
are installed in non-standard directories.
- clean up the root directory, create something equivalent with htdocs.

Nothing will be implemented until we  have a better ideea of how it
should
work, please help with this one ( I have no ideea what's the "right"
solution
for that, but I think it's important that we sort it out and do
something
in this direction )

Costin





Re: Proposal: webapp directory and changes in initialization

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
costin@eng.sun.com wrote:
> 
> Hi,
> 
> Right now the only way to add a new context is by editing  server.xml.
> 
> In addition, I would like the following behavior:
> - create a webapps directory
> 
> - all webapps we include will be moved to this directory ( webpages,
> examples ).
> 
> - at startup, tomcat will scan the directory and automatically add any
> application.
> 
> Issues:
> - directory name ?
> - naming convention for the directories - one possibility is to use
> an encoded name of "context path" ( URL encoded? ).
> - webpages need to have a different name that will be recognized as
> a ROOT context.
> - Contexts that need specific configuration will need an init
> file. It can be placed in webapps directory with the same name and .xml
> extension, or as  WEB-INF/tomcat.xml ( my favorite), or in a separate
> config directory.
> 
> Avantages:
> - simpler instalation of contexts ( no editing )
> - easy integration with native package systems ( we can have web
> applications
> packaged as PKG or RPM or in InstallShileds)
> - will simplify the deploytool
> - server.xml will contain server global parameters and contexts that
> are installed in non-standard directories.
> - clean up the root directory, create something equivalent with htdocs.
> 
> Nothing will be implemented until we  have a better ideea of how it
> should
> work, please help with this one ( I have no ideea what's the "right"
> solution
> for that, but I think it's important that we sort it out and do
> something
> in this direction )

I agree that it has some nice advantages, but how would you define the
things that's in server.xml besides docBase:

  path
  defaultSessionTimeOut
  isWARExpanded
  isWARValidated
  isInvokerEnabled
  isWorkDirPersistent="false"

If I have to specify this in a separate WEB-INF/tomcat.xml file, I'm
back to editing files again. Wouldn't an admin tool where I can install
new applications and specify all these attributes be a better solution?

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: Proposal: webapp directory and changes in initialization

Posted by Assaf Arkin <ar...@exoffice.com>.
Is it possible that adding a context with a WAR drop-in could ruin the
URL mapping used by a different context?

arkin


costin@eng.sun.com wrote:
> 
> Hi,
> 
> Right now the only way to add a new context is by editing  server.xml.
> 
> In addition, I would like the following behavior:
> - create a webapps directory
> 
> - all webapps we include will be moved to this directory ( webpages,
> examples ).
> 
> - at startup, tomcat will scan the directory and automatically add any
> application.
> 
> Issues:
> - directory name ?
> - naming convention for the directories - one possibility is to use
> an encoded name of "context path" ( URL encoded? ).
> - webpages need to have a different name that will be recognized as
> a ROOT context.
> - Contexts that need specific configuration will need an init
> file. It can be placed in webapps directory with the same name and .xml
> extension, or as  WEB-INF/tomcat.xml ( my favorite), or in a separate
> config directory.
> 
> Avantages:
> - simpler instalation of contexts ( no editing )
> - easy integration with native package systems ( we can have web
> applications
> packaged as PKG or RPM or in InstallShileds)
> - will simplify the deploytool
> - server.xml will contain server global parameters and contexts that
> are installed in non-standard directories.
> - clean up the root directory, create something equivalent with htdocs.
> 
> Nothing will be implemented until we  have a better ideea of how it
> should
> work, please help with this one ( I have no ideea what's the "right"
> solution
> for that, but I think it's important that we sort it out and do
> something
> in this direction )
> 
> Costin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org



Re: Proposal: webapp directory and changes in initialization

Posted by Danno Ferrin <sh...@earthlink.net>.
I think we should go more along the lines of an "extenstions" directory like
Java 2's extensions, but have it semi-configureable.   The default
server.xml would have a pre-configured directory for an "extensions"
directory.  Individual web-apps could still be hard-wired in with random
locations but a directory could be used to search.  Something like

<webappdir location="~tomcat/publicwebs/" root="/public"
policy="~tomcat/restrictive.policy"/>
<webappdir location="~tomcat/trustedweb/" root="/"
policy="~tomcat/dangerous.policy"/>

location is the file system mount to look in, any direcotry or know archive
file with a WEB-INF/web.xml entry/file should be accepted.
root is where to start the contexts prefix, so if foo/ and bar.war were
valid under the first one, they would be mounted as contextx "/public/foo/"
and "/public/bar/"
policy is the Java policy to apply to the classloader.

A default value in the default build mignt be
<webappdir location="./webapps/" root="/" /> <!-- no policy, use JVM default
policy -->

thus anything valid dropped under <build>/webapps would show up under the
root.  Now how do we communctate that to mod_jserv when they have a mixed
root (webapps vs standard HTML)?  That seems to me to be the more critical
question.

costin@eng.sun.com wrote:
> Hi,
>
> Right now the only way to add a new context is by editing  server.xml.
>
> In addition, I would like the following behavior:
> - create a webapps directory
>
> - all webapps we include will be moved to this directory ( webpages,
> examples ).
>
> - at startup, tomcat will scan the directory and automatically add any
> application.
>
> Issues:
> - directory name ?
> - naming convention for the directories - one possibility is to use
> an encoded name of "context path" ( URL encoded? ).
> - webpages need to have a different name that will be recognized as
> a ROOT context.
> - Contexts that need specific configuration will need an init
> file. It can be placed in webapps directory with the same name and .xml
> extension, or as  WEB-INF/tomcat.xml ( my favorite), or in a separate
> config directory.
>
> Avantages:
> - simpler instalation of contexts ( no editing )
> - easy integration with native package systems ( we can have web
> applications
> packaged as PKG or RPM or in InstallShileds)
> - will simplify the deploytool
> - server.xml will contain server global parameters and contexts that
> are installed in non-standard directories.
> - clean up the root directory, create something equivalent with htdocs.
>
> Nothing will be implemented until we  have a better ideea of how it
> should
> work, please help with this one ( I have no ideea what's the "right"
> solution
> for that, but I think it's important that we sort it out and do
> something
> in this direction )
>
> Costin
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>