Hi,

I'm currently trying to understand the best practices for tomcat6
application deployments given certain restrictions:
1 - We deploy exploded dirs only, not WAR files
2 - We need to be able to hot deploy jsps (but not classes/jars)
without restarting tomcat
3 - The application must be the ROOT or base webapp

Environment:
- RedHat Enterprise 4
- tomcat 6.0.18
- sun jdk 1.6.u012
- apache httpd 2.0.2 (with redhat bug fixes etc - I'm uncertain what
the exact version is)
- mod_jk (latest)
- apr 1.3.3 (built from src)
- apr-util 1.3.4 (built from src)
- libtcnative (latest)
- using tomcat-jdbc connection pool implementation after commons-dbcp
failed under high load and c3p0 also failed - recommended by one of
the tomcat developers

Currently we have the following
$CATALINA_HOME/webapps/
- app
- ROOT -> app

$CATALINA_HOME/conf/Catalina/localhost/
- app.xml
- ROOT.xml -> app.xml

Where our app is symbolically linked to ROOT.xml and a ROOT dir respectively.

In my previous tomcat6 experience, I've deployed war files, either by
hand or using a custom maven plugin. So I'm a little unsure if our
current configuration is broken.  I suspect we may be causing the
container to attempt to load the application twice - but I'd like some
confirmation.

I think the following structure would be more managable and probably
better for tomcat too:

$CATALINA_HOME/conf/Catalina/localhost/
- ROOT.xml -> /deployments/app.xml

/deployments/
- app.xml
- app

Again where the ROOT.xml is a sumbolic link

The Context configuration to achieve this separation of the
application from the tomcat directory structure I presume would look
something like:

<Context path="/" docBase="/deployments/app" debug="1"
reloadable="true" cookies="true">
  <Environment
    name="####"
    value="####"
    type="java.lang.String"
    override="false"/>

  <Environment
    name="SEARCH-SERVICE_URL"
    value="####"
    type="java.lang.String"
    override="false"/>

  <Resource
    name="jdbc/####"
    scope="Shareable"
    type="javax.sql.DataSource"
    auth="Container"
    username="####"
    password="####"
    factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
    driverClassName="net.sourceforge.jtds.jdbc.Driver"
    url="jdbc:jtds:sqlserver://#####"
    removeAbandoned="true"
    logAbandoned="true"
    maxActive="150"
    maxIdle="30"
    minIdle="20"
    initialSize="20"
    maxWait="10000"
    validationQuery="SELECT count(1) from #####"
    />

  <Resource
    name="mail/Session"
    auth="Container"
    type="javax.mail.Session"
    mail.smtp.host="localhost"/>
</Context>

One thing I think we can change for sure is the debug="true"
parameter, but given the requirement to allow us to hot deploy jsp
files (but not jars or classes), can we change reloadable to false?
The documentation suggests that this very resource intensive and I
would like to remove it "it requires significant runtime overhead and
is not recommended for use on deployed production applications" [1]

Any other suggestions to the application context, or server xml warmly
welcomed :)

Thanks,
Kev
[1] http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

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

Reply via email to