title: How do I create a virtual directory in Tomcat 7?
body: <p>Tomcat is installed at C:\tomcat7\ but I want to deploy .war files in C:\myapp\xyz. For example, I might have C:\myapps\xyz\MyApp.war and I should be able to reach it with the path <a href="http://localhost:8080/MyApp" rel="nofollow">http://localhost:8080/MyApp</a>.</p>
  
  <p>I tried appending this to the bottom of c:\tomcat7\conf\server.xml</p>
  
  <pre><code>      &lt;Host
            name="myapp"
            appBase="c:\myapps\xyz\"
            unpackWARs="true"
            autoDeploy="true"&gt;
        &lt;/Host&gt;
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  </code></pre>
  
  <p>This doesn't seem to work though as I don't see MyApp listed in the management console and I am not able to hit the URL. What else do I need to do?</p>
  
  <p>Also, slightly unrelated but, how can I not have the name of the war file tied to the context name or URL path? For example, I want <a href="http://localhost/coolName" rel="nofollow">http://localhost/coolName</a> to point to C:\myapps\xyz\MyApp.war.</p>