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

Apache - Tomcat 4 + webapps = nightmare

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya,
can someone please give me a quick pointer. I think i know what a webapp is but when your'e integrating tomcat + apache where does your static html go (not in your webapp surely). for example, under tomcat 3.2.3 i had my website under d:\webroot. All I had to do was to add the root context to server.xml and stick my servlets in a web-inf directory under the root (and my jsp on the root) and all was well. Tomcat 4 seems to be making life difficult. I want to serve jsps from several directories under d:\webroot as well as some servlets. can i get the webappdepploy warp thing to find them. I edited server.xml to set the appBase to D:\webroot and tried adding
WebAppDeploy / conn /
to httpd.conf but my system hangs.
I know i can put my jsp etc under the webapps directory in tomcat but where does my apache static stuff go then. ???
thanks in advance for your help
mike
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have configured your tomcat to work with apache, then you should be able to keep your static pages in your folder where u have kept the jsp pages. Configure your server.xml file accordingly.
e.g
if you have the project directory in the webapps folder , your directory structure would be as below:
/webapps/project/ --- jsp and html files
/webapps/project/WEB-INF/ -- web.xml file
/webapps/project/WEB-INF/classes/ -- servlet and java beans
/webapps/project/WEB-INF/lib/ -- the required classes for the tag library

Hope this will help you in clearing your doubt.
Bye
 
Mike Br
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya, thanks for getting back.....
so i can keep my static pages below the current webroot for apache??
do i need to put anything special in web.xml or will just a standard open / close tag be OK??
Thanks again,
mike
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A proper webapp should be self-contained (everything in a single WAR file). That includes the html, images, etc.
Note that Tomcat CAN serve up static content - the front-end Apache is only a performance boost.
However, for Apache+Tomcat, you direct Apache to the directory you've unpacked the webapp into, and, since it gets first shot at content, it will pick up the static content and serve it directly, but detect servlet and JSP references and pipe them to Tomcat.
Some appservers might not unpack the WAR, or might place them somewhere unpredictable - OR, perhaps, Apache is on a different machine. In this case, you can unpack the WAR into a directory convenient to Apache, excluding the WEB-INF (and META-INF) directories, since they're meaningless to Apache.
[ April 10, 2002: Message edited by: Tim Holloway ]
 
Mike Br
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim...
can i then........
have my apache statics etc on say D:\webroot
put all my jsp + servlets in a directory under tomcat webapps (with its web-inf. meta-inf etc) called 'project' for example
then use the webappdeploy directive in httpd.conf to only forward *.jsp or /servlet/ to the webapp.
how would this look??
WebAppDeploy project conn *.jsp
WebAppDeploy project conn /servlet/
is that it??
thanks again for your time
mike
 
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic