Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP file location under Tomcat

 
Dave Comeau
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I apalogize if this question is way to newbie. Feel free to point me to a FAQ.
I've just installed Tomcat, along with the mod_webapp.so module for Apache on OSX (http://developer.apple.com/internet/macosx/tomcat1.html). Everything is up and running fine.
The way my httpd.conf is set up now, I have to place all jsp files in a directory seperate from the root web directory, in order for Tomcat to handle them. Here is the config from httpd.conf.

All calls to localhost/examples/ get re-directed from the root web directory, to /usr/local/jakarta-tomcat-4.0.3/webapps/
My question is, can I set up httpd.conf to allow Tomcat to process files by extension, rather than by directory, similar to PHP AddType directive? So I can have .jsp files in my root web directory?
Or is it standard that .jsp files live outside the root web directory tree?
[ June 14, 2002: Message edited by: Dave Comeau ]
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each main directory under webapps is a web application to Tomcat. ROOT just happens to be the one that be called when you don't type in a directory after localhost on your URL.
If you want your webapp to be the default app for tomcat, just deploy to the ROOT directory. Or tell web.xml (or is it server.xml?) which directory is your root app. Check web/server.xml for the config for ROOT and change or copy it accordingly. They'd be in your tomcat/conf directory.
Adam
 
Dave Comeau
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Adam. I should have clarified I was talking about the Apache root web directory tree, not the Tomcat ROOT directory.
But things are making more sense to me as I let them sink in, and read everything I can get my hands on.
It looks like mod_jk is the apache module that I'm looking for. That would allow me to put .jsp files in the Apache root web directory, have them comiled my Tomcat, while defining a seperate directory for servlets. Correct?
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly I'm not sure. maybe somebody else knows - there were a couple of others around here who've been playing with tomcat + apache.
Sorry
Adam
 
Dave Comeau
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Adam.
Actually, mod_webapp is working out fine for me. I'm just so used to working with PHP and Apache, I want things to be set up the same.
I'm quickly realizing Tomcat is not Apache and JSP is not PHP
[ June 19, 2002: Message edited by: Dave Comeau ]
 
Andrew Parker
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,
I have the similar problem with you. Could you tell me how to add the mod_webapp module to the httpd.conf and how to edit web.xml in order to let /home/users to use jsp pages on their apache web server?
Any tutorial or faq is welcome.
Thanks
Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic