| If you're like me, you probably use a local Tomcat installation to test your server side Java code. Sometimes I have applications that need a more complex install, but most times I can use Tomcat with a local MySql installation to do my rapid developing, and then do more rigorous platform testing on a deployment environment.
In these cases I often have to either configure my
$TOMCAT_HOME/confg/server.xml
, or perhaps let my
Eclipse Sysdeo Tomcat Plug-in
do it for me. Frankly I find the default Tomcat server.xml to be (while comprehensive) a rather messy business to edit by hand and maintain. There is a lot of stuff in it that I really don't want to have to deal with for my local, basic test-base. Here is my example for a nice, simple
server.xml
that doesn't bring any superfluous features or configuration with it:
<Server port="8005" shutdown="SHUTDOWN">
<Service name="Catalina">
<Connector port="8080" />
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" debug="0" appBase="webapps" >
<Context path="/myapp" reloadable="true" reload="true"
docBase="c:\Path_To_My_Application_Web_Base"
workDir="c:\Path_To_My_Application_Work_Folder" debug="0"/>
</Host>
</Engine>
</Service>
</Server>
... and that's it! Much smaller than the default configuration, and easy to understand too! I simply set up a single server, only with the catalina service - and the catalina service is given a single connector (on 8080), and that connector essentially boils down to a single context. Note you could add more hosts and contexts if you wanted/needed to without any major difficulty.
Until next time,
R.J. Lorimer |