File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)" Watch "Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)" New topic
Author

Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)

Axel Brown
Greenhorn

Joined: Feb 12, 2008
Posts: 25
Hi good people of Java Ranch! My first post here...

I'm trying to configure Apache 2.2.8, mod_jk/1.2.26 and Tomcat 5.5.25 on Linux RHEL 4 es.

Finally, trough some "non generic" methods I got everything working but I feel it isn't right, so please take a look and please let me know what is the problem.

All started after I migrated one of my addon domains from a shared hosting to dedicated. No problem with java code (everything works on my old shared server), it looks like a configuration issue.

My classes are packaged and stored in a JAR in WEB-INF/lib. Basically, I have a JSP with a form where drop down boxes get populated from DB. This part works. Than I have a submit button that invokes a servlet /Start.

As soon as I hit submit, url immediately redirects to 404 page. So, looks like it can't find a servlet, which is in the same package as other classes.

So, after playing around, I figured this is related to JkMount in httpd.conf. Basic config had this:



As soon as I added /servlet/Start to the submit action and changed web.xml url-pattern to /servlet/Start submit worked and servlet was invoked.
But I need my servlet to be invoked as /Start and url should be
www.myaddondomain.com/Satrt not www.myaddondomain.com/servlet/Start

So, I added to the httpd.conf to my <Host> and it works now. But, now I let Tomcat to handle everything, including php, html and other stuff. So, I had to add a few JkUnMount parameters in order for Apache to process them.

This is where I feel it isn't right. I'm not supposed to tell Tomcat what NOT to process. I should tell it to process only JSPs and servlets. But looks like it processes servlets only if I specify /servlet/ in form action and web.xml.

Please help me to resolve this problem. Here are related samples of my httpd.conf, server.xml and web.xml (domain names, IPs, passwords and user changed for example porpuses).


-----------------
httpd.conf
-----------------




-----------------
server.xml
-----------------




-----------------
web.xml
-----------------



[ February 13, 2008: Message edited by: Axel Brown ]
[ February 13, 2008: Message edited by: Axel Brown ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)
 
Similar Threads
Apache-Tomcat Integration Problem: only works locally.
Apache 1.3 / Tomcat 4.0 Configuration Problem
include doesn't recognize relative path from sub folder
Tomcat 4.1.12 not executing JSP on Sun OS
My web.xml is good?, why no run my servlets into folder /servlets/ ???