Note that there are some explanatory texts on larger screens.

plurals
  1. POMod_JK, Tomcat & Apache Httpd "File not found" when using Alias
    primarykey
    data
    text
    <p>I've been trying to find a solution to what I think should be a very common use of Alias with Tomcat &amp; Apache Httpd but I can't find it.</p> <p>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.</p> <p>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.</p> <p>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.</p> <p>I tried using a <code>&lt;Context path...</code> 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.</p> <p>Any help is appreciated. Thanks!</p> <pre><code>&lt;VirtualHost *:80&gt; DocumentRoot "/webapps/ROOT" Alias /folderB "webapps/ROOT/folderA" JkMount /folderB/* myWorker ServerName myServer.local ServerAlias www.myServer.local ErrorLog "logs/myServer.local-error.log" &lt;/VirtualHost&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload