tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: MVC or Model2 with Tomcat
Date Sun, 04 Dec 2011 10:41:22 GMT
On 04/12/2011 09:32, Blaxton wrote:
> Apache 2.2.16  is connected to  Tomcat 6.0.29 through mod_jk version 2
> and every thing is working fine, but to implement Model2 or MVC, I need
> to serve JSP files from apache document root and don't know what is 
> the best soluction.

Why do you need to do that to implement MVC?


Mixing Apache HTTPD DocumentRoot and Tomcat appBase's is risky and often
users make mistakes which expose secure data.

Tomcat applications are not comparable with a DocumentRoot.  Each
application is indepedent and may be mapped to path which does not
exactly match the directory name.

Better practice is to separate the two:

 /path/to/httpd/docroot/
 /path/to/httpd/docroot/index.html  -> myhost.com/index.html
 /path/to/httpd/docroot/images

 /path/to/appbase/
 /path/to/appbase/ROOT
 /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
 /path/to/appbase/myapp/index.jsp   -> myhost.com/myapp/index.jsp


> Tried adding following to apache config file but that didn't help serving
> jsp files from apache document root.

Strongly recommend not doing that.


> JkMount /*.jsp ajp13

Without more information about your config, e.g. workers.properties it's
impossible to tell why this didn't work.


> Should i change Apache document root to tomcat's web application root
> to be able to support jsp files in apache document root ?
> 
> Or should i change the Tomcat's docbase to Apache's document root ?

No, definitely not.


> Or it can be done be aliasing in apache config file:
>
> Alias /examples /vat/tomcat3/webapps/examples

No, definitely not.


p



-- 

[key:62590808]


Mime
View raw message