tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "v.siguier" <v.sigu...@voila.fr>
Subject Re: Apache + Tomcat + mod_jk
Date Thu, 31 Jul 2003 16:04:37 GMT
I am agree with you, only one location for all my application resources is better but my customer
want to separate static resources from dynamic resources.
You tell me that only JkMount directives indicate which serv files, or in my mod_jk.conf there
is only :
JkMount /geode/jsp/j_security_check  ajp13
JkMount /geode/*.jsp  ajp13
so I don't understand why an URL like http://host:port/geode/index.html (ie htdocs/geode/index.html)
is not found, exact message is : "The requested URL /geode/index.html was not found on this
server".


> 
> Which server (Apache or Tomcat) actually serves the file has nothing to
> do with file location.
> 
> Which server (Apache or Tomcat) actually serves the file is completely
> driven by the JkMount directives.  JkMount is inclusive...that is,
> unless you define a JkMount for a particular URI, the file will be
> served by Apache.
> 
> Thus:
> 
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> 
> means that ONLY JSP and servlet will be handled by Tomcat, ALL OTHER
> requests will be handled by Apache.
> 
> Thus, putting your static resources under your web application's
> directory structure makes it easier on you when deploying, because you
> only have to deploy to one location.  Again, where the files are located
> has NOTHING to do with which server (Apache or Tomcat) handles the request.
> 
> By "DocumentRoot" I mean "tell Apache where the DocumentRoot is".  Thus,
> with a DocumentRoot equal to the location of your Tomcat web
> application, all of your files can exist in one location, and as long as
> Apache has access permisssions to the web application root directory,
> Apache will handle requests for those files, not Tomcat.
> 
> webapps
> ...geode
> ......index.jsp
> ......static.html
> ......image.gif
> ......WEB-INF
> .........web.xml
> .........classes
> ............YourServlet.class
> 
> DocumentRoot equals CATALINA_HOME/webapps/geode
> 
> http://host/geode/static.html works.
> http://host/geode/image.gif works.
> http://host/geode/index.jsp works.
> http://host/geode/servlet/* works (provided you map your servlets
> correctly in webapps/geode/WEB-INF/web.xml).
> 
> John
> 
> v.siguier wrote:
> 
> > I would like to put .html files under htdocs/geode, .js under htdocs/geode/javascript
and all images under htdocs/geode/images.
> > If the user want to access to a html file (http://host:port/geode/*.html), I want
it to be served by Apache.
> > If the user want to access to a servlet (http://host:port/geode/servlet/*), I want
it to be served by Tomcat.
> > If the user want to access to a jsp (http://host:port/geode/jsp/*.jsp), I want it
to be served by Tomcat.
> > 
> > I hope these precision will help you to understand exactly what I try to do.
> > What do you mean by DocumentRoot "C:/jakarta-tomcat-4-1-24/webapps/geode" ?
> > 
> > 
> > Thank you for your help.
> > 
> > 
> >>DocumentRoot "C:/jakarta-tomcat-4-1-24/webapps/geode"
> >>
> >>You will need to copy the mod_jk.conf file to some other location and 
> >>modify it manually.  Change your Include line in httpd.conf to reflect 
> >>the new location.  I like to put mine in the Apache conf directory.
> >>
> >>I'm not sure what you mean exactly by "directly under Apache"...as 
> >>Apache doesn't care where files are located as long as it has the 
> >>appropriate permissions to access them and can find them.  Your files do 
> >>not have to be under any particular directory.
> >>
> >>I'd have to know more about where you want to put your static resources 
> >>exactly.
> >>
> >>Another option is to do something like:
> >>
> >>Alias /static "C:/path/to/static/stuff"
> >>
> >>There are various ways to do it, without knowing exactly what your dir 
> >>structure is, what URL you want to use, etc. it is hard to give you a 
> >>specific answer.  In any case, you will likely have to modify 
> >>mod_jk.conf by hand, which means putting it in a location where it won't 
> >>be overwritten each time you start Tomcat, otherwise you will have to 
> >>make the same changes over and over again.
> >>
> >>The whole mod_jk.conf thing is a convenience.  It doesn't scale very 
> >>well at all.  I don't use it for my production servers, I make my 
> >>changes by hand.  Its in my HOWTO because its the easiest way for a 
> >>newbie to get up and running.  For complex setups (especially multiple 
> >>virtual hosts and multiple webapps) you will want to avoid relying on it.
> >>
> >>John
> >>
> >>v.siguier wrote:
> >>
> >>
> >>>No problem, my question is :
> >>>I have configured Apache and Tomcat with mod_jk in order to connect them
together but now all ressources of my application must be located under Tomcat directory to
be founded.
> >>>As I want to put all static ressources directly under Apache, somebody can
tell me what I have to configure in Apache or Tomcat to do this ?
> >>>
> >>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message