Quick Setup of Tomcat with mod_jk under RedHat 9.0

RedHat Linux comes, like most distributions, shipped with an Apache HTTP Server. When starting on school with classes on Java Server Pages, most people assumed this was going to be done under Windows (a poor man's operating system). Of course I didn't want to give up my free-software position, so I started to look what I needed to do to get JSP pages running under Linux. I browsed to the Jakarta Project (http://jakarta.apache.org/) and looked into installing a Tomcat webserver on my RedHat Linux 9 PC.

Though the first steps where pretty simple, running JSP under my already installed Apache HTTP Server caused me some headaches. At the end I have to say that these headaches were not caused by difficuly installation routines, but more by large amounts of documentation which just didn't get to the point. Below are the steps I took to get it all running. I hope it will turn out easier for you, if you do the same thing.

Note that you can run both Tomcat and Apache HTTP Server on one and the same machine, but you'll need a mod_jk if you want to have communication between both(!) servers and the outside world. Actually only Apache HTTP Server listens to the outside world, while Tomcat listens to Apache.

Setup of Tomcat

Now the mod_jk module

So far so good, and easy. But I had now two webservers running: Apache listening to port 80 and Tomcat listening to port 8080. It didn't seem to be a good idea to me. So the next thing to do was getting a mod_jk Apache module to load into the Apache server, which passes JSP-requests through to the Tomcat server, which can only be reached internally (localhost).

The Apache server shipped with RedHat 9 is version 2.0.40. I looked around on the Internet, but nowhere I could find a precompiled mod_jk module (mod_jk.so) for this Apache version. Using modules precompiled for other versions, didn't work out either - Apache complained about a wrong version. So I had to compile my own. I had to experience again how wonderfull life with open source software can be.

Many sites (to my own impression even the Jakarta Project itself) make you believe you need Ant to compile the module, or the complete source code of the Apache server (which isn't shipped with RedHat), or a large list of JAR files from both the Jakarta Project. I wanted to keep it simple. At the end, I did.

Finishing touch

My own spam-spamming page

The following addresses are spamtraps. Do not use them or you will be banned from hundreds of web sites

Webmaster Editor Sales