I lately installed Apache w/s + Tomcat and taking advantage of jk could route demands from apache to t/c. The good examples around the internet are often from the form:
JkMount /*.jsp myTC
We've several JEE programs running on one demonstration of tomcat (then why would you use apache? trust me i've reasons). I believed we're able to alter the context for every of individuals programs to something similar to:
/servlet/application1/ /servlet/application2/ /servlet/application3/
after which have something similar to:
JkMount /servlet/* myTC
This could route the demands to tomcat properly, however, the question remains how you can serve static assets for any standard Java EE application:
/webapp-root resources/ css/ js/ images/ WEB-INF/ /usual-folder-structure
The questions are:
How you can serve assets/ folder from apache? all of the programs get their own assets/ folder. I figure assets/ will need to reside 'out' from the war as well as on apache's doc-root somewhere, but can't determine the JkMount string.
May be the /servlet/ plan the 'correct' method of doing it? exist designs I ought to follow?
I'll appreciate any help, any pointers to assets around the internet could be great as I have to read much more relating to this.
(1) The next ought to be enough:
JkMount /* myTC JkUnMount /resources/* myTC
(2) It's OK. You will find many correct solutions. Personally, i can't stand /servlet/ within the URL. It's garbage, particularly in this age where Web addresses are an resource of the website/webapp. I personally use this plan:
JkMount /* myTC JkUnMount /*.css myTC JkUnMount /*.ico myTC JkUnMount /*.jpg myTC JkUnMount /*.js myTC JkUnMount /*.png myTC JkUnMount /*.xml myTC JkUnMount /*.zip myTC