Issue
When you run Tomcat in Eclipse, there are three conf directories:
- the one in CATALINA_HOME (the "Tomcat installation directory")
- the one displayed in Eclipse under the Servers "project", and found on the filesystem in e.g.
workspace/Servers/Tomcat v9.0 Server at localhost-config - the one in CATALINA_BASE (e.g.
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf)
What is the difference between the three, and from which directory does Tomcat actually load its configuration files?
(For those like me who are new to Tomcat, see the difference between CATALINA_BASE and CATALINA_HOME. Also see this similar question about the webapps directory.)
Solution
When you first add the Tomcat server to Eclipse, Eclipse copies the configuration files from CATALINA_HOME (#1 above) to the Servers project (#2). Every time it publishes to Tomcat, Eclipse copies the files from the Servers project to CATALINA_BASE (tmp0/conf, #3), from which Tomcat loads them.
In other words, the files in the Servers project are the lasting conf files. They may be edited by hand, and Eclipse also updates them to reflect configuration within Eclipse (e.g., when you add a webapp). Eclipse repeatedly uses them to overwrite the files in CATALINE_BASE. The files in the Servers project are initially derived from the files in CATALINA_HOME, after which the latter files are ignored.
Answered By - Dan R.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.