Tomcat 5.0, and multiple projects

I have two separate projects that I'd like to develop using Tomcat 5.0. BOTH projects need to be in the ROOT or / context.

How should I setup my projects and tomcat installation to be able to debug each? (I don't have to debug them both at the same time, but that would be nice.)

3 comments
Comment actions Permalink

We create a service/host/context for each application. Each host has
it's own connectors (ports) assigned to it. This allows for multiple
applications to run as /. Your URL's look like http://localhost:9001
and http://localhost:9002, etc with whatever port number you selected
for each context's connector port.

IntelliJ did not support this the last time I tried it. They have made
a change since then, so maybe they will work. Either way, you could
always connect to Tomcat remotely.

If you are REALLY interested in if IntelliJ 4.5.1 will support this
set-up, I will redo my config and retest it.

Ian Zabel wrote:

>I have two separate projects that I'd like to develop using Tomcat 5.0. BOTH projects need to be in the ROOT or / context.
>
>How should I setup my projects and tomcat installation to be able to debug each? (I don't have to debug them both at the same time, but that would be nice.)

>

--

Norris Shelton
Sun Certified Java Programmer

0
Comment actions Permalink

That would work well for me, I think, using different ports.

Where would I configure this? In tomcat5's installation directory's server.xml, or somewhere in intellij?

0
Comment actions Permalink

In Tomcat 4, we made all of the changes in the server.xml. Tomcat 5
would require a slightly different approach. Here is what we have for
Tomcat 4 (each of our applications has an entry like this):
<Service name="Tomcat-justicexchange">
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="9001" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="10001"
acceptCount="10" debug="0" connectionTimeout="60000"/>
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="10001" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
]]>
<Engine name="JusticeXchange" defaultHost="localhost" debug="0">
]]>
<Host name="localhost" debug="0"
appBase="webapps/justicexchange" unpackWARs="false">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="justicexchange_access_log."
suffix=".txt"
pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="justicexchange_log."
suffix=".txt"
timestamp="true"/>
<Context docBase="." priveleged="false" path=""/>
</Host>
</Engine>
</Service>

1. The service name has to be unique for all of your services.
2. Make sure your redirectPort property of your connector is set for
your SSL port. You may not even need this unless you want Tomcat
to handle your SSL. NOTE: IE does not automatically switch to
your redirect port if it is not the standard SSL port (e.g. 443).
Firefox, Mozilla, Netscape and Opera work correctly.
3. I think you engine name only has to be unique within a service,
but we always made ours unique.
4. The host name SHOULD BE localhost. The IT guys around here used
to give them unique names until it bit them in the anus. This is
actually the name of the host that it will run on. Make it
localhost and your life is easier.
5. The appBase property of the Host needs to be your context. In
this case, justicexchange.
6. Modify the prefix property of the access log valve if you want
these to go into a separate log (if at all).
7. Modify the prefix property of the logger valve if you want these
to go into a separate log.


This same server.xml entry can be used for Tomcat 5, but is no longer
recommended. Now the context entry would be located in an xml file
located in the conf/service_name/engine_name directory.

I hope I have not confused you too much. Most people do not think that
the tomcat webserver is production ready, but it definately is. We have
this configuration, then a BigIP in front to forward the requests for
the various DNS entries to their respective port on the tomcat servers.



Norris Shelton
Sun Certified Java Programmer




Ian Zabel wrote:

>That would work well for me, I think, using different ports.
>
>Where would I configure this? In tomcat5's installation directory's server.xml, or somewhere in intellij?

>

0

Please sign in to leave a comment.