I've been trying to find a solution to what I think should be a very common use of Alias with Tomcat & Apache Httpd but I can't find it.
I have Tomcat running my application server and I want to be able to use aliases to serve dynamic content. I configured Apache Httpd as the front end with Mod_JK to serve all dynamic files via Tomcat. This works fine except when using aliases as Tomcat doesn't know how to handle the Alias.
Basically I have my Tomcat application /webapps/myApp inside that I have "/folderA" so using http:localhost:8080/myApp/folderA works fine as well as localhost/myApp/folderA. I want to be able to user /folderB to point to /folderA and serve dynamic content and that's when things fail.
I have everything working well with mod_jk and the alias requests get redirected to Tomcat, however Tomcat does not know what to do with the alias so it tries to find /webapps/myApp/folderB which doesn't exists so I get a "file not found" error.
I tried using a <Context path...
but then I get served static content. I also tried using Apache RewriteRule to pass requests from /folderB to /folderA but that doesn't work either. Below is an example of the VirtualHost settings I have. I'm guessing I need to do something in Tomcat's end so that it knows how to handle /folderB and point it to /folderA OR to make httpd translate /folderB to /folderA before passing the info to Tomcat.
Any help is appreciated. Thanks!
<VirtualHost *:80>
DocumentRoot "/webapps/ROOT"
Alias /folderB "webapps/ROOT/folderA"
JkMount /folderB/* myWorker
ServerName myServer.local
ServerAlias www.myServer.local
ErrorLog "logs/myServer.local-error.log"
</VirtualHost>