Michael Salmon wrote:
Hi all

I'am new to Tomcat, so please do not kill me if the issue is simple or my 
english is bad.

I'am running Tomcat 7.0.42 on WinServer 2012 R2. It is front end for a Digital 
Asset Management system. The Tomcat is installed as part of the DAM system and 
could be different from a plain vanilla install.

My problem is Host and path to webapps.

I basically only have one webapp witch is duplicated when I get a new customer.

But when I deploy a new webapp and make a host element in conf\server.xml, I 
have to make a folder named ROOT  in my webapp (webapps/customer/ROOT) and move 
all files to this folder to get things working. We also did that in a very old 
version (3 or 4), but haven't done that in several years.
I can see the default webapp is also in a ROOT folder.

When I put the files in the ROOT folder my application guy can't see the site 
in his administration tool for the DAM system.

Where is it defined that files for my webapps goes in a ROOT folder?

I tried to make a folder in conf/Catalina/ reflecting the name of the webapp, I 
can't get that to work either.
My last try will be to define docbase in the host element in server.conf, but 
in the documentation this is not recommended.

All help would be appreciated. If you need more info please tell me.


Well, you're right, it's hard not to kill you, but we will try.  This list 
would quickly
get boring if we killed all the newcomers.  And I personally welcome that kind 
of question
anway, because it is one of the few kinds which I can answer, so I get bonus 
points.

First, a note : whenever possible, you should try to avoid modifying 
conf/server.xml.
That's mainly because if you make a change there, you have to restart Tomcat to 
make it
notice.
But in your case, if you create a new <Host> for each new customer, there is no 
other way,
so keep doing it.

Some data : each <Host> in server.xml has its own "appBase", which is the top 
directory in
which "webapps" (also named "context") for that Host are located.
By default, this is "webapps", which is a relative location, which by default 
points to :
(tomcat-installation-directory)/webapps/.
But you can create another directory somewhere, and point the "appBase" of 
another Host to
this new directory, and then this Host will look in that place for its own 
webapps.

Normally, any given application (or "webapp" or "context") is accessed by a URL 
of the
form : http://hostname[:port]/<webapp-name>/
where <webapp-name> is the name of a sub-directory just below the appBase 
directory for
that Host.
So
- if your application would be (imaginatively) named "myWebApp"
- and your Host name would be (imaginatively) named "customer1.customers.com"
- and the corresponding Host tage would be like
  <Host name="customer1.customers.com" appBase="C:/websites/customer1/webapps/" 
...>
then
- the place to put your application would be in 
"C:/websites/customer1/webapps/myWebApp/"
- and the customer would access it via a URL like :
  http://customer1.customers.com/myWebApp/...";

Then, one more thing :
If you want your application to be the "default" webapp, which the user could 
call up with
a URL like : http://customer1.customers.com/
then you have to do the following :
- create a directory "C:/websites/customer1/webapps/ROOT/"
- and place your application there
(That name "ROOT" (in capitals, important) is interpreted by Tomcat in a 
special way, so
that if Tomcat does not recognise the name of the application requested in the 
URL, it
will default to looking there). (Kind of).

Of course, for all of this to work (and for the users to be able to get to that
webserver), the name "customer1.customers.com" would have to be registered in 
the DNS
system, with the IP address of your Tomcat server.

Hope this helps.




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

Reply via email to