File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to map apache to tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to map apache to tomcat?" Watch "How to map apache to tomcat?" New topic

How to map apache to tomcat?

Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
I have several users under /home/users on my redhat7.3. I want their directories can support JSP and servlet.
So far as the apache-tomcat-connetor is concerned, I cannot find the mod_jk from and
Now, I installed the which downloaded from
I read the doc
but unable to configure the server.xml and httpd.conf files.
In mod_webapp, there is no, how should I map apache to tomcat4?
Thanks for help
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
I removed the and install But, httpd shows an error and cannot be started now.
Loaded DSO modules/ uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with - DEAPI).
What does it mean and how should I do it now?
According to, here were my steps (Please tell me which part I was wrong):
1. I installed mod_jk-1.3-1.0- which was downloaded from
2. I downloaded, rename it to and replace the one located under /usr/lib/apache/
3. Modify: /etc/httpd/conf/
4. Add to: /var/tomcat4/conf/server.xml
5. Add to: /etc/httpd/conf/httpd.conf
6. Modify: /etc/httpd/conf/mod_jk.conf
Thanks for any advice.
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
anyone could help?
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
The apache can connect to tomcat.
When I run http://localhost/examples/servlet/MyHelloWorld, it works now.
I did not setup Virtualhost. However, I have many users like localhost/~userA.
I tried to add JkMount /*.jsp ajp13, JkMount /servlet/* ajp13 to httpd.conf in-between <Directory /home/*/html> </Directory>.
However, the apache cannot be started because they cannot be added in-between <Directory>.
I also tried to add <Host name="localhost/~userA">
<Context path="" docBase"/home/userA/html" /></Host> to server.xml.
But, it still did not work.
So, how should I configure httpd.conf, and server.xml or other files in order to make it work?
And advice?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17282

You probably would have gotten more responses if you'd asked this in the Apache/Tomcat Forum.
Ypu might be able to convert the URLs from the "~" shorthand to explicit paths using mod_rewrite, but I don't guarantee it, since mod_webapp has been known to be greedy and grab stuff before other Apache modules can see it. Maybe Apache 2.0 is better equipped to handle that.
Mod_webapp was supposed to get friendlier in that regard, but if it has, it's been within the last 6 months, since that's when I last researched it.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: How to map apache to tomcat?
It's not a secret anymore!