• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Got Tomcat/Apache merged, but...

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a bit of hacking around I finally got Tomcat to play nice with Apache2 on SuSE 9.2; now I can't seem to get Apache to read the default home directory files. When I run localhost/index.jsp, it brings up the file located in $TOMCAT_HOME/webapps/ROOT rather than /srv/www/htdocs. I thought maybe I had configured Tomcat incorrectly somehow and it was running on port 80; when I stopped Apache I was immediately unable to bring up index.jsp. The reverse occured when I restarted Apache.

Any ideas?

Setup:
SuSE 9.2
Sun JDK 1.5.0_02
Tomcat 5.5.7
mod_jk 1.2.10
Apache 2.0.50
[ April 06, 2005: Message edited by: Joe Tseng ]
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am no expert by any means on the Apache/Tomcat marriage. But I will try to explain it the best way I can.

Of course you know that the purpose of the mod_jk connector is to route JSP/Servlet requests thru Apache to Tomcat. Which pretty much makes Apache invisible to the user as far as JSP/Servlet requests are concerned.

The "rules" of deploying applications on TOMCAT still apply. All WAR files are to be deployed in the $CATALINA_HOME/webapps directory. Of course I believe it is possible to modify the server.xml to point to another default directory but that could cause you more headaches.

The rules of deploying applications for Apache still apply. If you place an non JSP page i.e. index.html in Apache's DocumentRoot directory, Apache will service the request. If you do place a JSP page in an Apache DocumentRoot directory, apache will try to service the request. Which I believe it will either display the JSP verbatium or some error message.

For example I have a similar setup as yours
RH9
Apache
Tomcat
mod_jk2
etc.

Another example, I have just one website www.mywebsite.com. Where mywebsite.com is the name of the DocumentRoot directory. And in that directory ,I have one file (index.html) which contains one line, something similar to:


Which will route the user to the JSP index page. The url pattern "/mycontext/*" is configured in the httpd.conf or the workers2.properties.

I hope this helps.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,
What connector are you using between Tomcat and Apache?
If its mod_jk or mod_jk2, then do the following:

check the workers2.properties in your Apache/conf folder.
This files tells the Apache (using the connector) to forward the request to Tomcat

regards,
Rahul..
 
Rahul Singh Khokhar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I missed on reading your connector in your first comments.
Since you are using mod_jk, try the above by looking into workers.properties.
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic