• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic