Configuring Distributed Networks with Tomcat

So far, you’ve seen a configuration where you have both the Web server, be that IIS or Apache, and Tomcat running on the same physical server. This is useful for smaller implementations. However, in a production environment, you may be interested in a more scalable solution where you’d like to partition your architecture into multiple tiers so that the presentation layer or static HTML pages are served up by IIS or Apache on one machine and the Web applications are hosted by Tomcat workers each residing on a separate server. This makes the system more scalable because you have dedicated machines performing dedicated tasks.

In addition to scalability, you may also be interested in a distributed configuration to support multiple development and test environments, virtual hosting, and load-balanced Tomcat workers. In this section, you’ll build on the previous concepts and look at the configuration changes required to build scalable distributed configurations of Web servers and Tomcat. This section deals with mod_jk2 and its ISAPI equivalent, though the discussion is equally applicable to mod_jk.

First, let’s look at the software on each sever. The server that has the static Web server running on it will also host the AJP module and the configuration file (workers2.properties). Note that the JDK and the Tomcat binaries aren’t required on this server.

The server that has the full Tomcat install must have a connector and a Tomcat worker configured on it, and the Tomcat worker must be running on a known port. Note that if you had multiple Tomcat workers distributed across multiple servers servicing the same Web application, you’d want to duplicate the Web application files across all these servers.

Second, let’s look at the configuration changes required. The following shows how to specify a worker on another server in workers2.properties:

 [channel.socket:remoteserver:8009]  [ajp13:remoteserver:8009]  channel=channel.socket:remoteserver:8009  [status:statusWorker]  styleMode=1  [uri:/jkstatus]  group=status:statusWorker  [uri:/jsp-examples/*] 

It’s as easy as that, though this example simply uses a single Tomcat worker on a remote machine. You could have multiple Web servers that make up a Web server farm, which is load balanced using a load-balancing switch. The next section describes this scenario, which was also touched on in Chapter 7.

These configurations are possible with AJP, and the concepts remain the same whether you’re using Apache or IIS as the Web server. The previous sections have covered this extensively, and the configuration file settings are identical for all servers.

Finally, notice that once you begin partitioning your architecture into Web server and application server configurations, you have paved the way for a heterogeneous system, so even though you use IIS for the Web server, your application server can be Linux based. It’s now time to discuss load balancing.



Pro Jakarta Tomcat 5
Pro Apache Tomcat 5/5.5 (Experts Voice in Java)
ISBN: 1590593316
EAN: 2147483647
Year: 2004
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net