tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pier P. Fumagalli" <p...@betaversion.org>
Subject [Tomcat 4.0] Connector configuration:
Date Fri, 08 Dec 2000 15:53:01 GMT
Very very simple... Here's my server.xml file:

<Server port="8005" shutdown="SHUTDOWN" debug="9">

  <Service>

    <Connector
className="org.apache.catalina.connector.warp.WarpConnector"
               port="8008" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="9"/>

    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
            name="engine" debug="9" appBase="webapps">

      <Realm className="org.apache.catalina.realm.MemoryRealm" />

      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="error-" suffix=".log" timestamp="true"/>

      <Valve className="org.apache.catalina.valves.AccessLogValve"
             prefix="access-" suffix=".log" pattern="common"/>

    </Engine>

  </Service>

</Server>

Basically configure the connector in the Service, and all hosts and
applications are auto-configured from Apache's configuration files.

And here's what I added to my httpd.conf:

WebAppConnection  infoConnection info
WebAppConnection  warpConnection warp 192.168.1.105:8008

WebAppMount null                  infoConnection /webappinfo/
WebAppMount testWebApplication    warpConnection /test/
WebAppMount exampleWebApplication warpConnection /example/

And I have test.war and example.war in my webapps directory under the
Tomcat installation.

WarpConnection takes 2 or 3 parameters
1) the unique NAME of the connection
2) the "provider" (or protocol) for the connection
3) a provider-specific parameter

The examples above mean:
- create a new connection called "infoConnection" using the provider
"info" (the "info" provider dumps the current module configurations and
so on...
- create a new connection called "warpConnection" using the provider
"warp" (the "warp" provider is actually the "new" AJPvSomething...
Called WARP - cuter name). This connection is configured to connect to
192.168.1.105 (the host where tomcat is running with the above-mentioned
server.xml file) and the port is the same you see up in that file
(8008).

WebAppMount takes always three parameters:
1) the NAME of the web application (it's not used yet...)
2) the connection name to use (one of the ones configured above)
3) the uri path where this application will be mounted under (following
tomcat standards: put a .war in your webapp directory, like example.war,
and configure the "mount" with the name of the war)

Simple, isn't it?

Also, in server.xml there are no hosts... WHY? because those are
"inherited" by where you put your WebAppMount in your HTTPD.CONF file...
For example, if I say something like:

<VirtualHost ...>
  ServerName server1
  WebAppMount application1 ....
</VirtualHost>
<VirtualHost ...>
  ServerName server2
  WebAppMount application2 ....
</VirtualHost>

The information about the virtual hosts is "copied" down to Tomcat, and
those will behave exactly like if you placed a bunch of hosts in
server.xml... (I hate duplicate configurations)...

Hope you find tons of bugs :)

	Pier

--
Pier Fumagalli <pier@betaversion.org> <http://www.betaversion.org/~pier>

Mime
View raw message