| Beacon Hill, Inc. | Technology Solutions |
Home > Knowledge Base > Cygwin > Tomcat setup on Cygwin
A lot of times you'll want to front Tomcat with Apache. In this configuration you'll typically have Apache hosting static web pages and having Tomcat manage J2EE applications. In this setup you'll want to have all your URLs going through Apache on port 80 and for a user to not have to go to a 8080 url.
To manage this setup you'll need to configure a Tomcat Connector. There are a number of connectors so you may want to keep that in mind as you read the following.
mod_jk
The connector we'll setup is called mod_jk. mod_jk is a Tomcat-Apache plug-in that handles the communication between Tomcat and Apache. To understand mod_jk you need to be aware of certain definitions and terminology used when describing mod_jk.
The first is the concept of a worker. In this case a worker is a Tomcat instance that is running to serve servlet request coming from a web server (in our case Apache).
The web server plug-in or Tomcat redirector are terms used in our case for the mod_jk. This is the "agent" that resides in the web server and is configured to send servlet requests to Tomcat. The web server will have configuration information to define the "agents" behavior.
Steps
Build and Install mod_jk Configure Apache
Build and Install mod_jk
Configure Apache
Examples
We'll use the example application that ships with Tomcat as a reference point. Given a default install the following URL should pull up the Tomcat example application.
http://localhost:8080/examples
After, we front Tomcat with Apache we should be able to see the same application with this URL.
http://localhost/examples
Tomcat configuration files
You need to know where you've install Tomcat (see tomcat-setup.txt). Inside the Tomcat installation is a directory called
Where is Apache
Make sure you know how to start and stop Apache as well as where its configuration files are located. I my system I need to know the following.
Starting Apache: /usr/sbin/apachectl2 start Stopping Apache: /usr/sbin/apacjectl2 stop
Configuration: /etc/apache2
Where do you have Tomcat installed?
In my system I have a convention to install tools in a subdirectory under my home directory. On servers this will be different so you'll have to figure out things on your system yourself.