The organization of webapps isn't tree oriented on disk. It's a flat list of webapps on disk with the "default" webapp being named the special name ROOT (defined by the servlet spec). If you need webapps organized deeper than the top level (ie /myWeb/path/app), then you use the pound symbol as a path separator in the webapp's name (ie myWeb#path#app). Unfortunately that trick seems to only work in a very limited set of circumstances. You can search the list for where this works or doesn't work.

Don't overlap the webapps directory and the apache httpd virtual directory. It's cleaner to keep the two separated. Instead organize your content so static resources served by apache httpd are in a apache httpd directory. It seems to me what you are really after is the way php works and you can't get that with tomcat.

--David

Scott Dunbar wrote:
Thanks for the input.  However, I guess I'm still missing something.

I want a directory to be the root directory of a virtual host. That directory is itself a webapp and may have other directories within it that are webapps (with explicit Context elements). To this point I have never had to have a different directory from my default stuff. In effect this change means that there is no such thing as a default webapp directory - it must be explicitly enumerated. There is a Tomcat proprietary convention of naming a default one ROOT but that will complicate my move to any other app server. It also complicates an Apache httpd and Tomcat environment. Previously I was able to put the Apache httpd VirtualHost DocumentRoot and the Tomcat Host appBase at the same place and have httpd serve static content while Tomcat served dynamic content. Now I have to change my directory structure because there are really two different places to get root level things. For example, doing a jsp:include of /something.jsp comes from a different directory than including CSS from /styles.css. This just seems more complicated to me. You really can not overlay VirtualHost's and Host's anymore.

Is what I'm trying to do wrong? My frustration stems from the fact that I always been able to have a directory that is the root and, optionally, separate directories under the root that are webapps with their own Context. What you're saying is that I can't do that - I need an explicit directory for my default webapp that is different from the root of the virtual host (though it can be a child of it). That complicates the directory structure and, since the Tomcat 3.x days through at least 5.5.15 is not the way it worked.

I guess what I'm looking for is a true default Context but it seems that that no longer exists - it must be explicit. This could explain some other problems I'm having with JRoller not being able to be the top of a virtual host anymore with 5.5.23 (and, with some experimentation, 5.5.20 also).

I'll continue to experiment - thanks for your help.



Mark Thomas wrote:
Scott Dunbar wrote:
Thanks, I checked that and my I don't set a docBase in my context:

<Host name="domainname.tld" appBase="/home/scott/sites/domainname.tld"
             unpackWARs="true" autoDeploy="true"
             xmlValidation="false" xmlNamespaceAware="false">

           <Context path="" docBase="" />

And there is the problem. If it isn't absolute, docBase is relative to
appBase so you do have appBase == docBase

To fix this:
- remove the Context element from your server.xml
- assuming you have only one webapp deployed, move the contents of
/home/scott/sites/domainname.tld to /home/scott/sites/domainname.tld/ROOT
- if you have multiple webapps deployed, just move the files that are
part of the ROOT webapp

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to