title: Apache Tomcat virtual directories. Redirects to wrong location. ColdFusion Lucee
body: <p>I am trying to get a local version of Lucee ColdFusion running my app - which resides as two directories... the main app, and the client custom code.
  To that myDomain.com should pull from the 'site' and myDomain.com/app/ should pull from the app.</p>
  
  <p>I can be logged in to my site, and pulling data via includes etc, but if I try to browse (or make a call to) /app/cfc/myCFC.cfc ...
  the behavior redirects to the 'root' and logs my app out.</p>
  
  <p>my server XML looks like this</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  
  &lt;Server port="8005" shutdown="SHUTDOWN" &gt;
  
      &lt;Listener className="org.apache.catalina.startup.VersionLoggerListener" /&gt;
      &lt;Listener className="org.apache.catalina.core.AprLifecycleListener"  SSLEngine="on" /&gt;
      &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;
      &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;
      &lt;Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /&gt; 
  
      &lt;Service name="Catalina" &gt;
  
          &lt;Connector port="8888" 
                      protocol="HTTP/1.1"
                      connectionTimeout="20000"
                      redirectPort="8443" /&gt;
  
          &lt;Connector port="8009" 
                      protocol="AJP/1.3" 
                      redirectPort="8443" /&gt;
  
          &lt;Engine name="Catalina" 
                  defaultHost="127.0.0.1" &gt;
  
              &lt;Host name="local.dev.myDomain.com" appBase="webapps" &gt;
                  &lt;Context path="/" docBase="C:\wwwroot\site" /&gt;
                  &lt;Context path="/app" docBase="C:\wwwroot\app" /&gt;
              &lt;/Host&gt;
  
          &lt;/Engine&gt;
  
      &lt;/Service&gt;
  
  &lt;/Server&gt;
  </code></pre>
  
  <p>If it helps to understand; this is a legacy app running in production on Windows, Apache 2.2 and ColdFusion 11. I have the app aliased in Apache 2.2 like this:</p>
  
  <pre><code>Alias /app/ C:/wwwroot/app
  </code></pre>
  
  <p>I am trying to evaluate Lucee to see if our app will work on that platform without too many changes.</p>
  
  <p>One noticeable difference, due to using the built in webserver, is the port 8888
  so the actual url looks like: mydomain.com:8888/app/cfc
  I do not know if this is the problem or something else. If I cannot find a solution, I'll install Apache 2.2 and match the config </p>
  
  <p>Any help is greatly appreciated - jp</p>
  
  <p>NOTE: I just changed the host in this txt to accurately mimic my setup - if that makes a difference.
  local.dev.myDomain.com (only the 'myDomain' is specifically my domain, not literally myDomain)</p>